term_freq in TermFrequencyRecorder untested #2286
clippy
7 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 7 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.74.1 (a28077b28 2023-12-04)
- cargo 1.74.1 (ecb9851af 2023-10-18)
- clippy 0.1.74 (a28077b 2023-12-04)
Annotations
Check warning on line 750 in src/snippet/mod.rs
github-actions / clippy
an array of `Range` that is only one element
warning: an array of `Range` that is only one element
--> src/snippet/mod.rs:750:66
|
750 | assert_eq!(&collapse_overlapped_ranges(&[0..3, 1..2,]), &[0..3]);
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init
help: if you wanted a `Vec` that contains the entire range, try
|
750 | assert_eq!(&collapse_overlapped_ranges(&[0..3, 1..2,]), &(0..3).collect::<std::vec::Vec<usize>>());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: if you wanted an array of len 3, try
|
750 | assert_eq!(&collapse_overlapped_ranges(&[0..3, 1..2,]), &[0; 3]);
| ~~~~
Check warning on line 749 in src/snippet/mod.rs
github-actions / clippy
an array of `Range` that is only one element
warning: an array of `Range` that is only one element
--> src/snippet/mod.rs:749:66
|
749 | assert_eq!(&collapse_overlapped_ranges(&[0..2, 1..3,]), &[0..3]);
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init
help: if you wanted a `Vec` that contains the entire range, try
|
749 | assert_eq!(&collapse_overlapped_ranges(&[0..2, 1..3,]), &(0..3).collect::<std::vec::Vec<usize>>());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: if you wanted an array of len 3, try
|
749 | assert_eq!(&collapse_overlapped_ranges(&[0..2, 1..3,]), &[0; 3]);
| ~~~~
Check warning on line 748 in src/snippet/mod.rs
github-actions / clippy
an array of `Range` that is only one element
warning: an array of `Range` that is only one element
--> src/snippet/mod.rs:748:66
|
748 | assert_eq!(&collapse_overlapped_ranges(&[0..2, 1..2,]), &[0..2]);
| ^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_range_in_vec_init
= note: `#[warn(clippy::single_range_in_vec_init)]` on by default
help: if you wanted a `Vec` that contains the entire range, try
|
748 | assert_eq!(&collapse_overlapped_ranges(&[0..2, 1..2,]), &(0..2).collect::<std::vec::Vec<usize>>());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: if you wanted an array of len 2, try
|
748 | assert_eq!(&collapse_overlapped_ranges(&[0..2, 1..2,]), &[0; 2]);
| ~~~~
Check warning on line 465 in src/core/tests.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/core/tests.rs:465:13
|
465 | &json_term_writer.term(),
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json_term_writer.term()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Check warning on line 427 in src/core/tests.rs
github-actions / clippy
this expression creates a reference which is immediately dereferenced by the compiler
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/core/tests.rs:427:13
|
427 | &json_term_writer.term(),
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json_term_writer.term()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
Check warning on line 223 in src/postings/recorder.rs
github-actions / clippy
unused variable: `term_freq`
warning: unused variable: `term_freq`
--> src/postings/recorder.rs:223:21
|
223 | let term_freq = u32_it.next().unwrap_or(self.current_tf);
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_term_freq`
Check warning on line 215 in src/postings/recorder.rs
github-actions / clippy
unused variable: `tf`
warning: unused variable: `tf`
--> src/postings/recorder.rs:215:26
|
215 | for (doc_id, tf) in doc_id_and_tf {
| ^^ help: if this is intentional, prefix it with an underscore: `_tf`
|
= note: `#[warn(unused_variables)]` on by default