Skip to content

feat: move empty_record to header (#453)

Sign in for the full log view
GitHub Actions / clippy succeeded Dec 2, 2024 in 1s

clippy

81 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 81
Note 0
Help 0

Versions

  • rustc 1.83.0 (90b35a623 2024-11-26)
  • cargo 1.83.0 (5ffbef321 2024-10-29)
  • clippy 0.1.83 (90b35a6 2024-11-26)

Annotations

Check warning on line 140 in src/bam/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the type `hts_sys::bam1_t` does not permit being left uninitialized

warning: the type `hts_sys::bam1_t` does not permit being left uninitialized
   --> src/bam/record.rs:140:42
    |
140 |                 let mut inner = unsafe { MaybeUninit::uninit().assume_init() };
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |                                          |
    |                                          this code causes undefined behavior when executed
    |                                          help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
    |
    = note: integers must be initialized
    = note: `#[warn(invalid_value)]` on by default

Check warning on line 33 in src/tpool.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of an `Arc` that is not `Send` and `Sync`

warning: usage of an `Arc` that is not `Send` and `Sync`
  --> src/tpool.rs:33:26
   |
33 |             let handle = Arc::new(RefCell::new(inner));
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `Arc<RefCell<InnerThreadPool>>` is not `Send` and `Sync` as `RefCell<InnerThreadPool>` is neither `Send` nor `Sync`
   = help: if the `Arc` will not used be across threads replace it with an `Rc`
   = help: otherwise make `RefCell<InnerThreadPool>` `Send` and `Sync` or consider a wrapper type such as `Mutex`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#arc_with_non_send_sync
   = note: `#[warn(clippy::arc_with_non_send_sync)]` on by default

Check warning on line 330 in src/tbx/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> src/tbx/mod.rs:330:6
    |
330 | impl<'a, R: Read> Iterator for Records<'a, R> {
    |      ^^                                ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
330 - impl<'a, R: Read> Iterator for Records<'a, R> {
330 + impl<R: Read> Iterator for Records<'_, R> {
    |

Check warning on line 92 in src/faidx/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric constant

warning: usage of a legacy numeric constant
  --> src/faidx/mod.rs:92:18
   |
92 |         if end > std::i64::MAX as usize {
   |                  ^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
   |
92 |         if end > i64::MAX as usize {
   |                  ~~~~~~~~

Check warning on line 89 in src/faidx/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

usage of a legacy numeric constant

warning: usage of a legacy numeric constant
  --> src/faidx/mod.rs:89:20
   |
89 |         if begin > std::i64::MAX as usize {
   |                    ^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
   |
89 |         if begin > i64::MAX as usize {
   |                    ~~~~~~~~

Check warning on line 243 in src/bgzf/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/bgzf/mod.rs:243:9
    |
243 |         return Ok(ffi::CString::new(write_string).unwrap());
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
243 -         return Ok(ffi::CString::new(write_string).unwrap());
243 +         Ok(ffi::CString::new(write_string).unwrap())
    |

Check warning on line 220 in src/bgzf/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

comparing with null is better expressed by the `.is_null()` method

warning: comparing with null is better expressed by the `.is_null()` method
   --> src/bgzf/mod.rs:220:12
    |
220 |         if inner != std::ptr::null_mut() {
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_null

Check warning on line 90 in src/bgzf/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

comparing with null is better expressed by the `.is_null()` method

warning: comparing with null is better expressed by the `.is_null()` method
  --> src/bgzf/mod.rs:90:12
   |
90 |         if inner != std::ptr::null_mut() {
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_null
   = note: `#[warn(clippy::cmp_null)]` on by default

Check warning on line 799 in src/bcf/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
   --> src/bcf/mod.rs:799:6
    |
799 | impl<'a, R: Read> Iterator for Records<'a, R> {
    |      ^^                                ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
    |
799 - impl<'a, R: Read> Iterator for Records<'a, R> {
799 + impl<R: Read> Iterator for Records<'_, R> {
    |

Check warning on line 324 in src/bcf/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

doc list item without indentation

warning: doc list item without indentation
   --> src/bcf/mod.rs:324:9
    |
324 |     /// is given, records are fetched from `start` until the end of the contig.
    |         ^
    |
    = help: if this is supposed to be its own paragraph, add a blank line
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
help: indent this line
    |
324 |     ///   is given, records are fetched from `start` until the end of the contig.
    |         ++

Check warning on line 1557 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
    --> src/bcf/record.rs:1557:6
     |
1557 | impl<'a> Iterator for Filters<'a> {
     |      ^^                       ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
     |
1557 - impl<'a> Iterator for Filters<'a> {
1557 + impl Iterator for Filters<'_> {
     |

Check warning on line 1541 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a, 'b

warning: the following explicit lifetimes could be elided: 'a, 'b
    --> src/bcf/record.rs:1541:13
     |
1541 | unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Sync for Format<'a, B> {}
     |             ^^  ^^                                          ^^                  ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
     |
1541 - unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Sync for Format<'a, B> {}
1541 + unsafe impl<B: BorrowMut<Buffer> + Borrow<Buffer> + '_> Sync for Format<'_, B> {}
     |

Check warning on line 1541 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this lifetime isn't used in the impl

warning: this lifetime isn't used in the impl
    --> src/bcf/record.rs:1541:17
     |
1541 | unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Sync for Format<'a, B> {}
     |                 ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes

Check warning on line 1539 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a, 'b

warning: the following explicit lifetimes could be elided: 'a, 'b
    --> src/bcf/record.rs:1539:13
     |
1539 | unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Send for Format<'a, B> {}
     |             ^^  ^^                                          ^^                  ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
     |
1539 - unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Send for Format<'a, B> {}
1539 + unsafe impl<B: BorrowMut<Buffer> + Borrow<Buffer> + '_> Send for Format<'_, B> {}
     |

Check warning on line 1539 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this lifetime isn't used in the impl

warning: this lifetime isn't used in the impl
    --> src/bcf/record.rs:1539:17
     |
1539 | unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Send for Format<'a, B> {}
     |                 ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes

Check warning on line 1503 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
    --> src/bcf/record.rs:1503:22
     |
1503 |                 .map(|s| trim_slice(s))
     |                      ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `trim_slice`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

Check warning on line 1480 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
    --> src/bcf/record.rs:1480:22
     |
1480 |                 .map(|s| trim_slice(s))
     |                      ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `trim_slice`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
     = note: `#[warn(clippy::redundant_closure)]` on by default

Check warning on line 1385 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a, 'b

warning: the following explicit lifetimes could be elided: 'a, 'b
    --> src/bcf/record.rs:1385:13
     |
1385 | unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Sync for Info<'a, B> {}
     |             ^^  ^^                                          ^^                ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
     |
1385 - unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Sync for Info<'a, B> {}
1385 + unsafe impl<B: BorrowMut<Buffer> + Borrow<Buffer> + '_> Sync for Info<'_, B> {}
     |

Check warning on line 1385 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this lifetime isn't used in the impl

warning: this lifetime isn't used in the impl
    --> src/bcf/record.rs:1385:17
     |
1385 | unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Sync for Info<'a, B> {}
     |                 ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes

Check warning on line 1383 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a, 'b

warning: the following explicit lifetimes could be elided: 'a, 'b
    --> src/bcf/record.rs:1383:13
     |
1383 | unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Send for Info<'a, B> {}
     |             ^^  ^^                                          ^^                ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
     |
1383 - unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Send for Info<'a, B> {}
1383 + unsafe impl<B: BorrowMut<Buffer> + Borrow<Buffer> + '_> Send for Info<'_, B> {}
     |

Check warning on line 1383 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this lifetime isn't used in the impl

warning: this lifetime isn't used in the impl
    --> src/bcf/record.rs:1383:17
     |
1383 | unsafe impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Send for Info<'a, B> {}
     |                 ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes

Check warning on line 1361 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions
    --> src/bcf/record.rs:1361:32
     |
1361 |     pub fn string(mut self) -> Result<Option<BufferBacked<'b, Vec<&'b [u8]>, B>>> {
     |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
     = note: `#[warn(clippy::type_complexity)]` on by default

Check warning on line 1280 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the following explicit lifetimes could be elided: 'a

warning: the following explicit lifetimes could be elided: 'a
    --> src/bcf/record.rs:1280:6
     |
1280 | impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Info<'a, B> {
     |      ^^                                                       ^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
     |
1280 - impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Info<'a, B> {
1280 + impl<'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Info<'_, B> {
     |

Check warning on line 1228 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

dereferencing a tuple pattern where every element takes a reference

warning: dereferencing a tuple pattern where every element takes a reference
    --> src/bcf/record.rs:1228:13
     |
1228 |         let &Genotype(ref alleles) = self;
     |             ^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference
     = note: `#[warn(clippy::needless_borrowed_reference)]` on by default
help: try removing the `&` and `ref` parts
     |
1228 -         let &Genotype(ref alleles) = self;
1228 +         let Genotype(alleles) = self;
     |

Check warning on line 1129 in src/bcf/record.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

returning the result of a `let` binding from a block

warning: returning the result of a `let` binding from a block
    --> src/bcf/record.rs:1129:13
     |
1128 |             let inner = htslib::bcf_dup(self.inner);
     |             ---------------------------------------- unnecessary `let` binding
1129 |             inner
     |             ^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
     = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
     |
1128 ~             
1129 ~             htslib::bcf_dup(self.inner)
     |