[INFO] cloning repository https://github.com/IMTMarburg/mbf_bam [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/IMTMarburg/mbf_bam" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIMTMarburg%2Fmbf_bam", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIMTMarburg%2Fmbf_bam'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 906a4ccff4ac21ca2ed097e42c89b1df983bae0e [INFO] linting IMTMarburg/mbf_bam against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIMTMarburg%2Fmbf_bam" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/IMTMarburg/mbf_bam [INFO] finished tweaking git repo https://github.com/IMTMarburg/mbf_bam [INFO] tweaked toml for git repo https://github.com/IMTMarburg/mbf_bam written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/IMTMarburg/mbf_bam on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/IMTMarburg/mbf_bam already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded linear-map v1.2.0 [INFO] [stderr] Downloaded fs-utils v1.1.4 [INFO] [stderr] Downloaded newtype_derive v0.1.6 [INFO] [stderr] Downloaded editdistancek v1.0.2 [INFO] [stderr] Downloaded ex v0.1.3 [INFO] [stderr] Downloaded pyo3-macros v0.20.3 [INFO] [stderr] Downloaded itertools-num v0.1.3 [INFO] [stderr] Downloaded derive-new v0.5.9 [INFO] [stderr] Downloaded cmake v0.1.51 [INFO] [stderr] Downloaded ordered-float v4.4.0 [INFO] [stderr] Downloaded bio-types v1.0.4 [INFO] [stderr] Downloaded pyo3-build-config v0.20.3 [INFO] [stderr] Downloaded portable-atomic-util v0.2.2 [INFO] [stderr] Downloaded pyo3-ffi v0.20.3 [INFO] [stderr] Downloaded triple_accel v0.4.0 [INFO] [stderr] Downloaded rust-htslib v0.46.0 [INFO] [stderr] Downloaded statrs v0.17.1 [INFO] [stderr] Downloaded pyo3-macros-backend v0.20.3 [INFO] [stderr] Downloaded cc v1.1.30 [INFO] [stderr] Downloaded bio v2.0.3 [INFO] [stderr] Downloaded pyo3 v0.20.3 [INFO] [stderr] Downloaded libc v0.2.160 [INFO] [stderr] Downloaded curl-sys v0.4.77+curl-8.10.1 [INFO] [stderr] Downloaded hts-sys v2.1.4 [INFO] [stderr] Downloaded openssl-src v300.3.2+3.3.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 10c6a0c1b1bb409aaabc103119d6bacc05bd3aa42ec9cbbe5f25e1bbe4dd5322 [INFO] running `Command { std: "docker" "start" "-a" "10c6a0c1b1bb409aaabc103119d6bacc05bd3aa42ec9cbbe5f25e1bbe4dd5322", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "10c6a0c1b1bb409aaabc103119d6bacc05bd3aa42ec9cbbe5f25e1bbe4dd5322", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "10c6a0c1b1bb409aaabc103119d6bacc05bd3aa42ec9cbbe5f25e1bbe4dd5322", kill_on_drop: false }` [INFO] [stdout] 10c6a0c1b1bb409aaabc103119d6bacc05bd3aa42ec9cbbe5f25e1bbe4dd5322 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 20cb2c77a39ba27b258ff10341fa12665b170a299dffdbdcb94279a1d4b77645 [INFO] running `Command { std: "docker" "start" "-a" "20cb2c77a39ba27b258ff10341fa12665b170a299dffdbdcb94279a1d4b77645", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.160 [INFO] [stderr] Compiling target-lexicon v0.12.16 [INFO] [stderr] Checking bytemuck v1.19.0 [INFO] [stderr] Compiling matrixmultiply v0.3.9 [INFO] [stderr] Compiling semver v0.1.20 [INFO] [stderr] Compiling rustversion v1.0.18 [INFO] [stderr] Compiling quick-error v1.2.3 [INFO] [stderr] Checking num-traits v0.2.19 [INFO] [stderr] Checking regex-automata v0.4.8 [INFO] [stderr] Compiling syn v2.0.79 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling portable-atomic v1.9.0 [INFO] [stderr] Checking object v0.36.5 [INFO] [stderr] Checking csv-core v0.1.11 [INFO] [stderr] Checking custom_derive v0.1.7 [INFO] [stderr] Checking bit-set v0.8.0 [INFO] [stderr] Compiling fs-utils v1.1.4 [INFO] [stderr] Checking linear-map v1.2.0 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Checking bytecount v0.6.8 [INFO] [stderr] Checking unindent v0.2.3 [INFO] [stderr] Checking safe_arch v0.7.2 [INFO] [stderr] Checking editdistancek v1.0.2 [INFO] [stderr] Checking ieee754 v0.2.6 [INFO] [stderr] Compiling rustc_version v0.1.7 [INFO] [stderr] Checking triple_accel v0.4.0 [INFO] [stderr] Checking ex v0.1.3 [INFO] [stderr] Checking flate2 v1.0.34 [INFO] [stderr] Compiling newtype_derive v0.1.6 [INFO] [stderr] Checking wide v0.7.28 [INFO] [stderr] Checking num-complex v0.4.6 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Checking approx v0.5.1 [INFO] [stderr] Checking ordered-float v4.4.0 [INFO] [stderr] Checking itertools-num v0.1.3 [INFO] [stderr] Compiling pyo3-build-config v0.20.3 [INFO] [stderr] Checking num-rational v0.4.2 [INFO] [stderr] Checking ndarray v0.16.1 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking regex v1.11.0 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling jobserver v0.1.32 [INFO] [stderr] Compiling cc v1.1.30 [INFO] [stderr] Compiling pyo3-ffi v0.20.3 [INFO] [stderr] Compiling pyo3 v0.20.3 [INFO] [stderr] Compiling synstructure v0.12.6 [INFO] [stderr] Checking simba v0.8.1 [INFO] [stderr] Compiling derive-new v0.5.9 [INFO] [stderr] Compiling failure_derive v0.1.8 [INFO] [stderr] Compiling cmake v0.1.51 [INFO] [stderr] Compiling openssl-src v300.3.2+3.3.2 [INFO] [stderr] Compiling bzip2-sys v0.1.11+1.0.8 [INFO] [stderr] Compiling curl-sys v0.4.77+curl-8.10.1 [INFO] [stderr] Compiling lzma-sys v0.1.20 [INFO] [stderr] Compiling hts-sys v2.1.4 [INFO] [stderr] Compiling openssl-sys v0.9.104 [INFO] [stderr] Compiling libz-sys v1.1.20 [INFO] [stderr] Checking backtrace v0.3.74 [INFO] [stderr] Checking failure v0.1.8 [INFO] [stderr] Compiling pyo3-macros-backend v0.20.3 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Compiling serde_derive v1.0.210 [INFO] [stderr] Compiling thiserror-impl v1.0.64 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Compiling nalgebra-macros v0.2.2 [INFO] [stderr] Compiling derive-new v0.6.0 [INFO] [stderr] Compiling enum-map-derive v0.17.0 [INFO] [stderr] Checking enum-map v2.7.3 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Checking thiserror v1.0.64 [INFO] [stderr] Checking ppv-lite86 v0.2.20 [INFO] [stderr] Checking bio-types v1.0.4 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Compiling pyo3-macros v0.20.3 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking serde v1.0.210 [INFO] [stderr] Checking rand_distr v0.4.3 [INFO] [stderr] Checking nalgebra v0.32.6 [INFO] [stderr] Checking multimap v0.10.0 [INFO] [stderr] Checking bv v0.11.1 [INFO] [stderr] Checking csv v1.3.0 [INFO] [stderr] Checking vec_map v0.8.2 [INFO] [stderr] Checking statrs v0.17.1 [INFO] [stderr] Checking bio v2.0.3 [INFO] [stderr] Checking rust-htslib v0.46.0 [INFO] [stderr] Checking mbf_bam v0.6.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/count_reads/by_barcode.rs:95:25 [INFO] [stdout] | [INFO] [stdout] 95 | flat.sort_by(|a, b| (a.1.cmp(&b.1))); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 95 - flat.sort_by(|a, b| (a.1.cmp(&b.1))); [INFO] [stdout] 95 + flat.sort_by(|a, b| a.1.cmp(&b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/count_reads/quantify.rs:96:1 [INFO] [stdout] | [INFO] [stdout] 96 | / /// second one is 'incongruent with gene direction' [INFO] [stdout] 97 | | [INFO] [stdout] | |_^ [INFO] [stdout] 98 | fn quantify_gene_reads( [INFO] [stdout] | ---------------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/count_reads/by_barcode.rs:95:25 [INFO] [stdout] | [INFO] [stdout] 95 | flat.sort_by(|a, b| (a.1.cmp(&b.1))); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 95 - flat.sort_by(|a, b| (a.1.cmp(&b.1))); [INFO] [stdout] 95 + flat.sort_by(|a, b| a.1.cmp(&b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/count_reads/quantify.rs:96:1 [INFO] [stdout] | [INFO] [stdout] 96 | / /// second one is 'incongruent with gene direction' [INFO] [stdout] 97 | | [INFO] [stdout] | |_^ [INFO] [stdout] 98 | fn quantify_gene_reads( [INFO] [stdout] | ---------------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `BamError` [INFO] [stdout] --> src/bam_ext.rs:17:23 [INFO] [stdout] | [INFO] [stdout] 17 | Err(e) => Err(BamError::UnknownError { [INFO] [stdout] | _______________________^ [INFO] [stdout] 18 | | msg: format!("Could not read bam: {}", e), [INFO] [stdout] 19 | | } [INFO] [stdout] 20 | | .into()), [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into()` [INFO] [stdout] | [INFO] [stdout] 17 ~ Err(e) => Err(BamError::UnknownError { [INFO] [stdout] 18 + msg: format!("Could not read bam: {}", e), [INFO] [stdout] 19 ~ }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bam_manipulation.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | return Ok(Box::new(GzDecoder::new(file))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 52 - return Ok(Box::new(GzDecoder::new(file))); [INFO] [stdout] 52 + Ok(Box::new(GzDecoder::new(file))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bam_manipulation.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | return Ok(Box::new(file)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 54 - return Ok(Box::new(file)); [INFO] [stdout] 54 + Ok(Box::new(file)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bam_manipulation.rs:67:28 [INFO] [stdout] | [INFO] [stdout] 67 | let mut qname_to_tags: HashMap, Vec<(Vec, Vec)>> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `tid` is used as a loop counter [INFO] [stdout] --> src/bam_manipulation.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | for record in records.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (tid, record) in records.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/bam_manipulation.rs:147:30 [INFO] [stdout] | [INFO] [stdout] 147 | let length = record.get("LN") [INFO] [stdout] | ______________________________^ [INFO] [stdout] 148 | | .ok_or_else(||BamError::UnknownError{msg:"LN in @SQ missing".to_string()})? [INFO] [stdout] 149 | | .parse::().or_else(|_|Err(BamError::UnknownError{msg:"LN not an integere".to_string()}))?; [INFO] [stdout] | |_________________________________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 147 ~ let length = record.get("LN") [INFO] [stdout] 148 + .ok_or_else(||BamError::UnknownError{msg:"LN in @SQ missing".to_string()})? [INFO] [stdout] 149 ~ .parse::().map_err(|_| BamError::UnknownError{msg:"LN not an integere".to_string()})?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/bam_manipulation.rs:155:41 [INFO] [stdout] | [INFO] [stdout] 155 | rec.push_tag(b"LN", (&str_len).to_string()); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `str_len` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: immediately dereferencing a reference [INFO] [stdout] --> src/bam_manipulation.rs:187:28 [INFO] [stdout] | [INFO] [stdout] 187 | let mtid = *&read.mtid(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `read.mtid()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof [INFO] [stdout] = note: `#[warn(clippy::deref_addrof)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/by_barcode.rs:25:6 [INFO] [stdout] | [INFO] [stdout] 25 | ) -> Result< [INFO] [stdout] | ______^ [INFO] [stdout] 26 | | ( [INFO] [stdout] 27 | | Vec, //barcodes [INFO] [stdout] 28 | | Vec, //genes [INFO] [stdout] ... | [INFO] [stdout] 31 | | BamError, [INFO] [stdout] 32 | | > { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/count_reads/by_barcode.rs:49:17 [INFO] [stdout] | [INFO] [stdout] 49 | / match count_reads_primary_only_right_strand_only_by_barcode( [INFO] [stdout] 50 | | bam, [INFO] [stdout] 51 | | //&chunk.tree, [INFO] [stdout] 52 | | tree, [INFO] [stdout] ... | [INFO] [stdout] 65 | | _ => {} [INFO] [stdout] 66 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Ok(counts) = count_reads_primary_only_right_strand_only_by_barcode( [INFO] [stdout] 50 + bam, [INFO] [stdout] 51 + //&chunk.tree, [INFO] [stdout] 52 + tree, [INFO] [stdout] 53 + chunk.tid, [INFO] [stdout] 54 + chunk.start, [INFO] [stdout] 55 + chunk.stop, [INFO] [stdout] 56 + gene_ids.len() as u32, [INFO] [stdout] 57 + &umi_strategy, [INFO] [stdout] 58 + ) { [INFO] [stdout] 59 + for (gene_id, barcode, count) in counts.into_iter() { [INFO] [stdout] 60 + let barcode = std::str::from_utf8(&barcode).unwrap().to_string(); [INFO] [stdout] 61 + result.push((gene_ids[gene_id as usize].clone(), barcode, count)); [INFO] [stdout] 62 + } [INFO] [stdout] 63 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/count_reads/by_barcode.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | flat.sort_by(|a, b| (a.1.cmp(&b.1))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 95 - flat.sort_by(|a, b| (a.1.cmp(&b.1))); [INFO] [stdout] 95 + flat.sort_by_key(|a| a.1); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/count_reads/by_barcode.rs:135:20 [INFO] [stdout] | [INFO] [stdout] 135 | if (iv.1 < start) || iv.0 >= stop || ((iv.0 < start) && (iv.1 >= start)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 135 - if (iv.1 < start) || iv.0 >= stop || ((iv.0 < start) && (iv.1 >= start)) { [INFO] [stdout] 135 + if !(iv.1 >= start && iv.0 < stop && iv.0 >= start) { [INFO] [stdout] | [INFO] [stdout] 135 - if (iv.1 < start) || iv.0 >= stop || ((iv.0 < start) && (iv.1 >= start)) { [INFO] [stdout] 135 + if (iv.1 < start) || iv.0 >= stop || (iv.0 < start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/by_barcode.rs:122:24 [INFO] [stdout] | [INFO] [stdout] 122 | let mut positions: HashMap<(u32, Vec, i32, bool), HashSet>> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/by_barcode.rs:146:35 [INFO] [stdout] | [INFO] [stdout] 146 | let gene_no = (*entry).0; [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/by_barcode.rs:147:34 [INFO] [stdout] | [INFO] [stdout] 147 | let strand = (*entry).1; // this is 1 or -1 [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/count_reads/by_barcode.rs:184:45 [INFO] [stdout] | [INFO] [stdout] 184 | ... .or_insert_with(|| HashSet::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `HashSet::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/count_reads/chunked_genome.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | let chrs_in_tree_and_bam = trees [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 23 | | .keys() [INFO] [stdout] 24 | | .map(|x| x.clone()) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 22 ~ let chrs_in_tree_and_bam = trees [INFO] [stdout] 23 + .keys().cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/count_reads/chunked_genome.rs:47:17 [INFO] [stdout] | [INFO] [stdout] 47 | cg: &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.cg.trees` after checking its variant with `is_some` [INFO] [stdout] --> src/count_reads/chunked_genome.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 92 | if self.cg.trees.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = &self.cg.trees` [INFO] [stdout] 93 | let (next_tree, _next_gene_ids) = [INFO] [stdout] 94 | self.cg.trees.as_ref().unwrap().get(&self.last_chr).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/count_reads/chunked_genome.rs:78:28 [INFO] [stdout] | [INFO] [stdout] 78 | let next_chr = match self.it.next() { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 79 | | Some(x) => x, [INFO] [stdout] 80 | | None => return None, [INFO] [stdout] 81 | | }; [INFO] [stdout] | |_____________^ help: try instead: `self.it.next()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/counters.rs:70:35 [INFO] [stdout] | [INFO] [stdout] 70 | let gene_no = (*entry).0; [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/count_reads/counters.rs:86:30 [INFO] [stdout] | [INFO] [stdout] 86 | ... .or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/count_reads/counters.rs:101:17 [INFO] [stdout] | [INFO] [stdout] 101 | / if each_read_counts_once { [INFO] [stdout] 102 | | if hit { [INFO] [stdout] 103 | | //enable this (part 2 of 2) for each read hitting only once [INFO] [stdout] 104 | | break; [INFO] [stdout] 105 | | } [INFO] [stdout] 106 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 101 ~ if each_read_counts_once [INFO] [stdout] 102 ~ && hit { [INFO] [stdout] 103 | //enable this (part 2 of 2) for each read hitting only once [INFO] [stdout] 104 | break; [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/count_reads/counters.rs:138:1 [INFO] [stdout] | [INFO] [stdout] 138 | / fn count_reads_in_region_stranded( [INFO] [stdout] 139 | | mut bam: bam::IndexedReader, [INFO] [stdout] 140 | | tree: &OurTree, [INFO] [stdout] 141 | | tid: u32, [INFO] [stdout] ... | [INFO] [stdout] 148 | | where [INFO] [stdout] 149 | | T: ReadCatcher, [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/counters.rs:177:35 [INFO] [stdout] | [INFO] [stdout] 177 | let gene_no = (*entry).0; [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/counters.rs:178:34 [INFO] [stdout] | [INFO] [stdout] 178 | let strand = (*entry).1; // this is 1 or -1 [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/count_reads/counters.rs:198:34 [INFO] [stdout] | [INFO] [stdout] 198 | ... .or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/count_reads/counters.rs:209:34 [INFO] [stdout] | [INFO] [stdout] 209 | ... .or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/count_reads/counters.rs:217:17 [INFO] [stdout] | [INFO] [stdout] 217 | / if each_read_counts_once { [INFO] [stdout] 218 | | if hit { [INFO] [stdout] 219 | | //enable this (part 2 of 2) for each read hitting only once [INFO] [stdout] 220 | | break; [INFO] [stdout] 221 | | } [INFO] [stdout] 222 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 217 ~ if each_read_counts_once [INFO] [stdout] 218 ~ && hit { [INFO] [stdout] 219 | //enable this (part 2 of 2) for each read hitting only once [INFO] [stdout] 220 | break; [INFO] [stdout] 221 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/count_reads/counters.rs:313:43 [INFO] [stdout] | [INFO] [stdout] 313 | fn to_hashmap(counts: Vec, gene_ids: &Vec, chr: &str) -> HashMap { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 313 - fn to_hashmap(counts: Vec, gene_ids: &Vec, chr: &str) -> HashMap { [INFO] [stdout] 313 + fn to_hashmap(counts: Vec, gene_ids: &[String], chr: &str) -> HashMap { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/counters.rs:342:6 [INFO] [stdout] | [INFO] [stdout] 342 | ) -> Result<(HashMap, HashMap), BamError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/count_reads/counters.rs:351:33 [INFO] [stdout] | [INFO] [stdout] 351 | let matching_read_catcher = match &matching_read_output_bam_filename { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 352 | | None => None, [INFO] [stdout] 353 | | Some(_) => Some(Arc::new(RwLock::new(HashSet::new()))), [INFO] [stdout] 354 | | }; [INFO] [stdout] | |_____^ help: try: `matching_read_output_bam_filename.as_ref().map(|_| Arc::new(RwLock::new(HashSet::new())))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/count_reads/counters.rs:404:5 [INFO] [stdout] | [INFO] [stdout] 404 | / match matching_read_catcher { [INFO] [stdout] 405 | | Some(catcher) => { [INFO] [stdout] 406 | | let catcher = Arc::try_unwrap(catcher).unwrap().into_inner().unwrap(); [INFO] [stdout] 407 | | let output_filename = matching_read_output_bam_filename.unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 425 | | None => {} [INFO] [stdout] 426 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 404 ~ if let Some(catcher) = matching_read_catcher { [INFO] [stdout] 405 + let catcher = Arc::try_unwrap(catcher).unwrap().into_inner().unwrap(); [INFO] [stdout] 406 + let output_filename = matching_read_output_bam_filename.unwrap(); [INFO] [stdout] 407 + let mut bam_in = open_bam(filename, index_filename).unwrap(); [INFO] [stdout] 408 + bam_in.fetch(bam::FetchDefinition::All)?; [INFO] [stdout] 409 + [INFO] [stdout] 410 + let header = bam::Header::from_template(bam_in.header()); [INFO] [stdout] 411 + { [INFO] [stdout] 412 + let mut bam_out = [INFO] [stdout] 413 + bam::Writer::from_path(output_filename, &header, bam::Format::Bam)?; [INFO] [stdout] 414 + for read in bam_in.rc_records() { [INFO] [stdout] 415 + let read = read?; //if it fails her something is *very* wrong [INFO] [stdout] 416 + if catcher.contains(std::str::from_utf8(read.qname()).unwrap()) { [INFO] [stdout] 417 + bam_out.write(&read)?; [INFO] [stdout] 418 + } [INFO] [stdout] 419 + } [INFO] [stdout] 420 + } [INFO] [stdout] 421 + bam::index::build(output_filename, None, bam::index::Type::Bai, 4) [INFO] [stdout] 422 + .expect("Failed to build bam index"); [INFO] [stdout] 423 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `BamError` [INFO] [stdout] --> src/bam_ext.rs:17:23 [INFO] [stdout] | [INFO] [stdout] 17 | Err(e) => Err(BamError::UnknownError { [INFO] [stdout] | _______________________^ [INFO] [stdout] 18 | | msg: format!("Could not read bam: {}", e), [INFO] [stdout] 19 | | } [INFO] [stdout] 20 | | .into()), [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into()` [INFO] [stdout] | [INFO] [stdout] 17 ~ Err(e) => Err(BamError::UnknownError { [INFO] [stdout] 18 + msg: format!("Could not read bam: {}", e), [INFO] [stdout] 19 ~ }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/count_reads/introns.rs:16:14 [INFO] [stdout] | [INFO] [stdout] 16 | .or_insert(HashMap::<(u32, u32), u32>::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/count_reads/introns.rs:44:54 [INFO] [stdout] | [INFO] [stdout] 44 | *result.entry((*start, *stop)).or_insert(0 as u32) += 1; [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/count_reads/introns.rs:48:21 [INFO] [stdout] | [INFO] [stdout] 48 | .entry((std::u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 48 - .entry((std::u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] 48 + .entry((u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/count_reads/introns.rs:48:36 [INFO] [stdout] | [INFO] [stdout] 48 | .entry((std::u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 48 - .entry((std::u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] 48 + .entry((std::u32::MAX, u32::MAX - intron_count)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/count_reads/introns.rs:49:24 [INFO] [stdout] | [INFO] [stdout] 49 | .or_insert(0 as u32) += 1; [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/count_reads/introns.rs:85:21 [INFO] [stdout] | [INFO] [stdout] 85 | .reduce(|| IntronResult::new(), combine_intron_results); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `IntronResult::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/count_reads/introns.rs:77:17 [INFO] [stdout] | [INFO] [stdout] 77 | / match introns { [INFO] [stdout] 78 | | Ok(introns) => { [INFO] [stdout] 79 | | result.insert(chunk.chr.to_string(), introns); [INFO] [stdout] ... | [INFO] [stdout] 82 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 77 ~ if let Ok(introns) = introns { [INFO] [stdout] 78 + result.insert(chunk.chr.to_string(), introns); [INFO] [stdout] 79 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:25:6 [INFO] [stdout] | [INFO] [stdout] 25 | ) -> Result< [INFO] [stdout] | ______^ [INFO] [stdout] 26 | | ( [INFO] [stdout] 27 | | HashMap>, [INFO] [stdout] 28 | | HashMap>, [INFO] [stdout] 29 | | ), [INFO] [stdout] 30 | | BamError, [INFO] [stdout] 31 | | > { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:105:6 [INFO] [stdout] | [INFO] [stdout] 105 | ) -> Result<(Vec>, Vec>), BamError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/quantify.rs:123:35 [INFO] [stdout] | [INFO] [stdout] 123 | let gene_no = (*entry).0; [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/quantify.rs:129:34 [INFO] [stdout] | [INFO] [stdout] 129 | let strand = (*entry).1; // this is 1 or -1 [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/count_reads/quantify.rs:152:15 [INFO] [stdout] | [INFO] [stdout] 152 | gene_ids: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 152 - gene_ids: &Vec, [INFO] [stdout] 152 + gene_ids: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/count_reads/quantify.rs:157:32 [INFO] [stdout] | [INFO] [stdout] 157 | .map(|(gene_no, cnt)| ((&gene_ids[gene_no]).to_string(), cnt)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `gene_ids[gene_no]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:173:8 [INFO] [stdout] | [INFO] [stdout] 173 | a: ( [INFO] [stdout] | ________^ [INFO] [stdout] 174 | | HashMap>, [INFO] [stdout] 175 | | HashMap>, [INFO] [stdout] 176 | | ), [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:177:8 [INFO] [stdout] | [INFO] [stdout] 177 | b: ( [INFO] [stdout] | ________^ [INFO] [stdout] 178 | | HashMap>, [INFO] [stdout] 179 | | HashMap>, [INFO] [stdout] 180 | | ), [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:181:6 [INFO] [stdout] | [INFO] [stdout] 181 | ) -> ( [INFO] [stdout] | ______^ [INFO] [stdout] 182 | | HashMap>, [INFO] [stdout] 183 | | HashMap>, [INFO] [stdout] 184 | | ) { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/count_reads/quantify.rs:193:47 [INFO] [stdout] | [INFO] [stdout] 193 | let entry = a.entry(k).or_insert_with(|| HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `HashMap::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/count_reads/coverage.rs:45:26 [INFO] [stdout] | [INFO] [stdout] 45 | let index_filename = match index_filename { [INFO] [stdout] | __________________________^ [INFO] [stdout] 46 | | Some(x) => Some(x.as_ref().to_owned()), [INFO] [stdout] 47 | | None => None, [INFO] [stdout] 48 | | }; [INFO] [stdout] | |_____^ help: try: `index_filename.map(|x| x.as_ref().to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/count_reads/coverage.rs:49:40 [INFO] [stdout] | [INFO] [stdout] 49 | let _bam = open_bam(&bam_filename, (&index_filename).as_ref())?; // just for error checking [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `index_filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/count_reads/coverage.rs:57:21 [INFO] [stdout] | [INFO] [stdout] 57 | (&index_filename).as_ref(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `index_filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/count_reads/coverage.rs:119:22 [INFO] [stdout] | [INFO] [stdout] 119 | res[((pos as i64) - start) as usize] += 1; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/count_reads/by_position.rs:41:21 [INFO] [stdout] | [INFO] [stdout] 41 | .reduce(|| PositionCountResult::new(), combine_position_results); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `PositionCountResult::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/count_reads/by_position.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | / match pos_count { [INFO] [stdout] 34 | | Ok(pos_count) => { [INFO] [stdout] 35 | | result.insert(chunk.chr.to_string(), pos_count); [INFO] [stdout] ... | [INFO] [stdout] 38 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 33 ~ if let Ok(pos_count) = pos_count { [INFO] [stdout] 34 + result.insert(chunk.chr.to_string(), pos_count); [INFO] [stdout] 35 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/count_reads/by_position.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | if read.pos() as i64 != last_pos { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `read.pos()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/duplicate_distribution.rs:65:28 [INFO] [stdout] | [INFO] [stdout] 65 | if let Err(_) = result { [INFO] [stdout] | -------^^^^^^--------- help: try: `if result.is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | let trees = match trees { [INFO] [stdout] | _________________^ [INFO] [stdout] 104 | | Ok(trees) => trees, [INFO] [stdout] 105 | | Err(x) => return Err(x.into()), [INFO] [stdout] 106 | | }; [INFO] [stdout] | |_____^ help: try instead: `trees?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:147:15 [INFO] [stdout] | [INFO] [stdout] 147 | let res = match count_reads::py_count_reads_stranded( [INFO] [stdout] | _______________^ [INFO] [stdout] 148 | | filename, [INFO] [stdout] 149 | | index_filename, [INFO] [stdout] 150 | | trees, [INFO] [stdout] ... | [INFO] [stdout] 156 | | Err(y) => return Err(y.into()), [INFO] [stdout] 157 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] help: try instead [INFO] [stdout] | [INFO] [stdout] 147 ~ let res = count_reads::py_count_reads_stranded( [INFO] [stdout] 148 + filename, [INFO] [stdout] 149 + index_filename, [INFO] [stdout] 150 + trees, [INFO] [stdout] 151 + gene_trees, [INFO] [stdout] 152 + each_read_counts_once.unwrap_or(false), [INFO] [stdout] 153 + matching_reads_output_bam_filename, [INFO] [stdout] 154 ~ )?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:169:6 [INFO] [stdout] | [INFO] [stdout] 169 | ) -> PyResult<(Vec, Vec, Vec<(u32, u32, u32)>)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:199:15 [INFO] [stdout] | [INFO] [stdout] 199 | let res = match count_reads::py_count_introns(filename, index_filename) { [INFO] [stdout] | _______________^ [INFO] [stdout] 200 | | Ok(x) => x, [INFO] [stdout] 201 | | Err(y) => return Err(y.into()), [INFO] [stdout] 202 | | }; [INFO] [stdout] | |_____^ help: try instead: `count_reads::py_count_introns(filename, index_filename)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:212:15 [INFO] [stdout] | [INFO] [stdout] 212 | let res = match count_reads::py_count_positions(filename, index_filename) { [INFO] [stdout] | _______________^ [INFO] [stdout] 213 | | Ok(x) => x, [INFO] [stdout] 214 | | Err(y) => return Err(y.into()), [INFO] [stdout] 215 | | }; [INFO] [stdout] | |_____^ help: try instead: `count_reads::py_count_positions(filename, index_filename)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/lib.rs:227:5 [INFO] [stdout] | [INFO] [stdout] 227 | / let res = match bam_manipulation::py_substract_bam( [INFO] [stdout] 228 | | output_filename, [INFO] [stdout] 229 | | minuend_filename, [INFO] [stdout] 230 | | subtrahend_filename, [INFO] [stdout] ... | [INFO] [stdout] 233 | | Err(y) => return Err(y.into()), [INFO] [stdout] 234 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding and replace variable usages with `()` [INFO] [stdout] | [INFO] [stdout] 227 ~ match bam_manipulation::py_substract_bam( [INFO] [stdout] 228 | output_filename, [INFO] [stdout] ... [INFO] [stdout] 234 | }; [INFO] [stdout] 235 ~ Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:227:15 [INFO] [stdout] | [INFO] [stdout] 227 | let res = match bam_manipulation::py_substract_bam( [INFO] [stdout] | _______________^ [INFO] [stdout] 228 | | output_filename, [INFO] [stdout] 229 | | minuend_filename, [INFO] [stdout] 230 | | subtrahend_filename, [INFO] [stdout] ... | [INFO] [stdout] 233 | | Err(y) => return Err(y.into()), [INFO] [stdout] 234 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] help: try instead [INFO] [stdout] | [INFO] [stdout] 227 ~ let res = bam_manipulation::py_substract_bam( [INFO] [stdout] 228 + output_filename, [INFO] [stdout] 229 + minuend_filename, [INFO] [stdout] 230 + subtrahend_filename, [INFO] [stdout] 231 ~ )?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:246:6 [INFO] [stdout] | [INFO] [stdout] 246 | ) -> PyResult<( [INFO] [stdout] | ______^ [INFO] [stdout] 247 | | HashMap>, [INFO] [stdout] 248 | | HashMap>, [INFO] [stdout] 249 | | )> { [INFO] [stdout] | |__^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:252:15 [INFO] [stdout] | [INFO] [stdout] 252 | let res = match count_reads::py_quantify_gene_reads(filename, index_filename, trees, gene_trees) [INFO] [stdout] | _______________^ [INFO] [stdout] 253 | | { [INFO] [stdout] 254 | | Ok(x) => x, [INFO] [stdout] 255 | | Err(y) => return Err(y.into()), [INFO] [stdout] 256 | | }; [INFO] [stdout] | |_____^ help: try instead: `count_reads::py_quantify_gene_reads(filename, index_filename, trees, gene_trees)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:275:19 [INFO] [stdout] | [INFO] [stdout] 275 | Err(y) => return Err(y.into()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 275 - Err(y) => return Err(y.into()), [INFO] [stdout] 275 + Err(y) => Err(y.into()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:283:19 [INFO] [stdout] | [INFO] [stdout] 283 | Err(y) => return Err(y.into()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 283 - Err(y) => return Err(y.into()), [INFO] [stdout] 283 + Err(y) => Err(y.into()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:296:19 [INFO] [stdout] | [INFO] [stdout] 296 | Err(y) => return Err(y.into()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 296 - Err(y) => return Err(y.into()), [INFO] [stdout] 296 + Err(y) => Err(y.into()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bam_manipulation.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | return Ok(Box::new(GzDecoder::new(file))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 52 - return Ok(Box::new(GzDecoder::new(file))); [INFO] [stdout] 52 + Ok(Box::new(GzDecoder::new(file))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bam_manipulation.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | return Ok(Box::new(file)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 54 - return Ok(Box::new(file)); [INFO] [stdout] 54 + Ok(Box::new(file)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bam_manipulation.rs:67:28 [INFO] [stdout] | [INFO] [stdout] 67 | let mut qname_to_tags: HashMap, Vec<(Vec, Vec)>> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:361:25 [INFO] [stdout] | [INFO] [stdout] 361 | Option::None => return Err(value_error("Intervals was empty".to_string())), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 361 - Option::None => return Err(value_error("Intervals was empty".to_string())), [INFO] [stdout] 361 + Option::None => Err(value_error("Intervals was empty".to_string())), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `tid` is used as a loop counter [INFO] [stdout] --> src/bam_manipulation.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | for record in records.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (tid, record) in records.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> src/bam_manipulation.rs:147:30 [INFO] [stdout] | [INFO] [stdout] 147 | let length = record.get("LN") [INFO] [stdout] | ______________________________^ [INFO] [stdout] 148 | | .ok_or_else(||BamError::UnknownError{msg:"LN in @SQ missing".to_string()})? [INFO] [stdout] 149 | | .parse::().or_else(|_|Err(BamError::UnknownError{msg:"LN not an integere".to_string()}))?; [INFO] [stdout] | |_________________________________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 147 ~ let length = record.get("LN") [INFO] [stdout] 148 + .ok_or_else(||BamError::UnknownError{msg:"LN in @SQ missing".to_string()})? [INFO] [stdout] 149 ~ .parse::().map_err(|_| BamError::UnknownError{msg:"LN not an integere".to_string()})?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/bam_manipulation.rs:155:41 [INFO] [stdout] | [INFO] [stdout] 155 | rec.push_tag(b"LN", (&str_len).to_string()); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `str_len` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: immediately dereferencing a reference [INFO] [stdout] --> src/bam_manipulation.rs:187:28 [INFO] [stdout] | [INFO] [stdout] 187 | let mtid = *&read.mtid(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `read.mtid()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof [INFO] [stdout] = note: `#[warn(clippy::deref_addrof)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/lib.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | #[derive(Debug, Fail, Clone)] [INFO] [stdout] | ^--- [INFO] [stdout] | | [INFO] [stdout] | `Fail` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_DERIVE_failure_Fail_FOR_BamError` [INFO] [stdout] 21 | pub enum BamError { [INFO] [stdout] | -------- `BamError` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Fail` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Fail` may come from an old version of the `failure_derive` crate, try updating your dependency with `cargo update -p failure_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: `#[warn(non_local_definitions)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Fail` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/lib.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | #[derive(Debug, Fail, Clone)] [INFO] [stdout] | ^--- [INFO] [stdout] | | [INFO] [stdout] | `Display` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_DERIVE_failure_core_fmt_Display_FOR_BamError` [INFO] [stdout] 21 | pub enum BamError { [INFO] [stdout] | -------- `BamError` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Fail` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Fail` may come from an old version of the `failure_derive` crate, try updating your dependency with `cargo update -p failure_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Fail` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/count_reads/chunked_genome.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | pub fn iter(&self) -> ChunkedGenomeIterator { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 45 | pub fn iter(&self) -> ChunkedGenomeIterator<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bam_manipulation.rs:272:64 [INFO] [stdout] | [INFO] [stdout] 272 | crate::bam_manipulation::filter_and_rename_references(&output_str, input, lookup).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `output_str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bam_manipulation.rs:292:64 [INFO] [stdout] | [INFO] [stdout] 292 | crate::bam_manipulation::filter_and_rename_references(&output_str, input, lookup).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `output_str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bam_manipulation.rs:314:64 [INFO] [stdout] | [INFO] [stdout] 314 | crate::bam_manipulation::filter_and_rename_references(&output_str, input, lookup).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `output_str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bam_manipulation.rs:338:64 [INFO] [stdout] | [INFO] [stdout] 338 | crate::bam_manipulation::filter_and_rename_references(&output_str, input, lookup).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `output_str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/by_barcode.rs:25:6 [INFO] [stdout] | [INFO] [stdout] 25 | ) -> Result< [INFO] [stdout] | ______^ [INFO] [stdout] 26 | | ( [INFO] [stdout] 27 | | Vec, //barcodes [INFO] [stdout] 28 | | Vec, //genes [INFO] [stdout] ... | [INFO] [stdout] 31 | | BamError, [INFO] [stdout] 32 | | > { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/count_reads/by_barcode.rs:49:17 [INFO] [stdout] | [INFO] [stdout] 49 | / match count_reads_primary_only_right_strand_only_by_barcode( [INFO] [stdout] 50 | | bam, [INFO] [stdout] 51 | | //&chunk.tree, [INFO] [stdout] 52 | | tree, [INFO] [stdout] ... | [INFO] [stdout] 65 | | _ => {} [INFO] [stdout] 66 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Ok(counts) = count_reads_primary_only_right_strand_only_by_barcode( [INFO] [stdout] 50 + bam, [INFO] [stdout] 51 + //&chunk.tree, [INFO] [stdout] 52 + tree, [INFO] [stdout] 53 + chunk.tid, [INFO] [stdout] 54 + chunk.start, [INFO] [stdout] 55 + chunk.stop, [INFO] [stdout] 56 + gene_ids.len() as u32, [INFO] [stdout] 57 + &umi_strategy, [INFO] [stdout] 58 + ) { [INFO] [stdout] 59 + for (gene_id, barcode, count) in counts.into_iter() { [INFO] [stdout] 60 + let barcode = std::str::from_utf8(&barcode).unwrap().to_string(); [INFO] [stdout] 61 + result.push((gene_ids[gene_id as usize].clone(), barcode, count)); [INFO] [stdout] 62 + } [INFO] [stdout] 63 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/count_reads/by_barcode.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | flat.sort_by(|a, b| (a.1.cmp(&b.1))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 95 - flat.sort_by(|a, b| (a.1.cmp(&b.1))); [INFO] [stdout] 95 + flat.sort_by_key(|a| a.1); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/count_reads/by_barcode.rs:135:20 [INFO] [stdout] | [INFO] [stdout] 135 | if (iv.1 < start) || iv.0 >= stop || ((iv.0 < start) && (iv.1 >= start)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 135 - if (iv.1 < start) || iv.0 >= stop || ((iv.0 < start) && (iv.1 >= start)) { [INFO] [stdout] 135 + if !(iv.1 >= start && iv.0 < stop && iv.0 >= start) { [INFO] [stdout] | [INFO] [stdout] 135 - if (iv.1 < start) || iv.0 >= stop || ((iv.0 < start) && (iv.1 >= start)) { [INFO] [stdout] 135 + if (iv.1 < start) || iv.0 >= stop || (iv.0 < start) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/by_barcode.rs:122:24 [INFO] [stdout] | [INFO] [stdout] 122 | let mut positions: HashMap<(u32, Vec, i32, bool), HashSet>> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/by_barcode.rs:146:35 [INFO] [stdout] | [INFO] [stdout] 146 | let gene_no = (*entry).0; [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/by_barcode.rs:147:34 [INFO] [stdout] | [INFO] [stdout] 147 | let strand = (*entry).1; // this is 1 or -1 [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/count_reads/by_barcode.rs:184:45 [INFO] [stdout] | [INFO] [stdout] 184 | ... .or_insert_with(|| HashSet::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `HashSet::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/count_reads/chunked_genome.rs:22:36 [INFO] [stdout] | [INFO] [stdout] 22 | let chrs_in_tree_and_bam = trees [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 23 | | .keys() [INFO] [stdout] 24 | | .map(|x| x.clone()) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 22 ~ let chrs_in_tree_and_bam = trees [INFO] [stdout] 23 + .keys().cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/count_reads/chunked_genome.rs:47:17 [INFO] [stdout] | [INFO] [stdout] 47 | cg: &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `self.cg.trees` after checking its variant with `is_some` [INFO] [stdout] --> src/count_reads/chunked_genome.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 92 | if self.cg.trees.is_some() { [INFO] [stdout] | -------------------------- help: try: `if let Some() = &self.cg.trees` [INFO] [stdout] 93 | let (next_tree, _next_gene_ids) = [INFO] [stdout] 94 | self.cg.trees.as_ref().unwrap().get(&self.last_chr).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/count_reads/chunked_genome.rs:78:28 [INFO] [stdout] | [INFO] [stdout] 78 | let next_chr = match self.it.next() { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 79 | | Some(x) => x, [INFO] [stdout] 80 | | None => return None, [INFO] [stdout] 81 | | }; [INFO] [stdout] | |_____________^ help: try instead: `self.it.next()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/counters.rs:70:35 [INFO] [stdout] | [INFO] [stdout] 70 | let gene_no = (*entry).0; [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/count_reads/counters.rs:86:30 [INFO] [stdout] | [INFO] [stdout] 86 | ... .or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/count_reads/counters.rs:101:17 [INFO] [stdout] | [INFO] [stdout] 101 | / if each_read_counts_once { [INFO] [stdout] 102 | | if hit { [INFO] [stdout] 103 | | //enable this (part 2 of 2) for each read hitting only once [INFO] [stdout] 104 | | break; [INFO] [stdout] 105 | | } [INFO] [stdout] 106 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 101 ~ if each_read_counts_once [INFO] [stdout] 102 ~ && hit { [INFO] [stdout] 103 | //enable this (part 2 of 2) for each read hitting only once [INFO] [stdout] 104 | break; [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/count_reads/counters.rs:138:1 [INFO] [stdout] | [INFO] [stdout] 138 | / fn count_reads_in_region_stranded( [INFO] [stdout] 139 | | mut bam: bam::IndexedReader, [INFO] [stdout] 140 | | tree: &OurTree, [INFO] [stdout] 141 | | tid: u32, [INFO] [stdout] ... | [INFO] [stdout] 148 | | where [INFO] [stdout] 149 | | T: ReadCatcher, [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/counters.rs:177:35 [INFO] [stdout] | [INFO] [stdout] 177 | let gene_no = (*entry).0; [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/counters.rs:178:34 [INFO] [stdout] | [INFO] [stdout] 178 | let strand = (*entry).1; // this is 1 or -1 [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/count_reads/counters.rs:198:34 [INFO] [stdout] | [INFO] [stdout] 198 | ... .or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/count_reads/counters.rs:209:34 [INFO] [stdout] | [INFO] [stdout] 209 | ... .or_insert_with(HashSet::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/count_reads/counters.rs:217:17 [INFO] [stdout] | [INFO] [stdout] 217 | / if each_read_counts_once { [INFO] [stdout] 218 | | if hit { [INFO] [stdout] 219 | | //enable this (part 2 of 2) for each read hitting only once [INFO] [stdout] 220 | | break; [INFO] [stdout] 221 | | } [INFO] [stdout] 222 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 217 ~ if each_read_counts_once [INFO] [stdout] 218 ~ && hit { [INFO] [stdout] 219 | //enable this (part 2 of 2) for each read hitting only once [INFO] [stdout] 220 | break; [INFO] [stdout] 221 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/count_reads/counters.rs:313:43 [INFO] [stdout] | [INFO] [stdout] 313 | fn to_hashmap(counts: Vec, gene_ids: &Vec, chr: &str) -> HashMap { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 313 - fn to_hashmap(counts: Vec, gene_ids: &Vec, chr: &str) -> HashMap { [INFO] [stdout] 313 + fn to_hashmap(counts: Vec, gene_ids: &[String], chr: &str) -> HashMap { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/counters.rs:342:6 [INFO] [stdout] | [INFO] [stdout] 342 | ) -> Result<(HashMap, HashMap), BamError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/count_reads/counters.rs:351:33 [INFO] [stdout] | [INFO] [stdout] 351 | let matching_read_catcher = match &matching_read_output_bam_filename { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 352 | | None => None, [INFO] [stdout] 353 | | Some(_) => Some(Arc::new(RwLock::new(HashSet::new()))), [INFO] [stdout] 354 | | }; [INFO] [stdout] | |_____^ help: try: `matching_read_output_bam_filename.as_ref().map(|_| Arc::new(RwLock::new(HashSet::new())))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/count_reads/counters.rs:404:5 [INFO] [stdout] | [INFO] [stdout] 404 | / match matching_read_catcher { [INFO] [stdout] 405 | | Some(catcher) => { [INFO] [stdout] 406 | | let catcher = Arc::try_unwrap(catcher).unwrap().into_inner().unwrap(); [INFO] [stdout] 407 | | let output_filename = matching_read_output_bam_filename.unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 425 | | None => {} [INFO] [stdout] 426 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 404 ~ if let Some(catcher) = matching_read_catcher { [INFO] [stdout] 405 + let catcher = Arc::try_unwrap(catcher).unwrap().into_inner().unwrap(); [INFO] [stdout] 406 + let output_filename = matching_read_output_bam_filename.unwrap(); [INFO] [stdout] 407 + let mut bam_in = open_bam(filename, index_filename).unwrap(); [INFO] [stdout] 408 + bam_in.fetch(bam::FetchDefinition::All)?; [INFO] [stdout] 409 + [INFO] [stdout] 410 + let header = bam::Header::from_template(bam_in.header()); [INFO] [stdout] 411 + { [INFO] [stdout] 412 + let mut bam_out = [INFO] [stdout] 413 + bam::Writer::from_path(output_filename, &header, bam::Format::Bam)?; [INFO] [stdout] 414 + for read in bam_in.rc_records() { [INFO] [stdout] 415 + let read = read?; //if it fails her something is *very* wrong [INFO] [stdout] 416 + if catcher.contains(std::str::from_utf8(read.qname()).unwrap()) { [INFO] [stdout] 417 + bam_out.write(&read)?; [INFO] [stdout] 418 + } [INFO] [stdout] 419 + } [INFO] [stdout] 420 + } [INFO] [stdout] 421 + bam::index::build(output_filename, None, bam::index::Type::Bai, 4) [INFO] [stdout] 422 + .expect("Failed to build bam index"); [INFO] [stdout] 423 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/count_reads/introns.rs:16:14 [INFO] [stdout] | [INFO] [stdout] 16 | .or_insert(HashMap::<(u32, u32), u32>::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/count_reads/introns.rs:44:54 [INFO] [stdout] | [INFO] [stdout] 44 | *result.entry((*start, *stop)).or_insert(0 as u32) += 1; [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/count_reads/introns.rs:48:21 [INFO] [stdout] | [INFO] [stdout] 48 | .entry((std::u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 48 - .entry((std::u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] 48 + .entry((u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/count_reads/introns.rs:48:36 [INFO] [stdout] | [INFO] [stdout] 48 | .entry((std::u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 48 - .entry((std::u32::MAX, std::u32::MAX - intron_count)) [INFO] [stdout] 48 + .entry((std::u32::MAX, u32::MAX - intron_count)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/count_reads/introns.rs:49:24 [INFO] [stdout] | [INFO] [stdout] 49 | .or_insert(0 as u32) += 1; [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/count_reads/introns.rs:85:21 [INFO] [stdout] | [INFO] [stdout] 85 | .reduce(|| IntronResult::new(), combine_intron_results); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `IntronResult::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/count_reads/introns.rs:77:17 [INFO] [stdout] | [INFO] [stdout] 77 | / match introns { [INFO] [stdout] 78 | | Ok(introns) => { [INFO] [stdout] 79 | | result.insert(chunk.chr.to_string(), introns); [INFO] [stdout] ... | [INFO] [stdout] 82 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 77 ~ if let Ok(introns) = introns { [INFO] [stdout] 78 + result.insert(chunk.chr.to_string(), introns); [INFO] [stdout] 79 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:25:6 [INFO] [stdout] | [INFO] [stdout] 25 | ) -> Result< [INFO] [stdout] | ______^ [INFO] [stdout] 26 | | ( [INFO] [stdout] 27 | | HashMap>, [INFO] [stdout] 28 | | HashMap>, [INFO] [stdout] 29 | | ), [INFO] [stdout] 30 | | BamError, [INFO] [stdout] 31 | | > { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:105:6 [INFO] [stdout] | [INFO] [stdout] 105 | ) -> Result<(Vec>, Vec>), BamError> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/quantify.rs:123:35 [INFO] [stdout] | [INFO] [stdout] 123 | let gene_no = (*entry).0; [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/count_reads/quantify.rs:129:34 [INFO] [stdout] | [INFO] [stdout] 129 | let strand = (*entry).1; // this is 1 or -1 [INFO] [stdout] | ^^^^^^^^ help: try: `entry` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/count_reads/quantify.rs:152:15 [INFO] [stdout] | [INFO] [stdout] 152 | gene_ids: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 152 - gene_ids: &Vec, [INFO] [stdout] 152 + gene_ids: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/count_reads/quantify.rs:157:32 [INFO] [stdout] | [INFO] [stdout] 157 | .map(|(gene_no, cnt)| ((&gene_ids[gene_no]).to_string(), cnt)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `gene_ids[gene_no]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:173:8 [INFO] [stdout] | [INFO] [stdout] 173 | a: ( [INFO] [stdout] | ________^ [INFO] [stdout] 174 | | HashMap>, [INFO] [stdout] 175 | | HashMap>, [INFO] [stdout] 176 | | ), [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:177:8 [INFO] [stdout] | [INFO] [stdout] 177 | b: ( [INFO] [stdout] | ________^ [INFO] [stdout] 178 | | HashMap>, [INFO] [stdout] 179 | | HashMap>, [INFO] [stdout] 180 | | ), [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/count_reads/quantify.rs:181:6 [INFO] [stdout] | [INFO] [stdout] 181 | ) -> ( [INFO] [stdout] | ______^ [INFO] [stdout] 182 | | HashMap>, [INFO] [stdout] 183 | | HashMap>, [INFO] [stdout] 184 | | ) { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/count_reads/quantify.rs:193:47 [INFO] [stdout] | [INFO] [stdout] 193 | let entry = a.entry(k).or_insert_with(|| HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `HashMap::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/count_reads/coverage.rs:45:26 [INFO] [stdout] | [INFO] [stdout] 45 | let index_filename = match index_filename { [INFO] [stdout] | __________________________^ [INFO] [stdout] 46 | | Some(x) => Some(x.as_ref().to_owned()), [INFO] [stdout] 47 | | None => None, [INFO] [stdout] 48 | | }; [INFO] [stdout] | |_____^ help: try: `index_filename.map(|x| x.as_ref().to_owned())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/count_reads/coverage.rs:49:40 [INFO] [stdout] | [INFO] [stdout] 49 | let _bam = open_bam(&bam_filename, (&index_filename).as_ref())?; // just for error checking [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `index_filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/count_reads/coverage.rs:57:21 [INFO] [stdout] | [INFO] [stdout] 57 | (&index_filename).as_ref(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `index_filename` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/count_reads/coverage.rs:119:22 [INFO] [stdout] | [INFO] [stdout] 119 | res[((pos as i64) - start) as usize] += 1; [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/count_reads/by_position.rs:41:21 [INFO] [stdout] | [INFO] [stdout] 41 | .reduce(|| PositionCountResult::new(), combine_position_results); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `PositionCountResult::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/count_reads/by_position.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | / match pos_count { [INFO] [stdout] 34 | | Ok(pos_count) => { [INFO] [stdout] 35 | | result.insert(chunk.chr.to_string(), pos_count); [INFO] [stdout] ... | [INFO] [stdout] 38 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 33 ~ if let Ok(pos_count) = pos_count { [INFO] [stdout] 34 + result.insert(chunk.chr.to_string(), pos_count); [INFO] [stdout] 35 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/count_reads/by_position.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | if read.pos() as i64 != last_pos { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `read.pos()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/duplicate_distribution.rs:65:28 [INFO] [stdout] | [INFO] [stdout] 65 | if let Err(_) = result { [INFO] [stdout] | -------^^^^^^--------- help: try: `if result.is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | let trees = match trees { [INFO] [stdout] | _________________^ [INFO] [stdout] 104 | | Ok(trees) => trees, [INFO] [stdout] 105 | | Err(x) => return Err(x.into()), [INFO] [stdout] 106 | | }; [INFO] [stdout] | |_____^ help: try instead: `trees?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:147:15 [INFO] [stdout] | [INFO] [stdout] 147 | let res = match count_reads::py_count_reads_stranded( [INFO] [stdout] | _______________^ [INFO] [stdout] 148 | | filename, [INFO] [stdout] 149 | | index_filename, [INFO] [stdout] 150 | | trees, [INFO] [stdout] ... | [INFO] [stdout] 156 | | Err(y) => return Err(y.into()), [INFO] [stdout] 157 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] help: try instead [INFO] [stdout] | [INFO] [stdout] 147 ~ let res = count_reads::py_count_reads_stranded( [INFO] [stdout] 148 + filename, [INFO] [stdout] 149 + index_filename, [INFO] [stdout] 150 + trees, [INFO] [stdout] 151 + gene_trees, [INFO] [stdout] 152 + each_read_counts_once.unwrap_or(false), [INFO] [stdout] 153 + matching_reads_output_bam_filename, [INFO] [stdout] 154 ~ )?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:169:6 [INFO] [stdout] | [INFO] [stdout] 169 | ) -> PyResult<(Vec, Vec, Vec<(u32, u32, u32)>)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:199:15 [INFO] [stdout] | [INFO] [stdout] 199 | let res = match count_reads::py_count_introns(filename, index_filename) { [INFO] [stdout] | _______________^ [INFO] [stdout] 200 | | Ok(x) => x, [INFO] [stdout] 201 | | Err(y) => return Err(y.into()), [INFO] [stdout] 202 | | }; [INFO] [stdout] | |_____^ help: try instead: `count_reads::py_count_introns(filename, index_filename)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:212:15 [INFO] [stdout] | [INFO] [stdout] 212 | let res = match count_reads::py_count_positions(filename, index_filename) { [INFO] [stdout] | _______________^ [INFO] [stdout] 213 | | Ok(x) => x, [INFO] [stdout] 214 | | Err(y) => return Err(y.into()), [INFO] [stdout] 215 | | }; [INFO] [stdout] | |_____^ help: try instead: `count_reads::py_count_positions(filename, index_filename)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/lib.rs:227:5 [INFO] [stdout] | [INFO] [stdout] 227 | / let res = match bam_manipulation::py_substract_bam( [INFO] [stdout] 228 | | output_filename, [INFO] [stdout] 229 | | minuend_filename, [INFO] [stdout] 230 | | subtrahend_filename, [INFO] [stdout] ... | [INFO] [stdout] 233 | | Err(y) => return Err(y.into()), [INFO] [stdout] 234 | | }; [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding and replace variable usages with `()` [INFO] [stdout] | [INFO] [stdout] 227 ~ match bam_manipulation::py_substract_bam( [INFO] [stdout] 228 | output_filename, [INFO] [stdout] ... [INFO] [stdout] 234 | }; [INFO] [stdout] 235 ~ Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:227:15 [INFO] [stdout] | [INFO] [stdout] 227 | let res = match bam_manipulation::py_substract_bam( [INFO] [stdout] | _______________^ [INFO] [stdout] 228 | | output_filename, [INFO] [stdout] 229 | | minuend_filename, [INFO] [stdout] 230 | | subtrahend_filename, [INFO] [stdout] ... | [INFO] [stdout] 233 | | Err(y) => return Err(y.into()), [INFO] [stdout] 234 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] help: try instead [INFO] [stdout] | [INFO] [stdout] 227 ~ let res = bam_manipulation::py_substract_bam( [INFO] [stdout] 228 + output_filename, [INFO] [stdout] 229 + minuend_filename, [INFO] [stdout] 230 + subtrahend_filename, [INFO] [stdout] 231 ~ )?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/lib.rs:246:6 [INFO] [stdout] | [INFO] [stdout] 246 | ) -> PyResult<( [INFO] [stdout] | ______^ [INFO] [stdout] 247 | | HashMap>, [INFO] [stdout] 248 | | HashMap>, [INFO] [stdout] 249 | | )> { [INFO] [stdout] | |__^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/lib.rs:252:15 [INFO] [stdout] | [INFO] [stdout] 252 | let res = match count_reads::py_quantify_gene_reads(filename, index_filename, trees, gene_trees) [INFO] [stdout] | _______________^ [INFO] [stdout] 253 | | { [INFO] [stdout] 254 | | Ok(x) => x, [INFO] [stdout] 255 | | Err(y) => return Err(y.into()), [INFO] [stdout] 256 | | }; [INFO] [stdout] | |_____^ help: try instead: `count_reads::py_quantify_gene_reads(filename, index_filename, trees, gene_trees)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:275:19 [INFO] [stdout] | [INFO] [stdout] 275 | Err(y) => return Err(y.into()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 275 - Err(y) => return Err(y.into()), [INFO] [stdout] 275 + Err(y) => Err(y.into()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:283:19 [INFO] [stdout] | [INFO] [stdout] 283 | Err(y) => return Err(y.into()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 283 - Err(y) => return Err(y.into()), [INFO] [stdout] 283 + Err(y) => Err(y.into()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:296:19 [INFO] [stdout] | [INFO] [stdout] 296 | Err(y) => return Err(y.into()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 296 - Err(y) => return Err(y.into()), [INFO] [stdout] 296 + Err(y) => Err(y.into()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:361:25 [INFO] [stdout] | [INFO] [stdout] 361 | Option::None => return Err(value_error("Intervals was empty".to_string())), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 361 - Option::None => return Err(value_error("Intervals was empty".to_string())), [INFO] [stdout] 361 + Option::None => Err(value_error("Intervals was empty".to_string())), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/lib.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | #[derive(Debug, Fail, Clone)] [INFO] [stdout] | ^--- [INFO] [stdout] | | [INFO] [stdout] | `Fail` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_DERIVE_failure_Fail_FOR_BamError` [INFO] [stdout] 21 | pub enum BamError { [INFO] [stdout] | -------- `BamError` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Fail` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Fail` may come from an old version of the `failure_derive` crate, try updating your dependency with `cargo update -p failure_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: `#[warn(non_local_definitions)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Fail` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/lib.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | #[derive(Debug, Fail, Clone)] [INFO] [stdout] | ^--- [INFO] [stdout] | | [INFO] [stdout] | `Display` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_DERIVE_failure_core_fmt_Display_FOR_BamError` [INFO] [stdout] 21 | pub enum BamError { [INFO] [stdout] | -------- `BamError` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Fail` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Fail` may come from an old version of the `failure_derive` crate, try updating your dependency with `cargo update -p failure_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Fail` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/count_reads/chunked_genome.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | pub fn iter(&self) -> ChunkedGenomeIterator { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 45 | pub fn iter(&self) -> ChunkedGenomeIterator<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2m 38s [INFO] running `Command { std: "docker" "inspect" "20cb2c77a39ba27b258ff10341fa12665b170a299dffdbdcb94279a1d4b77645", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "20cb2c77a39ba27b258ff10341fa12665b170a299dffdbdcb94279a1d4b77645", kill_on_drop: false }` [INFO] [stdout] 20cb2c77a39ba27b258ff10341fa12665b170a299dffdbdcb94279a1d4b77645