Skip to content

Take index prefix directly in load_sbwt #7

Take index prefix directly in load_sbwt

Take index prefix directly in load_sbwt #7

Triggered via push September 18, 2024 18:14
Status Success
Total duration 43s
Artifacts
Lint Rust code with Clippy
31s
Lint Rust code with Clippy
Fit to window
Zoom out
Zoom in

Annotations

36 warnings
struct update has no effect, all the fields in the struct have already been specified: src/main.rs#L97
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
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/map.rs#L186
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/map.rs:186:10 | 186 | 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
unneeded `return` statement: src/map.rs#L208
warning: unneeded `return` statement --> src/map.rs:208:5 | 208 | return encodings; | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 208 - return encodings; 208 + encodings |
this expression creates a reference which is immediately dereferenced by the compiler: src/map.rs#L179
warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/map.rs:179:13 | 179 | 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
the loop variable `i` is used to index `ms`: src/map.rs#L178
warning: the loop variable `i` is used to index `ms` --> src/map.rs:178:18 | 178 | 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() | 178 | for (i, <item>) in ms.iter().enumerate().take((len - 1)).skip(3) { | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/map.rs#L167
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/map.rs:167:9 | 167 | 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
unneeded `return` statement: src/map.rs#L182
warning: unneeded `return` statement --> src/map.rs:182:5 | 182 | return aln; | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 182 - return aln; 182 + aln |
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/map.rs#L146
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/map.rs:146:9 | 146 | 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
unneeded `return` statement: src/map.rs#L162
warning: unneeded `return` statement --> src/map.rs:162:5 | 162 | return runs; | ^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 162 - return runs; 162 + runs |
using `clone` on type `usize` which implements the `Copy` trait: src/map.rs#L129
warning: using `clone` on type `usize` which implements the `Copy` trait --> src/map.rs:129:28 | 129 | 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
this `if` has identical blocks: src/map.rs#L121
warning: this `if` has identical blocks --> src/map.rs:121:39 | 121 | } else if curr > threshold as i64 { | _______________________________________^ 122 | | res[*pos] = 'M'; 123 | | } else if curr == next - 1 && curr > 0 { | |_____^ | note: same as this --> src/map.rs:123:44 | 123 | } else if curr == next - 1 && curr > 0 { | ____________________________________________^ 124 | | res[*pos] = 'M'; 125 | | } 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
this `if` has identical blocks: src/map.rs#L119
warning: this `if` has identical blocks --> src/map.rs:119:51 | 119 | } else if next == 1 && curr == curr_ms as i64 { | ___________________________________________________^ 120 | | res[*pos] = 'M'; 121 | | } else if curr > threshold as i64 { | |_____^ | note: same as this --> src/map.rs:121:39 | 121 | } else if curr > threshold as i64 { | _______________________________________^ 122 | | res[*pos] = 'M'; 123 | | } 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
writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do: src/map.rs#L107
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do --> src/map.rs:107:10 | 107 | 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
writing `&Vec` instead of `&[_]` involves a new object where a slice will do: src/map.rs#L103
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> src/map.rs:103:11 | 103 | 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
this `if` has identical blocks: src/map.rs#L91
warning: this `if` has identical blocks --> src/map.rs:91:49 | 91 | } else if curr > threshold && next_run == 1 { | _________________________________________________^ 92 | | curr as i64 93 | | } else if curr > threshold && next_run < curr as i64 { | |_____^ | note: same as this --> src/map.rs:93:58 | 93 | } else if curr > threshold && next_run < curr as i64 { | __________________________________________________________^ 94 | | curr as i64 95 | | } else { | |_____^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
this `if` has identical blocks: src/map.rs#L89
warning: this `if` has identical blocks --> src/map.rs:89:49 | 89 | } else if curr > threshold && next_run <= 0 { | _________________________________________________^ 90 | | curr as i64 91 | | } else if curr > threshold && next_run == 1 { | |_____^ | note: same as this --> src/map.rs:91:49 | 91 | } else if curr > threshold && next_run == 1 { | _________________________________________________^ 92 | | curr as i64 93 | | } 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
this `if` has identical blocks: src/map.rs#L83
warning: this `if` has identical blocks --> src/map.rs:83:42 | 83 | } else if curr == k && next_run == 1 { | __________________________________________^ 84 | | k as i64 85 | | } else if curr == k && next_run < 0 { | |_____^ | note: same as this --> src/map.rs:85:41 | 85 | } else if curr == k && next_run < 0 { | _________________________________________^ 86 | | k as i64 87 | | } else if curr < threshold { | |_____^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
this `if` has identical blocks: src/map.rs#L81
warning: this `if` has identical blocks --> src/map.rs:81:46 | 81 | let run: i64 = if curr == k && next == k { | ______________________________________________^ 82 | | k as i64 83 | | } else if curr == k && next_run == 1 { | |_____^ | note: same as this --> src/map.rs:83:42 | 83 | } else if curr == k && next_run == 1 { | __________________________________________^ 84 | | k as i64 85 | | } 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
unneeded `return` statement: src/map.rs#L99
warning: unneeded `return` statement --> src/map.rs:99:5 | 99 | return run; | ^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 99 - return run; 99 + run |
unneeded `return` statement: src/map.rs#L69
warning: unneeded `return` statement --> src/map.rs:69:6 | 69 | return ms; | ^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 69 ~ ms 70 | }, 71 ~ } |
unneeded `return` statement: src/map.rs#L52
warning: unneeded `return` statement --> src/map.rs:52:5 | 52 | return (sbwt, lcs); | ^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 52 - return (sbwt, lcs); 52 + (sbwt, lcs) |
this `impl` can be derived: src/map.rs#L22
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 { |
use of `unwrap_or` to construct default value: src/build.rs#L85
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
use of `unwrap_or` to construct default value: src/build.rs#L58
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
unneeded `return` statement: src/build.rs#L77
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) |
field `index_prefix` is never read: src/map.rs#L19
warning: field `index_prefix` is never read --> src/map.rs:19:9 | 18 | pub struct QueryParams { | ----------- field in this struct 19 | pub index_prefix: Option<String>, | ^^^^^^^^^^^^ | = note: `QueryParams` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
struct `Logger` is never constructed: src/main.rs#L27
warning: struct `Logger` is never constructed --> src/main.rs:27:8 | 27 | struct Logger; | ^^^^^^ | = note: `#[warn(dead_code)]` on by default
unused variable: `query_params`: src/main.rs#L95
warning: unused variable: `query_params` --> src/main.rs:95:10 | 95 | let query_params = map::QueryParams { | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_query_params`
unused variable: `input_list`: src/main.rs#L88
warning: unused variable: `input_list` --> src/main.rs:88:6 | 88 | input_list, | ^^^^^^^^^^ help: try ignoring the field: `input_list: _`
unused variable: `input_list`: src/main.rs#L62
warning: unused variable: `input_list` --> src/main.rs:62:6 | 62 | input_list, | ^^^^^^^^^^ help: try ignoring the field: `input_list: _` | = note: `#[warn(unused_variables)]` on by default
Lint Rust code with Clippy
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Lint Rust code with Clippy
The following actions use a deprecated Node.js version and will be forced to run on node20: actions-rs/toolchain@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
Lint Rust code with Clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Lint Rust code with Clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Lint Rust code with Clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Lint Rust code with Clippy
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/