Read k from sbwt. #11
clippy
26 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 26 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.83.0-nightly (28e8f01c2 2024-09-17)
- cargo 1.83.0-nightly (a9a418d1a 2024-09-15)
- clippy 0.1.82 (28e8f01 2024-09-17)
Annotations
Check warning on line 175 in src/map.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/map.rs:175:10
|
175 | aln: &Vec<char>,
| ^^^^^^^^^^ help: change this to: `&[char]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 197 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:197:5
|
197 | return encodings;
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
197 - return encodings;
197 + encodings
|
Check warning on line 168 in src/map.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/map.rs:168:13
|
168 | run_to_aln(&runs, ms[i], params.threshold, params.k, &mut aln, &mut i);
| ^^^^^ help: change this to: `runs`
|
= 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 167 in src/map.rs
github-actions / clippy
the loop variable `i` is used to index `ms`
warning: the loop variable `i` is used to index `ms`
--> src/map.rs:167:18
|
167 | for mut i in 3..(len - 1) {
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
= note: `#[warn(clippy::needless_range_loop)]` on by default
help: consider using an iterator and enumerate()
|
167 | for (i, <item>) in ms.iter().enumerate().take((len - 1)).skip(3) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Check warning on line 158 in src/map.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/map.rs:158:9
|
158 | ms: &Vec<usize>,
| ^^^^^^^^^^^ help: change this to: `&[usize]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 171 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:171:5
|
171 | return aln;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
171 - return aln;
171 + aln
|
Check warning on line 139 in src/map.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/map.rs:139:9
|
139 | ms: &Vec<usize>,
| ^^^^^^^^^^^ help: change this to: `&[usize]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 153 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:153:5
|
153 | return runs;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
153 - return runs;
153 + runs
|
Check warning on line 122 in src/map.rs
github-actions / clippy
using `clone` on type `usize` which implements the `Copy` trait
warning: using `clone` on type `usize` which implements the `Copy` trait
--> src/map.rs:122:28
|
122 | let mut next_gap: usize = pos.clone();
| ^^^^^^^^^^^ help: try dereferencing it: `*pos`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
= note: `#[warn(clippy::clone_on_copy)]` on by default
Check warning on line 116 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:114:39
|
114 | } else if curr > threshold as i64 {
| _______________________________________^
115 | | res[*pos] = 'M';
116 | | } else if curr == next - 1 && curr > 0 {
| |_____^
|
note: same as this
--> src/map.rs:116:44
|
116 | } else if curr == next - 1 && curr > 0 {
| ____________________________________________^
117 | | res[*pos] = 'M';
118 | | } else if curr == 0 && next == 1 && prev > 0 {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
Check warning on line 114 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:112:51
|
112 | } else if next == 1 && curr == curr_ms as i64 {
| ___________________________________________________^
113 | | res[*pos] = 'M';
114 | | } else if curr > threshold as i64 {
| |_____^
|
note: same as this
--> src/map.rs:114:39
|
114 | } else if curr > threshold as i64 {
| _______________________________________^
115 | | res[*pos] = 'M';
116 | | } else if curr == next - 1 && curr > 0 {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
Check warning on line 100 in src/map.rs
github-actions / clippy
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> src/map.rs:100:10
|
100 | res: &mut Vec<char>,
| ^^^^^^^^^^^^^^ help: change this to: `&mut [char]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Check warning on line 96 in src/map.rs
github-actions / clippy
writing `&Vec` instead of `&[_]` involves a new object where a slice will do
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/map.rs:96:11
|
96 | runs: &Vec<i64>,
| ^^^^^^^^^ help: change this to: `&[i64]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
Check warning on line 86 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:84:49
|
84 | } else if curr > threshold && next_run == 1 {
| _________________________________________________^
85 | | curr as i64
86 | | } else if curr > threshold && next_run < curr as i64 {
| |_____^
|
note: same as this
--> src/map.rs:86:58
|
86 | } else if curr > threshold && next_run < curr as i64 {
| __________________________________________________________^
87 | | curr as i64
88 | | } else {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
Check warning on line 84 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:82:49
|
82 | } else if curr > threshold && next_run <= 0 {
| _________________________________________________^
83 | | curr as i64
84 | | } else if curr > threshold && next_run == 1 {
| |_____^
|
note: same as this
--> src/map.rs:84:49
|
84 | } else if curr > threshold && next_run == 1 {
| _________________________________________________^
85 | | curr as i64
86 | | } else if curr > threshold && next_run < curr as i64 {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
Check warning on line 78 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:76:42
|
76 | } else if curr == k && next_run == 1 {
| __________________________________________^
77 | | k as i64
78 | | } else if curr == k && next_run < 0 {
| |_____^
|
note: same as this
--> src/map.rs:78:41
|
78 | } else if curr == k && next_run < 0 {
| _________________________________________^
79 | | k as i64
80 | | } else if curr < threshold {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
Check warning on line 76 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:74:46
|
74 | let run: i64 = if curr == k && next == k {
| ______________________________________________^
75 | | k as i64
76 | | } else if curr == k && next_run == 1 {
| |_____^
|
note: same as this
--> src/map.rs:76:42
|
76 | } else if curr == k && next_run == 1 {
| __________________________________________^
77 | | k as i64
78 | | } else if curr == k && next_run < 0 {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
= note: `#[warn(clippy::if_same_then_else)]` on by default
Check warning on line 92 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:92:5
|
92 | return run;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
92 - return run;
92 + run
|
Check warning on line 62 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:62:6
|
62 | return ms;
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
62 ~ ms
63 | },
64 ~ }
|
Check warning on line 45 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:45:5
|
45 | return (sbwt, lcs);
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
45 - return (sbwt, lcs);
45 + (sbwt, lcs)
|
Check warning on line 85 in src/build.rs
github-actions / clippy
use of `unwrap_or` to construct default value
warning: use of `unwrap_or` to construct default value
--> src/build.rs:85:36
|
85 | let params = params_in.clone().unwrap_or(SBWTParams::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
Check warning on line 58 in src/build.rs
github-actions / clippy
use of `unwrap_or` to construct default value
warning: use of `unwrap_or` to construct default value
--> src/build.rs:58:36
|
58 | let params = params_in.clone().unwrap_or(SBWTParams::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
Check warning on line 77 in src/build.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/build.rs:77:5
|
77 | return (sbwt, lcs);
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
77 - return (sbwt, lcs);
77 + (sbwt, lcs)
|
Check warning on line 28 in src/main.rs
github-actions / clippy
struct `Logger` is never constructed
warning: struct `Logger` is never constructed
--> src/main.rs:28:8
|
28 | struct Logger;
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
Check warning on line 89 in src/main.rs
github-actions / clippy
unused variable: `input_list`
warning: unused variable: `input_list`
--> src/main.rs:89:6
|
89 | input_list,
| ^^^^^^^^^^ help: try ignoring the field: `input_list: _`