Update mirror_to_codeberg.yml #5
clippy
29 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 29 |
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 97 in src/main.rs
github-actions / clippy
struct update has no effect, all the fields in the struct have already been specified
warning: struct update has no effect, all the fields in the struct have already been specified
--> src/main.rs:97:5
|
97 | ..Default::default()
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
= note: `#[warn(clippy::needless_update)]` on by default
Check warning on line 188 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:188:10
|
188 | 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 210 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:210:5
|
210 | return encodings;
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
210 - return encodings;
210 + encodings
|
Check warning on line 181 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:181:13
|
181 | run_to_aln(&runs, ms[i], threshold, 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 180 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:180:18
|
180 | 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()
|
180 | for (i, <item>) in ms.iter().enumerate().take((len - 1)).skip(3) {
| ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Check warning on line 169 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:169:9
|
169 | 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 184 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:184:5
|
184 | return aln;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
184 - return aln;
184 + aln
|
Check warning on line 148 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:148:9
|
148 | 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 164 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:164:5
|
164 | return runs;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
164 - return runs;
164 + runs
|
Check warning on line 131 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:131:28
|
131 | 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 125 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:123:39
|
123 | } else if curr > threshold as i64 {
| _______________________________________^
124 | | res[*pos] = 'M';
125 | | } else if curr == next - 1 && curr > 0 {
| |_____^
|
note: same as this
--> src/map.rs:125:44
|
125 | } else if curr == next - 1 && curr > 0 {
| ____________________________________________^
126 | | res[*pos] = 'M';
127 | | } 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 123 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:121:51
|
121 | } else if next == 1 && curr == curr_ms as i64 {
| ___________________________________________________^
122 | | res[*pos] = 'M';
123 | | } else if curr > threshold as i64 {
| |_____^
|
note: same as this
--> src/map.rs:123:39
|
123 | } else if curr > threshold as i64 {
| _______________________________________^
124 | | res[*pos] = 'M';
125 | | } 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 109 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:109:10
|
109 | 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 105 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:105:11
|
105 | 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 95 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:93:49
|
93 | } else if curr > threshold && next_run == 1 {
| _________________________________________________^
94 | | curr as i64
95 | | } else if curr > threshold && next_run < curr as i64 {
| |_____^
|
note: same as this
--> src/map.rs:95:58
|
95 | } else if curr > threshold && next_run < curr as i64 {
| __________________________________________________________^
96 | | curr as i64
97 | | } else {
| |_____^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
Check warning on line 93 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:91:49
|
91 | } else if curr > threshold && next_run <= 0 {
| _________________________________________________^
92 | | curr as i64
93 | | } else if curr > threshold && next_run == 1 {
| |_____^
|
note: same as this
--> src/map.rs:93:49
|
93 | } else if curr > threshold && next_run == 1 {
| _________________________________________________^
94 | | curr as i64
95 | | } 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 87 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:85:42
|
85 | } else if curr == k && next_run == 1 {
| __________________________________________^
86 | | k as i64
87 | | } else if curr == k && next_run < 0 {
| |_____^
|
note: same as this
--> src/map.rs:87:41
|
87 | } else if curr == k && next_run < 0 {
| _________________________________________^
88 | | k as i64
89 | | } 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 85 in src/map.rs
github-actions / clippy
this `if` has identical blocks
warning: this `if` has identical blocks
--> src/map.rs:83:46
|
83 | let run: i64 = if curr == k && next == k {
| ______________________________________________^
84 | | k as i64
85 | | } else if curr == k && next_run == 1 {
| |_____^
|
note: same as this
--> src/map.rs:85:42
|
85 | } else if curr == k && next_run == 1 {
| __________________________________________^
86 | | k as i64
87 | | } 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 101 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:101:5
|
101 | return run;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
101 - return run;
101 + run
|
Check warning on line 71 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:71:6
|
71 | return ms;
| ^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
71 ~ ms
72 | },
73 ~ }
|
Check warning on line 33 in src/map.rs
github-actions / clippy
use of `unwrap_or` to construct default value
warning: use of `unwrap_or` to construct default value
--> src/map.rs:33:36
|
33 | let params = params_in.clone().unwrap_or(QueryParams::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 54 in src/map.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> src/map.rs:54:5
|
54 | return (sbwt, lcs);
| ^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
54 - return (sbwt, lcs);
54 + (sbwt, lcs)
|
Check warning on line 28 in src/map.rs
github-actions / clippy
this `impl` can be derived
warning: this `impl` can be derived
--> src/map.rs:22:1
|
22 | / impl Default for QueryParams {
23 | | fn default() -> QueryParams {
24 | | QueryParams {
25 | | index_prefix: None,
26 | | }
27 | | }
28 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
18 + #[derive(Default)]
19 | pub struct QueryParams {
|
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