clippy
45 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 45 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.77.2 (25ef9e3d8 2024-04-09)
- cargo 1.77.2 (e52e36006 2024-03-26)
- clippy 0.1.77 (25ef9e3 2024-04-09)
Annotations
Check warning on line 94 in src/bcf/report/mod.rs
github-actions / clippy
useless use of `vec!`
warning: useless use of `vec!`
--> src/bcf/report/mod.rs:94:28
|
94 | let csv_report_files = vec![("csv_report.css", include_str!("../../csv/csv_report.css"))];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[("csv_report.css", include_str!("../../csv/csv_report.css"))]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
Check warning on line 93 in src/bcf/report/mod.rs
github-actions / clippy
useless use of `vec!`
warning: useless use of `vec!`
--> src/bcf/report/mod.rs:93:28
|
93 | let vcf_report_files = vec![("oncoprint.css", include_str!("css/oncoprint.css"))];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[("oncoprint.css", include_str!("css/oncoprint.css"))]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
Check warning on line 43 in src/bcf/report/mod.rs
github-actions / clippy
useless use of `vec!`
warning: useless use of `vec!`
--> src/bcf/report/mod.rs:38:28
|
38 | let vcf_report_files = vec![
| ____________________________^
39 | | ("jsonm.min.js", include_str!("js/jsonm.min.js")),
40 | | ("table-report.js", include_str!("js/table-report.js")),
41 | | ("report.js", include_str!("js/report.js")),
42 | | ("gene-report.js", include_str!("js/gene-report.js")),
43 | | ];
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
= note: `#[warn(clippy::useless_vec)]` on by default
help: you can use an array directly
|
38 ~ let vcf_report_files = [("jsonm.min.js", include_str!("js/jsonm.min.js")),
39 + ("table-report.js", include_str!("js/table-report.js")),
40 + ("report.js", include_str!("js/report.js")),
41 ~ ("gene-report.js", include_str!("js/gene-report.js"))];
|
Check warning on line 44 in src/fastq/filter.rs
github-actions / clippy
`filter_map()` will run forever if the iterator repeatedly produces an `Err`
warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err`
--> src/fastq/filter.rs:44:48
|
44 | HashSet::<String>::from_iter(f.lines().filter_map(Result::ok).collect::<Vec<String>>());
| ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)`
|
note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error
--> src/fastq/filter.rs:44:38
|
44 | HashSet::<String>::from_iter(f.lines().filter_map(Result::ok).collect::<Vec<String>>());
| ^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok
= note: `#[warn(clippy::lines_filter_map_ok)]` on by default
Check warning on line 177 in src/fastq/collapse_reads_to_fragments/mod.rs
github-actions / clippy
this looks like a failed attempt at checking for the file extension
warning: this looks like a failed attempt at checking for the file extension
--> src/fastq/collapse_reads_to_fragments/mod.rs:177:152
|
177 | ...with(".gz"), fq3_path.as_ref().ends_with(".gz")) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fq3_path.as_ref().extension().is_some_and(|ext| ext == "gz")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
Check warning on line 177 in src/fastq/collapse_reads_to_fragments/mod.rs
github-actions / clippy
this looks like a failed attempt at checking for the file extension
warning: this looks like a failed attempt at checking for the file extension
--> src/fastq/collapse_reads_to_fragments/mod.rs:177:117
|
177 | ..._with(".gz"), fq2_out.as_ref().ends_with(".gz"), fq3_path.as_ref().ends_with(".gz")) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fq2_out.as_ref().extension().is_some_and(|ext| ext == "gz")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
Check warning on line 177 in src/fastq/collapse_reads_to_fragments/mod.rs
github-actions / clippy
this looks like a failed attempt at checking for the file extension
warning: this looks like a failed attempt at checking for the file extension
--> src/fastq/collapse_reads_to_fragments/mod.rs:177:82
|
177 | ..._with(".gz"), fq1_out.as_ref().ends_with(".gz"), fq2_out.as_ref().ends_with(".gz"), fq3_path.as_ref().ends_with(".gz")) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fq1_out.as_ref().extension().is_some_and(|ext| ext == "gz")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
Check warning on line 177 in src/fastq/collapse_reads_to_fragments/mod.rs
github-actions / clippy
this looks like a failed attempt at checking for the file extension
warning: this looks like a failed attempt at checking for the file extension
--> src/fastq/collapse_reads_to_fragments/mod.rs:177:51
|
177 | ...ends_with(".gz"), fq2.as_ref().ends_with(".gz"), fq1_out.as_ref().ends_with(".gz"), fq2_out.as_ref().ends_with(".gz"), fq3_path.as_ref...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fq2.as_ref().extension().is_some_and(|ext| ext == "gz")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
Check warning on line 177 in src/fastq/collapse_reads_to_fragments/mod.rs
github-actions / clippy
this looks like a failed attempt at checking for the file extension
warning: this looks like a failed attempt at checking for the file extension
--> src/fastq/collapse_reads_to_fragments/mod.rs:177:20
|
177 | ... match (fq1.as_ref().ends_with(".gz"), fq2.as_ref().ends_with(".gz"), fq1_out.as_ref().ends_with(".gz"), fq2_out.as_ref().ends_with(...
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fq1.as_ref().extension().is_some_and(|ext| ext == "gz")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
Check warning on line 140 in src/fastq/collapse_reads_to_fragments/mod.rs
github-actions / clippy
this looks like a failed attempt at checking for the file extension
warning: this looks like a failed attempt at checking for the file extension
--> src/fastq/collapse_reads_to_fragments/mod.rs:140:44
|
140 | let w: Box<dyn Write> = if path.as_ref().ends_with(".gz") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path.as_ref().extension().is_some_and(|ext| ext == "gz")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
Check warning on line 127 in src/fastq/collapse_reads_to_fragments/mod.rs
github-actions / clippy
this looks like a failed attempt at checking for the file extension
warning: this looks like a failed attempt at checking for the file extension
--> src/fastq/collapse_reads_to_fragments/mod.rs:127:43
|
127 | let r: Box<dyn Read> = if path.as_ref().ends_with(".gz") {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path.as_ref().extension().is_some_and(|ext| ext == "gz")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
= note: `#[warn(clippy::path_ends_with_ext)]` on by default
Check warning on line 96 in src/fastq/collapse_reads_to_fragments/pipeline.rs
github-actions / clippy
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/fastq/collapse_reads_to_fragments/pipeline.rs:96:41
|
96 | str::from_utf8(&self.db.get(&Self::as_key(i as u64))?.unwrap()).unwrap(),
| ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Self::as_key(i as u64)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
Check warning on line 88 in src/fastq/collapse_reads_to_fragments/pipeline.rs
github-actions / clippy
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/fastq/collapse_reads_to_fragments/pipeline.rs:88:13
|
88 | &Self::as_key(i as u64),
| ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Self::as_key(i as u64)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
Check warning on line 82 in src/fastq/collapse_reads_to_fragments/pipeline.rs
github-actions / clippy
transmute from a `u64` to a `[u8; 8]`
warning: transmute from a `u64` to a `[u8; 8]`
--> src/fastq/collapse_reads_to_fragments/pipeline.rs:82:18
|
82 | unsafe { mem::transmute::<u64, [u8; 8]>(i) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `to_ne_bytes()`: `i.to_ne_bytes()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#transmute_num_to_bytes
= note: `#[warn(clippy::transmute_num_to_bytes)]` on by default
Check warning on line 488 in src/csv/report.rs
github-actions / clippy
iterating on a map's values
warning: iterating on a map's values
--> src/csv/report.rs:488:41
|
488 | let unique_values: HashSet<_> = count_values.iter().map(|(_, v)| v).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `count_values.values()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
= note: `#[warn(clippy::iter_kv_map)]` on by default
Check warning on line 139 in src/bcf/report/table_report/static_reader.rs
github-actions / clippy
this expression can be written more simply using `.retain()`
warning: this expression can be written more simply using `.retain()`
--> src/bcf/report/table_report/static_reader.rs:136:9
|
136 | / matches_wr = matches_wr
137 | | .into_iter()
138 | | .filter(|b| random_rows.contains(&(b.row as u32)))
139 | | .collect();
| |______________________^ help: consider calling `.retain()` instead: `matches_wr.retain(|b| random_rows.contains(&(b.row as u32)))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
Check warning on line 135 in src/bcf/report/table_report/static_reader.rs
github-actions / clippy
this expression can be written more simply using `.retain()`
warning: this expression can be written more simply using `.retain()`
--> src/bcf/report/table_report/static_reader.rs:132:9
|
132 | / reads_wr = reads_wr
133 | | .into_iter()
134 | | .filter(|b| random_rows.contains(&(b.row as u32)))
135 | | .collect();
| |______________________^ help: consider calling `.retain()` instead: `reads_wr.retain(|b| random_rows.contains(&(b.row as u32)))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
= note: `#[warn(clippy::manual_retain)]` on by default
Check warning on line 515 in src/bcf/report/table_report/create_report_table.rs
github-actions / clippy
use of `or_insert_with` to construct default value
warning: use of `or_insert_with` to construct default value
--> src/bcf/report/table_report/create_report_table.rs:515:64
|
515 | let entry = info_map.entry(tag.to_owned()).or_insert_with(Vec::new);
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
Check warning on line 507 in src/bcf/report/table_report/create_report_table.rs
github-actions / clippy
use of `or_insert_with` to construct default value
warning: use of `or_insert_with` to construct default value
--> src/bcf/report/table_report/create_report_table.rs:507:64
|
507 | let entry = info_map.entry(tag.to_owned()).or_insert_with(Vec::new);
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
Check warning on line 499 in src/bcf/report/table_report/create_report_table.rs
github-actions / clippy
use of `or_insert_with` to construct default value
warning: use of `or_insert_with` to construct default value
--> src/bcf/report/table_report/create_report_table.rs:499:64
|
499 | let entry = info_map.entry(tag.to_owned()).or_insert_with(Vec::new);
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
Check warning on line 472 in src/bcf/report/table_report/create_report_table.rs
github-actions / clippy
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/bcf/report/table_report/create_report_table.rs:472:25
|
472 | &"\"Consequence annotations from Ensembl VEP. Format: ",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `"\"Consequence annotations from Ensembl VEP. Format: "`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
Check warning on line 456 in src/bcf/report/table_report/create_report_table.rs
github-actions / clippy
used consecutive `str::replace` call
warning: used consecutive `str::replace` call
--> src/bcf/report/table_report/create_report_table.rs:456:11
|
456 | hgvsg.replace('.', "_").replace('>', "_").replace(':', "_")
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['.', '>', ':'], "_")`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace
= note: `#[warn(clippy::collapsible_str_replace)]` on by default
Check warning on line 64 in src/bcf/report/table_report/create_report_table.rs
github-actions / clippy
the borrowed expression implements the required traits
warning: the borrowed expression implements the required traits
--> src/bcf/report/table_report/create_report_table.rs:64:55
|
64 | let mut vcf = rust_htslib::bcf::Reader::from_path(&vcf_path).unwrap();
| ^^^^^^^^^ help: change this to: `vcf_path`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
Check warning on line 431 in src/bcf/report/table_report/alignment_reader.rs
github-actions / clippy
casting to the same type is unnecessary (`i64` -> `i64`)
warning: casting to the same type is unnecessary (`i64` -> `i64`)
--> src/bcf/report/table_report/alignment_reader.rs:431:20
|
431 | let position = snip.pos as i64 + read_offset;
| ^^^^^^^^^^^^^^^ help: try: `snip.pos`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 367 in src/bcf/report/table_report/alignment_reader.rs
github-actions / clippy
casting to the same type is unnecessary (`i64` -> `i64`)
warning: casting to the same type is unnecessary (`i64` -> `i64`)
--> src/bcf/report/table_report/alignment_reader.rs:367:51
|
367 | ... match_start = snip.pos as i64 + read_offset;
| ^^^^^^^^^^^^^^^ help: try: `snip.pos`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast