Calculate the random match threshold dynamically. #42
mirror_to_codeberg.yml
on: push
Push commits to codeberg
7s
Annotations
30 warnings
Push commits to codeberg
The following actions use a deprecated Node.js version and will be forced to run on node20: actions/checkout@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
casting float literal to `f64` is unnecessary:
src/main.rs#L106
warning: casting float literal to `f64` is unnecessary
--> src/main.rs:106:70
|
106 | map::random_match_threshold(sbwt.k(), sbwt.n_kmers(), 4 as usize, 0.01 as f64)
| ^^^^^^^^^^^ help: try: `0.01_f64`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
casting integer literal to `usize` is unnecessary:
src/main.rs#L106
warning: casting integer literal to `usize` is unnecessary
--> src/main.rs:106:58
|
106 | map::random_match_threshold(sbwt.k(), sbwt.n_kmers(), 4 as usize, 0.01 as f64)
| ^^^^^^^^^^ help: try: `4_usize`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
|
writing `&Vec` instead of `&[_]` involves a new object where a slice will do:
src/map.rs#L197
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/map.rs:197:10
|
197 | 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#L219
warning: unneeded `return` statement
--> src/map.rs:219:5
|
219 | return encodings;
| ^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
219 - return encodings;
219 + encodings
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
src/map.rs#L190
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> src/map.rs:190:13
|
190 | 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
|
the loop variable `i` is used to index `ms`:
src/map.rs#L189
warning: the loop variable `i` is used to index `ms`
--> src/map.rs:189:18
|
189 | 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()
|
189 | 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#L180
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/map.rs:180:9
|
180 | 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#L193
warning: unneeded `return` statement
--> src/map.rs:193:5
|
193 | return aln;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
193 - return aln;
193 + aln
|
|
unneeded `return` statement:
src/map.rs#L175
warning: unneeded `return` statement
--> src/map.rs:175:5
|
175 | return runs;
| ^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
175 - return runs;
175 + runs
|
|
using `clone` on type `usize` which implements the `Copy` trait:
src/map.rs#L144
warning: using `clone` on type `usize` which implements the `Copy` trait
--> src/map.rs:144:28
|
144 | 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#L136
warning: this `if` has identical blocks
--> src/map.rs:136:39
|
136 | } else if curr > threshold as i64 {
| _______________________________________^
137 | | res[*pos] = 'M';
138 | | } else if curr == next - 1 && curr > 0 {
| |_____^
|
note: same as this
--> src/map.rs:138:44
|
138 | } else if curr == next - 1 && curr > 0 {
| ____________________________________________^
139 | | res[*pos] = 'M';
140 | | } 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#L134
warning: this `if` has identical blocks
--> src/map.rs:134:51
|
134 | } else if next == 1 && curr == curr_ms as i64 {
| ___________________________________________________^
135 | | res[*pos] = 'M';
136 | | } else if curr > threshold as i64 {
| |_____^
|
note: same as this
--> src/map.rs:136:39
|
136 | } else if curr > threshold as i64 {
| _______________________________________^
137 | | res[*pos] = 'M';
138 | | } 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#L122
warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do
--> src/map.rs:122:10
|
122 | 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#L118
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/map.rs:118:11
|
118 | 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#L106
warning: this `if` has identical blocks
--> src/map.rs:106:49
|
106 | } else if curr > threshold && next_run == 1 {
| _________________________________________________^
107 | | curr as i64
108 | | } else if curr > threshold && next_run < curr as i64 {
| |_____^
|
note: same as this
--> src/map.rs:108:58
|
108 | } else if curr > threshold && next_run < curr as i64 {
| __________________________________________________________^
109 | | curr as i64
110 | | } 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#L104
warning: this `if` has identical blocks
--> src/map.rs:104:49
|
104 | } else if curr > threshold && next_run <= 0 {
| _________________________________________________^
105 | | curr as i64
106 | | } else if curr > threshold && next_run == 1 {
| |_____^
|
note: same as this
--> src/map.rs:106:49
|
106 | } else if curr > threshold && next_run == 1 {
| _________________________________________________^
107 | | curr as i64
108 | | } 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#L98
warning: this `if` has identical blocks
--> src/map.rs:98:42
|
98 | } else if curr == k && next_run == 1 {
| __________________________________________^
99 | | k as i64
100 | | } else if curr == k && next_run < 0 {
| |_____^
|
note: same as this
--> src/map.rs:100:41
|
100 | } else if curr == k && next_run < 0 {
| _________________________________________^
101 | | k as i64
102 | | } 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#L96
warning: this `if` has identical blocks
--> src/map.rs:96:46
|
96 | let run: i64 = if curr == k && next == k {
| ______________________________________________^
97 | | k as i64
98 | | } else if curr == k && next_run == 1 {
| |_____^
|
note: same as this
--> src/map.rs:98:42
|
98 | } else if curr == k && next_run == 1 {
| __________________________________________^
99 | | k as i64
100 | | } 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#L114
warning: unneeded `return` statement
--> src/map.rs:114:5
|
114 | return run;
| ^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
114 - return run;
114 + run
|
|
unneeded `return` statement:
src/map.rs#L86
warning: unneeded `return` statement
--> src/map.rs:86:5
|
86 | return k;
| ^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
86 - return k;
86 + k
|
|
casting to the same type is unnecessary (`f64` -> `f64`):
src/map.rs#L72
warning: casting to the same type is unnecessary (`f64` -> `f64`)
--> src/map.rs:72:25
|
72 | n_kmers as f64 * (- ((1.0/(alphabet_size as f64)) as f64).powi(t as i32 + 1)).ln_1p()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(1.0/(alphabet_size as f64))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
|
unneeded `return` statement:
src/map.rs#L62
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 ~ }
|
|
unneeded `return` statement:
src/map.rs#L45
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)
|
|
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)
|
|
struct `Logger` is never constructed:
src/main.rs#L28
warning: struct `Logger` is never constructed
--> src/main.rs:28:8
|
28 | struct Logger;
| ^^^^^^
|
= note: `#[warn(dead_code)]` on by default
|
unused variable: `input_list`:
src/main.rs#L89
warning: unused variable: `input_list`
--> src/main.rs:89:6
|
89 | input_list,
| ^^^^^^^^^^ help: try ignoring the field: `input_list: _`
|
unused variable: `input_list`:
src/main.rs#L63
warning: unused variable: `input_list`
--> src/main.rs:63:6
|
63 | input_list,
| ^^^^^^^^^^ help: try ignoring the field: `input_list: _`
|
= note: `#[warn(unused_variables)]` on by default
|