[INFO] cloning repository https://github.com/jmin-pingu/adm [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/jmin-pingu/adm" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjmin-pingu%2Fadm", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjmin-pingu%2Fadm'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 18e269479622dd999efe11e2a847a4de0279f5ea [INFO] linting jmin-pingu/adm against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjmin-pingu%2Fadm" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/jmin-pingu/adm [INFO] finished tweaking git repo https://github.com/jmin-pingu/adm [INFO] tweaked toml for git repo https://github.com/jmin-pingu/adm written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/jmin-pingu/adm 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/jmin-pingu/adm 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 2b3bb73382b75a09cead2895d7af4a148d4b6ad44a42c685efedc58efed57dd1 [INFO] running `Command { std: "docker" "start" "-a" "2b3bb73382b75a09cead2895d7af4a148d4b6ad44a42c685efedc58efed57dd1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "2b3bb73382b75a09cead2895d7af4a148d4b6ad44a42c685efedc58efed57dd1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2b3bb73382b75a09cead2895d7af4a148d4b6ad44a42c685efedc58efed57dd1", kill_on_drop: false }` [INFO] [stdout] 2b3bb73382b75a09cead2895d7af4a148d4b6ad44a42c685efedc58efed57dd1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 0d9609b609214382b3429a86288855b72e2c7a88d17558bc6ea6ede38f30fd37 [INFO] running `Command { std: "docker" "start" "-a" "0d9609b609214382b3429a86288855b72e2c7a88d17558bc6ea6ede38f30fd37", kill_on_drop: false }` [INFO] [stderr] Checking adm v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::mem` [INFO] [stdout] --> src/containers/trees/bst.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::mem; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp` [INFO] [stdout] --> src/containers/priority_queue/heap.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::cmp; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fmt` [INFO] [stdout] --> src/containers/priority_queue/heap.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use std::fmt; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `collections::HashSet` [INFO] [stdout] --> src/graphs/weighted.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | collections::HashSet, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/graphs/weighted.rs:269:13 [INFO] [stdout] | [INFO] [stdout] 269 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/graphs/unweighted.rs:242:13 [INFO] [stdout] | [INFO] [stdout] 242 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::mem` [INFO] [stdout] --> src/containers/trees/bst.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::mem; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp` [INFO] [stdout] --> src/containers/priority_queue/heap.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::cmp; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fmt` [INFO] [stdout] --> src/containers/priority_queue/heap.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use std::fmt; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `collections::HashSet` [INFO] [stdout] --> src/graphs/weighted.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | collections::HashSet, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/graphs/weighted.rs:269:13 [INFO] [stdout] | [INFO] [stdout] 269 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/graphs/unweighted.rs:242:13 [INFO] [stdout] | [INFO] [stdout] 242 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/containers/trees/bst.rs:142:25 [INFO] [stdout] | [INFO] [stdout] 142 | _ => { panic!("All values of `left` and `right` should have been exhausted") }, [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] note: multiple earlier patterns match some of the same values [INFO] [stdout] --> src/containers/trees/bst.rs:142:25 [INFO] [stdout] | [INFO] [stdout] 136 | (None, None) => None, [INFO] [stdout] | ------------ matches some of the same values [INFO] [stdout] 137 | (Some(left), None) => Some(left), [INFO] [stdout] | ------------------ matches some of the same values [INFO] [stdout] 138 | (Some(left), Some(right)) => { [INFO] [stdout] | ------------------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 141 | (None, Some(right)) => Some(right), [INFO] [stdout] | ------------------- matches some of the same values [INFO] [stdout] 142 | _ => { panic!("All values of `left` and `right` should have been exhausted") }, [INFO] [stdout] | ^ collectively making this unreachable [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] = note: the full name for the type has been written to '/opt/rustwide/target/debug/deps/adm-449dc80c80305594.long-type-4672100536322066846.txt' [INFO] [stdout] = note: consider using `--verbose` to print the full type name to the console [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> src/containers/sets/union_find.rs:46:19 [INFO] [stdout] | [INFO] [stdout] 46 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `is_leaf` and `is_full` are never used [INFO] [stdout] --> src/containers/trees/bst.rs:25:8 [INFO] [stdout] | [INFO] [stdout] 24 | impl Node { [INFO] [stdout] | ------------------------------------- methods in this implementation [INFO] [stdout] 25 | fn is_leaf(&self) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 32 | fn is_full(&self) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `into_linked_list` is never used [INFO] [stdout] --> src/containers/trees/bst.rs:180:8 [INFO] [stdout] | [INFO] [stdout] 73 | impl Bst { [INFO] [stdout] | -------------------------------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 180 | fn into_linked_list(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `LinkedList` is never constructed [INFO] [stdout] --> src/containers/lists/linked_list.rs:2:12 [INFO] [stdout] | [INFO] [stdout] 2 | pub struct LinkedList { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Link` is never used [INFO] [stdout] --> src/containers/lists/linked_list.rs:6:6 [INFO] [stdout] | [INFO] [stdout] 6 | type Link = Option>>; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Node` is never constructed [INFO] [stdout] --> src/containers/lists/linked_list.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | struct Node { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/containers/lists/linked_list.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 13 | impl LinkedList { [INFO] [stdout] | ------------------------------------------ associated items in this implementation [INFO] [stdout] 14 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 20 | pub fn get(&self, idx: usize) -> &T { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 33 | pub fn get_index(&self, item: T) -> Option { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 44 | pub fn delete(&mut self, item: T) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 61 | pub fn pop(&mut self) -> Option { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 71 | pub fn push(&mut self, item: T) { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 76 | pub fn insert(&mut self, idx: usize, item: T) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `graph`, `parents`, and `total_weight` are never read [INFO] [stdout] --> src/graphs/weighted.rs:192:5 [INFO] [stdout] | [INFO] [stdout] 191 | pub struct MinSpanTree<'a> { [INFO] [stdout] | ----------- fields in this struct [INFO] [stdout] 192 | graph: &'a WeightedGraph, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 193 | parents: Vec>, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 194 | total_weight: i32, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `MinSpanTree` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `graph` is never read [INFO] [stdout] --> src/graphs/weighted.rs:206:5 [INFO] [stdout] | [INFO] [stdout] 205 | pub struct ShortestPaths<'a> { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] 206 | graph: &'a WeightedGraph, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ShortestPaths` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `path` and `weight` are never read [INFO] [stdout] --> src/graphs/weighted.rs:232:5 [INFO] [stdout] | [INFO] [stdout] 231 | pub struct Path { [INFO] [stdout] | ---- fields in this struct [INFO] [stdout] 232 | path: Vec, [INFO] [stdout] | ^^^^ [INFO] [stdout] 233 | weight: i32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Path` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/containers/trees/bst.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | / match (self.left.as_deref(), self.right.as_deref()) { [INFO] [stdout] 27 | | (None, None) => false, [INFO] [stdout] 28 | | _ => true, [INFO] [stdout] 29 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 26 - match (self.left.as_deref(), self.right.as_deref()) { [INFO] [stdout] 27 - (None, None) => false, [INFO] [stdout] 28 - _ => true, [INFO] [stdout] 29 - } [INFO] [stdout] 26 + !matches!((self.left.as_deref(), self.right.as_deref()), (None, None)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/containers/trees/bst.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | / match (self.left.as_deref(), self.right.as_deref()) { [INFO] [stdout] 34 | | (Some(_), Some(_)) => true, [INFO] [stdout] 35 | | _ => false, [INFO] [stdout] 36 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 33 - match (self.left.as_deref(), self.right.as_deref()) { [INFO] [stdout] 34 - (Some(_), Some(_)) => true, [INFO] [stdout] 35 - _ => false, [INFO] [stdout] 36 - } [INFO] [stdout] 33 + matches!((self.left.as_deref(), self.right.as_deref()), (Some(_), Some(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/containers/trees/bst.rs:67:29 [INFO] [stdout] | [INFO] [stdout] 67 | write!(f, "{}", "None") [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] = note: `#[warn(clippy::write_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 67 - write!(f, "{}", "None") [INFO] [stdout] 67 + write!(f, "None") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Bst` [INFO] [stdout] --> src/containers/trees/bst.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | / pub fn new() -> Self { [INFO] [stdout] 75 | | Bst { root: None } [INFO] [stdout] 76 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 73 + impl Default for Bst { [INFO] [stdout] 74 + fn default() -> Self { [INFO] [stdout] 75 + Self::new() [INFO] [stdout] 76 + } [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `into_*` usually take `self` by value [INFO] [stdout] --> src/containers/trees/bst.rs:180:25 [INFO] [stdout] | [INFO] [stdout] 180 | fn into_linked_list(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> src/containers/trees/bst.rs:195:43 [INFO] [stdout] | [INFO] [stdout] 195 | right_tail.as_deref_mut().map(|node| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] = note: `#[warn(clippy::manual_inspect)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 195 ~ right_tail.as_deref_mut().inspect(|node| { [INFO] [stdout] 196 | node.left = if let Some(left_node) = left_tail.as_deref_mut() { [INFO] [stdout] ... [INFO] [stdout] 199 | None [INFO] [stdout] 200 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> src/containers/trees/bst.rs:204:42 [INFO] [stdout] | [INFO] [stdout] 204 | left_tail.as_deref_mut().map(|node| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 204 ~ left_tail.as_deref_mut().inspect(|node| { [INFO] [stdout] 205 ~ node.right = right_tail; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/containers/trees/bst.rs:242:31 [INFO] [stdout] | [INFO] [stdout] 242 | Some(node) if !node.left.is_some() => { return Some(&node.item) }, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `node.left.is_none()` [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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/containers/trees/bst.rs:254:31 [INFO] [stdout] | [INFO] [stdout] 254 | Some(node) if !node.right.is_some() => { return Some(&node.item) }, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `node.right.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/containers/lists/linked_list.rs:62:15 [INFO] [stdout] | [INFO] [stdout] 62 | match mem::replace(&mut self.head, None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.head.take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] = note: `#[warn(clippy::mem_replace_option_with_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/containers/lists/linked_list.rs:72:20 [INFO] [stdout] | [INFO] [stdout] 72 | let tail = mem::replace(&mut self.head, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.head.take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Heap` [INFO] [stdout] --> src/containers/priority_queue/heap.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> Self { [INFO] [stdout] 8 | | Heap(Vec::new()) [INFO] [stdout] 9 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 6 + impl Default for Heap { [INFO] [stdout] 7 + fn default() -> Self { [INFO] [stdout] 8 + Self::new() [INFO] [stdout] 9 + } [INFO] [stdout] 10 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/containers/priority_queue/heap.rs:37:12 [INFO] [stdout] | [INFO] [stdout] 37 | if self.0.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.0.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/containers/priority_queue/heap.rs:47:12 [INFO] [stdout] | [INFO] [stdout] 47 | if self.0.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.0.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping elements of `self.0` manually [INFO] [stdout] --> src/containers/priority_queue/heap.rs:66:17 [INFO] [stdout] | [INFO] [stdout] 66 | / let temp = self.0[parent_idx]; [INFO] [stdout] 67 | | self.0[parent_idx] = self.0[cur_idx]; [INFO] [stdout] 68 | | self.0[cur_idx] = temp; [INFO] [stdout] | |_______________________________________^ help: try: `self.0.swap(parent_idx, cur_idx);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/sorter.rs:120:16 [INFO] [stdout] | [INFO] [stdout] 120 | if right.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!right.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/graphs/weighted.rs:52:15 [INFO] [stdout] | [INFO] [stdout] 52 | match mem::replace(&mut self.edges[i], None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.edges[i].take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/graphs/weighted.rs:58:19 [INFO] [stdout] | [INFO] [stdout] 58 | match mem::replace(&mut self.edges[j], None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.edges[j].take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/graphs/weighted.rs:123:16 [INFO] [stdout] | [INFO] [stdout] 123 | if !(set.find(edge.source) == set.find(edge.points_to)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(set.find(edge.source) != set.find(edge.points_to))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/weighted.rs:110:13 [INFO] [stdout] | [INFO] [stdout] 110 | / edge_list.as_deref().map(|edge| { [INFO] [stdout] 111 | | queue.insert(EdgePair::new(idx, edge.points_to, edge.weight)); [INFO] [stdout] 112 | | [INFO] [stdout] 113 | | let mut cur_edge = &edge.next; [INFO] [stdout] ... | [INFO] [stdout] 118 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 110 - edge_list.as_deref().map(|edge| { [INFO] [stdout] 111 - queue.insert(EdgePair::new(idx, edge.points_to, edge.weight)); [INFO] [stdout] 112 - [INFO] [stdout] 113 - let mut cur_edge = &edge.next; [INFO] [stdout] 114 - while let Some(e) = cur_edge { [INFO] [stdout] 115 - queue.insert(EdgePair::new(idx, e.points_to, e.weight)); [INFO] [stdout] 116 - cur_edge = &e.next; [INFO] [stdout] 117 - } [INFO] [stdout] 118 - }); [INFO] [stdout] 110 + if let Some(edge) = edge_list.as_deref() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/weighted.rs:268:13 [INFO] [stdout] | [INFO] [stdout] 268 | maybe_edge.as_ref().map(|edge| writeln!(f, "{}: {}", i, edge).expect("writer out of memory")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 268 - maybe_edge.as_ref().map(|edge| writeln!(f, "{}: {}", i, edge).expect("writer out of memory")); [INFO] [stdout] 268 + if let Some(edge) = maybe_edge.as_ref() { writeln!(f, "{}: {}", i, edge).expect("writer out of memory") } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: re-implementing `PartialEq::ne` is unnecessary [INFO] [stdout] --> src/graphs/weighted.rs:281:5 [INFO] [stdout] | [INFO] [stdout] 281 | fn ne(&self, other: &Self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl [INFO] [stdout] = note: `#[warn(clippy::partialeq_ne_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/graphs/unweighted.rs:59:15 [INFO] [stdout] | [INFO] [stdout] 59 | match mem::replace(&mut self.edges[i], None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.edges[i].take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/graphs/unweighted.rs:65:19 [INFO] [stdout] | [INFO] [stdout] 65 | match mem::replace(&mut self.edges[j], None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.edges[j].take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/graphs/unweighted.rs:106:23 [INFO] [stdout] | [INFO] [stdout] 106 | pub fn find_cycle<'a>(&'a self, start: usize) { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 106 - pub fn find_cycle<'a>(&'a self, start: usize) { [INFO] [stdout] 106 + pub fn find_cycle(&self, start: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/graphs/unweighted.rs:108:25 [INFO] [stdout] | [INFO] [stdout] 108 | fn process_edge<'a>(searcher: &'a mut DepthFirstSearcher<'_>, origin: usize, points_to: usize) { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 108 - fn process_edge<'a>(searcher: &'a mut DepthFirstSearcher<'_>, origin: usize, points_to: usize) { [INFO] [stdout] 108 + fn process_edge(searcher: &mut DepthFirstSearcher<'_>, origin: usize, points_to: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/graphs/unweighted.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 117 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:149:13 [INFO] [stdout] | [INFO] [stdout] 149 | preprocess.map(|f| f(self, v)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 149 - preprocess.map(|f| f(self, v)); [INFO] [stdout] 149 + if let Some(f) = preprocess { f(self, v) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:154:21 [INFO] [stdout] | [INFO] [stdout] 154 | process_edge.map(|f| f(self, v, incident.points_to)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 154 - process_edge.map(|f| f(self, v, incident.points_to)); [INFO] [stdout] 154 + if let Some(f) = process_edge { f(self, v, incident.points_to) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | postprocess.map(|f| f(self, v)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 163 - postprocess.map(|f| f(self, v)); [INFO] [stdout] 163 + if let Some(f) = postprocess { f(self, v) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:203:9 [INFO] [stdout] | [INFO] [stdout] 203 | preprocess.map(|f| f(start)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 203 - preprocess.map(|f| f(start)); [INFO] [stdout] 203 + if let Some(f) = preprocess { f(start) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:211:17 [INFO] [stdout] | [INFO] [stdout] 211 | process_edge.map(|f| f(self, start, v.points_to)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 211 - process_edge.map(|f| f(self, start, v.points_to)); [INFO] [stdout] 211 + if let Some(f) = process_edge { f(self, start, v.points_to) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:214:17 [INFO] [stdout] | [INFO] [stdout] 214 | process_edge.map(|f| f(self, start, v.points_to)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 214 - process_edge.map(|f| f(self, start, v.points_to)); [INFO] [stdout] 214 + if let Some(f) = process_edge { f(self, start, v.points_to) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:219:9 [INFO] [stdout] | [INFO] [stdout] 219 | postprocess.map(|f| f(start)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 219 - postprocess.map(|f| f(start)); [INFO] [stdout] 219 + if let Some(f) = postprocess { f(start) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | maybe_edge.as_ref().map(|edge| writeln!(f, "{}: {}", i, edge).expect("writer out of memory")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 241 - maybe_edge.as_ref().map(|edge| writeln!(f, "{}: {}", i, edge).expect("writer out of memory")); [INFO] [stdout] 241 + if let Some(edge) = maybe_edge.as_ref() { writeln!(f, "{}: {}", i, edge).expect("writer out of memory") } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/graphs/unweighted.rs:72:21 [INFO] [stdout] | [INFO] [stdout] 72 | pub fn init_bfs(&self) -> BreadthFirstSearcher { [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] 72 | pub fn init_bfs(&self) -> BreadthFirstSearcher<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/graphs/unweighted.rs:76:21 [INFO] [stdout] | [INFO] [stdout] 76 | pub fn init_dfs(&self) -> DepthFirstSearcher { [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] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 76 | pub fn init_dfs(&self) -> DepthFirstSearcher<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable pattern [INFO] [stdout] --> src/containers/trees/bst.rs:142:25 [INFO] [stdout] | [INFO] [stdout] 142 | _ => { panic!("All values of `left` and `right` should have been exhausted") }, [INFO] [stdout] | ^ no value can reach this [INFO] [stdout] | [INFO] [stdout] note: multiple earlier patterns match some of the same values [INFO] [stdout] --> src/containers/trees/bst.rs:142:25 [INFO] [stdout] | [INFO] [stdout] 136 | (None, None) => None, [INFO] [stdout] | ------------ matches some of the same values [INFO] [stdout] 137 | (Some(left), None) => Some(left), [INFO] [stdout] | ------------------ matches some of the same values [INFO] [stdout] 138 | (Some(left), Some(right)) => { [INFO] [stdout] | ------------------------- matches some of the same values [INFO] [stdout] ... [INFO] [stdout] 141 | (None, Some(right)) => Some(right), [INFO] [stdout] | ------------------- matches some of the same values [INFO] [stdout] 142 | _ => { panic!("All values of `left` and `right` should have been exhausted") }, [INFO] [stdout] | ^ collectively making this unreachable [INFO] [stdout] = note: `#[warn(unreachable_patterns)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] = note: the full name for the type has been written to '/opt/rustwide/target/debug/deps/adm-5232c14b6942707d.long-type-16872000692304845497.txt' [INFO] [stdout] = note: consider using `--verbose` to print the full type name to the console [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> src/containers/sets/union_find.rs:46:19 [INFO] [stdout] | [INFO] [stdout] 46 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `is_leaf` and `is_full` are never used [INFO] [stdout] --> src/containers/trees/bst.rs:25:8 [INFO] [stdout] | [INFO] [stdout] 24 | impl Node { [INFO] [stdout] | ------------------------------------- methods in this implementation [INFO] [stdout] 25 | fn is_leaf(&self) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 32 | fn is_full(&self) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `large` is never used [INFO] [stdout] --> src/containers/priority_queue/heap.rs:142:12 [INFO] [stdout] | [INFO] [stdout] 142 | pub fn large() { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `graph` and `parents` are never read [INFO] [stdout] --> src/graphs/weighted.rs:192:5 [INFO] [stdout] | [INFO] [stdout] 191 | pub struct MinSpanTree<'a> { [INFO] [stdout] | ----------- fields in this struct [INFO] [stdout] 192 | graph: &'a WeightedGraph, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 193 | parents: Vec>, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `MinSpanTree` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `graph` is never read [INFO] [stdout] --> src/graphs/weighted.rs:206:5 [INFO] [stdout] | [INFO] [stdout] 205 | pub struct ShortestPaths<'a> { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] 206 | graph: &'a WeightedGraph, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ShortestPaths` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `path` is never read [INFO] [stdout] --> src/graphs/weighted.rs:232:5 [INFO] [stdout] | [INFO] [stdout] 231 | pub struct Path { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 232 | path: Vec, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Path` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/containers/trees/bst.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | / match (self.left.as_deref(), self.right.as_deref()) { [INFO] [stdout] 27 | | (None, None) => false, [INFO] [stdout] 28 | | _ => true, [INFO] [stdout] 29 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 26 - match (self.left.as_deref(), self.right.as_deref()) { [INFO] [stdout] 27 - (None, None) => false, [INFO] [stdout] 28 - _ => true, [INFO] [stdout] 29 - } [INFO] [stdout] 26 + !matches!((self.left.as_deref(), self.right.as_deref()), (None, None)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/containers/trees/bst.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | / match (self.left.as_deref(), self.right.as_deref()) { [INFO] [stdout] 34 | | (Some(_), Some(_)) => true, [INFO] [stdout] 35 | | _ => false, [INFO] [stdout] 36 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 33 - match (self.left.as_deref(), self.right.as_deref()) { [INFO] [stdout] 34 - (Some(_), Some(_)) => true, [INFO] [stdout] 35 - _ => false, [INFO] [stdout] 36 - } [INFO] [stdout] 33 + matches!((self.left.as_deref(), self.right.as_deref()), (Some(_), Some(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/containers/trees/bst.rs:67:29 [INFO] [stdout] | [INFO] [stdout] 67 | write!(f, "{}", "None") [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] = note: `#[warn(clippy::write_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 67 - write!(f, "{}", "None") [INFO] [stdout] 67 + write!(f, "None") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Bst` [INFO] [stdout] --> src/containers/trees/bst.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | / pub fn new() -> Self { [INFO] [stdout] 75 | | Bst { root: None } [INFO] [stdout] 76 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 73 + impl Default for Bst { [INFO] [stdout] 74 + fn default() -> Self { [INFO] [stdout] 75 + Self::new() [INFO] [stdout] 76 + } [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `into_*` usually take `self` by value [INFO] [stdout] --> src/containers/trees/bst.rs:180:25 [INFO] [stdout] | [INFO] [stdout] 180 | fn into_linked_list(&mut self) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> src/containers/trees/bst.rs:195:43 [INFO] [stdout] | [INFO] [stdout] 195 | right_tail.as_deref_mut().map(|node| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] = note: `#[warn(clippy::manual_inspect)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 195 ~ right_tail.as_deref_mut().inspect(|node| { [INFO] [stdout] 196 | node.left = if let Some(left_node) = left_tail.as_deref_mut() { [INFO] [stdout] ... [INFO] [stdout] 199 | None [INFO] [stdout] 200 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `map` over `inspect` [INFO] [stdout] --> src/containers/trees/bst.rs:204:42 [INFO] [stdout] | [INFO] [stdout] 204 | left_tail.as_deref_mut().map(|node| { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_inspect [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 204 ~ left_tail.as_deref_mut().inspect(|node| { [INFO] [stdout] 205 ~ node.right = right_tail; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/containers/trees/bst.rs:242:31 [INFO] [stdout] | [INFO] [stdout] 242 | Some(node) if !node.left.is_some() => { return Some(&node.item) }, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `node.left.is_none()` [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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/containers/trees/bst.rs:254:31 [INFO] [stdout] | [INFO] [stdout] 254 | Some(node) if !node.right.is_some() => { return Some(&node.item) }, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `node.right.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:275:9 [INFO] [stdout] | [INFO] [stdout] 275 | assert_eq!(bst.contains(1), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 275 - assert_eq!(bst.contains(1), true); [INFO] [stdout] 275 + assert!(bst.contains(1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:276:9 [INFO] [stdout] | [INFO] [stdout] 276 | assert_eq!(bst.contains(2), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 276 - assert_eq!(bst.contains(2), true); [INFO] [stdout] 276 + assert!(bst.contains(2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:277:9 [INFO] [stdout] | [INFO] [stdout] 277 | assert_eq!(bst.contains(100), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 277 - assert_eq!(bst.contains(100), false); [INFO] [stdout] 277 + assert!(!bst.contains(100)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:291:9 [INFO] [stdout] | [INFO] [stdout] 291 | assert_eq!(bst.contains(7), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 291 - assert_eq!(bst.contains(7), false); [INFO] [stdout] 291 + assert!(!bst.contains(7)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:293:9 [INFO] [stdout] | [INFO] [stdout] 293 | assert_eq!(bst.contains(1), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 293 - assert_eq!(bst.contains(1), false); [INFO] [stdout] 293 + assert!(!bst.contains(1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:294:9 [INFO] [stdout] | [INFO] [stdout] 294 | assert_eq!(bst.contains(3), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 294 - assert_eq!(bst.contains(3), true); [INFO] [stdout] 294 + assert!(bst.contains(3)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:308:9 [INFO] [stdout] | [INFO] [stdout] 308 | assert_eq!(bst.contains(2), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 308 - assert_eq!(bst.contains(2), false); [INFO] [stdout] 308 + assert!(!bst.contains(2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:310:9 [INFO] [stdout] | [INFO] [stdout] 310 | assert_eq!(bst.contains(7), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 310 - assert_eq!(bst.contains(7), false); [INFO] [stdout] 310 + assert!(!bst.contains(7)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:313:9 [INFO] [stdout] | [INFO] [stdout] 313 | assert_eq!(bst.contains(1), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 313 - assert_eq!(bst.contains(1), false); [INFO] [stdout] 313 + assert!(!bst.contains(1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:314:9 [INFO] [stdout] | [INFO] [stdout] 314 | assert_eq!(bst.contains(3), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 314 - assert_eq!(bst.contains(3), true); [INFO] [stdout] 314 + assert!(bst.contains(3)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | assert_eq!(bst.is_balanced(), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 330 - assert_eq!(bst.is_balanced(), false); [INFO] [stdout] 330 + assert!(!bst.is_balanced()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:342:9 [INFO] [stdout] | [INFO] [stdout] 342 | assert_eq!(bst1.is_balanced(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 342 - assert_eq!(bst1.is_balanced(), true); [INFO] [stdout] 342 + assert!(bst1.is_balanced()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:352:9 [INFO] [stdout] | [INFO] [stdout] 352 | assert_eq!(bst2.is_balanced(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 352 - assert_eq!(bst2.is_balanced(), true); [INFO] [stdout] 352 + assert!(bst2.is_balanced()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/containers/trees/bst.rs:356:9 [INFO] [stdout] | [INFO] [stdout] 356 | assert_eq!(bst2.is_balanced(), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 356 - assert_eq!(bst2.is_balanced(), false); [INFO] [stdout] 356 + assert!(!bst2.is_balanced()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/containers/lists/linked_list.rs:62:15 [INFO] [stdout] | [INFO] [stdout] 62 | match mem::replace(&mut self.head, None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.head.take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] = note: `#[warn(clippy::mem_replace_option_with_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/containers/lists/linked_list.rs:72:20 [INFO] [stdout] | [INFO] [stdout] 72 | let tail = mem::replace(&mut self.head, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.head.take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Heap` [INFO] [stdout] --> src/containers/priority_queue/heap.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | / pub fn new() -> Self { [INFO] [stdout] 8 | | Heap(Vec::new()) [INFO] [stdout] 9 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 6 + impl Default for Heap { [INFO] [stdout] 7 + fn default() -> Self { [INFO] [stdout] 8 + Self::new() [INFO] [stdout] 9 + } [INFO] [stdout] 10 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/containers/priority_queue/heap.rs:37:12 [INFO] [stdout] | [INFO] [stdout] 37 | if self.0.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.0.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/containers/priority_queue/heap.rs:47:12 [INFO] [stdout] | [INFO] [stdout] 47 | if self.0.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.0.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping elements of `self.0` manually [INFO] [stdout] --> src/containers/priority_queue/heap.rs:66:17 [INFO] [stdout] | [INFO] [stdout] 66 | / let temp = self.0[parent_idx]; [INFO] [stdout] 67 | | self.0[parent_idx] = self.0[cur_idx]; [INFO] [stdout] 68 | | self.0[cur_idx] = temp; [INFO] [stdout] | |_______________________________________^ help: try: `self.0.swap(parent_idx, cur_idx);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/sorter.rs:120:16 [INFO] [stdout] | [INFO] [stdout] 120 | if right.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!right.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/graphs/weighted.rs:52:15 [INFO] [stdout] | [INFO] [stdout] 52 | match mem::replace(&mut self.edges[i], None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.edges[i].take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/graphs/weighted.rs:58:19 [INFO] [stdout] | [INFO] [stdout] 58 | match mem::replace(&mut self.edges[j], None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.edges[j].take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/graphs/weighted.rs:123:16 [INFO] [stdout] | [INFO] [stdout] 123 | if !(set.find(edge.source) == set.find(edge.points_to)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(set.find(edge.source) != set.find(edge.points_to))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/weighted.rs:110:13 [INFO] [stdout] | [INFO] [stdout] 110 | / edge_list.as_deref().map(|edge| { [INFO] [stdout] 111 | | queue.insert(EdgePair::new(idx, edge.points_to, edge.weight)); [INFO] [stdout] 112 | | [INFO] [stdout] 113 | | let mut cur_edge = &edge.next; [INFO] [stdout] ... | [INFO] [stdout] 118 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 110 - edge_list.as_deref().map(|edge| { [INFO] [stdout] 111 - queue.insert(EdgePair::new(idx, edge.points_to, edge.weight)); [INFO] [stdout] 112 - [INFO] [stdout] 113 - let mut cur_edge = &edge.next; [INFO] [stdout] 114 - while let Some(e) = cur_edge { [INFO] [stdout] 115 - queue.insert(EdgePair::new(idx, e.points_to, e.weight)); [INFO] [stdout] 116 - cur_edge = &e.next; [INFO] [stdout] 117 - } [INFO] [stdout] 118 - }); [INFO] [stdout] 110 + if let Some(edge) = edge_list.as_deref() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/weighted.rs:268:13 [INFO] [stdout] | [INFO] [stdout] 268 | maybe_edge.as_ref().map(|edge| writeln!(f, "{}: {}", i, edge).expect("writer out of memory")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 268 - maybe_edge.as_ref().map(|edge| writeln!(f, "{}: {}", i, edge).expect("writer out of memory")); [INFO] [stdout] 268 + if let Some(edge) = maybe_edge.as_ref() { writeln!(f, "{}: {}", i, edge).expect("writer out of memory") } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: re-implementing `PartialEq::ne` is unnecessary [INFO] [stdout] --> src/graphs/weighted.rs:281:5 [INFO] [stdout] | [INFO] [stdout] 281 | fn ne(&self, other: &Self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl [INFO] [stdout] = note: `#[warn(clippy::partialeq_ne_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/graphs/unweighted.rs:59:15 [INFO] [stdout] | [INFO] [stdout] 59 | match mem::replace(&mut self.edges[i], None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.edges[i].take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.61s [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> src/graphs/unweighted.rs:65:19 [INFO] [stdout] | [INFO] [stdout] 65 | match mem::replace(&mut self.edges[j], None) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.edges[j].take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/graphs/unweighted.rs:106:23 [INFO] [stdout] | [INFO] [stdout] 106 | pub fn find_cycle<'a>(&'a self, start: usize) { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 106 - pub fn find_cycle<'a>(&'a self, start: usize) { [INFO] [stdout] 106 + pub fn find_cycle(&self, start: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/graphs/unweighted.rs:108:25 [INFO] [stdout] | [INFO] [stdout] 108 | fn process_edge<'a>(searcher: &'a mut DepthFirstSearcher<'_>, origin: usize, points_to: usize) { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 108 - fn process_edge<'a>(searcher: &'a mut DepthFirstSearcher<'_>, origin: usize, points_to: usize) { [INFO] [stdout] 108 + fn process_edge(searcher: &mut DepthFirstSearcher<'_>, origin: usize, points_to: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/graphs/unweighted.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 117 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:149:13 [INFO] [stdout] | [INFO] [stdout] 149 | preprocess.map(|f| f(self, v)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 149 - preprocess.map(|f| f(self, v)); [INFO] [stdout] 149 + if let Some(f) = preprocess { f(self, v) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:154:21 [INFO] [stdout] | [INFO] [stdout] 154 | process_edge.map(|f| f(self, v, incident.points_to)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 154 - process_edge.map(|f| f(self, v, incident.points_to)); [INFO] [stdout] 154 + if let Some(f) = process_edge { f(self, v, incident.points_to) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | postprocess.map(|f| f(self, v)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 163 - postprocess.map(|f| f(self, v)); [INFO] [stdout] 163 + if let Some(f) = postprocess { f(self, v) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:203:9 [INFO] [stdout] | [INFO] [stdout] 203 | preprocess.map(|f| f(start)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 203 - preprocess.map(|f| f(start)); [INFO] [stdout] 203 + if let Some(f) = preprocess { f(start) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:211:17 [INFO] [stdout] | [INFO] [stdout] 211 | process_edge.map(|f| f(self, start, v.points_to)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 211 - process_edge.map(|f| f(self, start, v.points_to)); [INFO] [stdout] 211 + if let Some(f) = process_edge { f(self, start, v.points_to) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:214:17 [INFO] [stdout] | [INFO] [stdout] 214 | process_edge.map(|f| f(self, start, v.points_to)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 214 - process_edge.map(|f| f(self, start, v.points_to)); [INFO] [stdout] 214 + if let Some(f) = process_edge { f(self, start, v.points_to) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:219:9 [INFO] [stdout] | [INFO] [stdout] 219 | postprocess.map(|f| f(start)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 219 - postprocess.map(|f| f(start)); [INFO] [stdout] 219 + if let Some(f) = postprocess { f(start) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/graphs/unweighted.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | maybe_edge.as_ref().map(|edge| writeln!(f, "{}: {}", i, edge).expect("writer out of memory")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 241 - maybe_edge.as_ref().map(|edge| writeln!(f, "{}: {}", i, edge).expect("writer out of memory")); [INFO] [stdout] 241 + if let Some(edge) = maybe_edge.as_ref() { writeln!(f, "{}: {}", i, edge).expect("writer out of memory") } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/graphs/unweighted.rs:72:21 [INFO] [stdout] | [INFO] [stdout] 72 | pub fn init_bfs(&self) -> BreadthFirstSearcher { [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] 72 | pub fn init_bfs(&self) -> BreadthFirstSearcher<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/graphs/unweighted.rs:76:21 [INFO] [stdout] | [INFO] [stdout] 76 | pub fn init_dfs(&self) -> DepthFirstSearcher { [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] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 76 | pub fn init_dfs(&self) -> DepthFirstSearcher<'_> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] running `Command { std: "docker" "inspect" "0d9609b609214382b3429a86288855b72e2c7a88d17558bc6ea6ede38f30fd37", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0d9609b609214382b3429a86288855b72e2c7a88d17558bc6ea6ede38f30fd37", kill_on_drop: false }` [INFO] [stdout] 0d9609b609214382b3429a86288855b72e2c7a88d17558bc6ea6ede38f30fd37