[INFO] fetching crate kd-tree-rs 0.1.0... [INFO] linting kd-tree-rs-0.1.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate kd-tree-rs 0.1.0 into /workspace/builds/worker-7-tc1/source [INFO] started tweaking crates.io crate kd-tree-rs 0.1.0 [INFO] finished tweaking crates.io crate kd-tree-rs 0.1.0 [INFO] tweaked toml for crates.io crate kd-tree-rs 0.1.0 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate kd-tree-rs 0.1.0 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 crates.io crate kd-tree-rs 0.1.0 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-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] aca20c3ef4f1381bcc4289a7c5555dc3afc79cd7314c7ddedc2be05412ae4b7d [INFO] running `Command { std: "docker" "start" "-a" "aca20c3ef4f1381bcc4289a7c5555dc3afc79cd7314c7ddedc2be05412ae4b7d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "aca20c3ef4f1381bcc4289a7c5555dc3afc79cd7314c7ddedc2be05412ae4b7d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "aca20c3ef4f1381bcc4289a7c5555dc3afc79cd7314c7ddedc2be05412ae4b7d", kill_on_drop: false }` [INFO] [stdout] aca20c3ef4f1381bcc4289a7c5555dc3afc79cd7314c7ddedc2be05412ae4b7d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 4384b8f9b3eb3e5e3746271387e7f8bc47b449ed91bfd4bdcd6225d0946ce3c0 [INFO] running `Command { std: "docker" "start" "-a" "4384b8f9b3eb3e5e3746271387e7f8bc47b449ed91bfd4bdcd6225d0946ce3c0", kill_on_drop: false }` [INFO] [stderr] Checking kd-tree-rs v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/point.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | return (origin + radius > point && origin < point) || (origin - radius < point && origin > point); [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] 34 - return (origin + radius > point && origin < point) || (origin - radius < point && origin > point); [INFO] [stdout] 34 + (origin + radius > point && origin < point) || (origin - radius < point && origin > point) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/point.rs:40:30 [INFO] [stdout] | [INFO] [stdout] 40 | ls_value.partial_cmp(&rs_value).unwrap() [INFO] [stdout] | ^^^^^^^^^ help: change this to: `rs_value` [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: you should consider adding a `Default` implementation for `KdNode` [INFO] [stdout] --> src/lib.rs:106:5 [INFO] [stdout] | [INFO] [stdout] 106 | / pub fn new() -> Self { [INFO] [stdout] 107 | | Empty [INFO] [stdout] 108 | | } [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] 104 + impl + Sub + Add + std::fmt::Debug> Default for KdNode { [INFO] [stdout] 105 + fn default() -> Self { [INFO] [stdout] 106 + Self::new() [INFO] [stdout] 107 + } [INFO] [stdout] 108 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/lib.rs:159:29 [INFO] [stdout] | [INFO] [stdout] 159 | pub fn nearest_neighbor<'a>(&self, origin: Point, radius: f64) -> Vec> { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:169:9 [INFO] [stdout] | [INFO] [stdout] 169 | / return best_queue [INFO] [stdout] 170 | | .iter() [INFO] [stdout] 171 | | .map(|(node, _)| match node { [INFO] [stdout] 172 | | Node { point, .. } => point.clone(), [INFO] [stdout] 173 | | _ => panic!("Empty node in best queue"), [INFO] [stdout] 174 | | }) [INFO] [stdout] 175 | | .collect(); [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] 169 ~ best_queue [INFO] [stdout] 170 + .iter() [INFO] [stdout] 171 + .map(|(node, _)| match node { [INFO] [stdout] 172 + Node { point, .. } => point.clone(), [INFO] [stdout] 173 + _ => panic!("Empty node in best queue"), [INFO] [stdout] 174 + }) [INFO] [stdout] 175 ~ .collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `parent_queue.get(0)` [INFO] [stdout] --> src/lib.rs:164:35 [INFO] [stdout] | [INFO] [stdout] 164 | let deepest: &KdNode = parent_queue.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `parent_queue.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:172:39 [INFO] [stdout] | [INFO] [stdout] 172 | Node { point, .. } => point.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*point` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/lib.rs:181:33 [INFO] [stdout] | [INFO] [stdout] 181 | pub fn nearest_neighbor_x_y<'a>(&self, x: T, y: T, radius: f64) -> Vec> { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/lib.rs:189:31 [INFO] [stdout] | [INFO] [stdout] 189 | pub fn n_nearest_neighbor<'a>(&self, origin: Point, max: usize) -> Vec> { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | / return best_queue [INFO] [stdout] 198 | | .iter() [INFO] [stdout] 199 | | .map(|(node, _)| match node { [INFO] [stdout] 200 | | Node { point, .. } => point.clone(), [INFO] [stdout] 201 | | _ => panic!("Empty node in best queue"), [INFO] [stdout] 202 | | }) [INFO] [stdout] 203 | | .collect(); [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] 197 ~ best_queue [INFO] [stdout] 198 + .iter() [INFO] [stdout] 199 + .map(|(node, _)| match node { [INFO] [stdout] 200 + Node { point, .. } => point.clone(), [INFO] [stdout] 201 + _ => panic!("Empty node in best queue"), [INFO] [stdout] 202 + }) [INFO] [stdout] 203 ~ .collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `parent_queue.get(0)` [INFO] [stdout] --> src/lib.rs:192:35 [INFO] [stdout] | [INFO] [stdout] 192 | let deepest: &KdNode = parent_queue.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `parent_queue.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:200:39 [INFO] [stdout] | [INFO] [stdout] 200 | Node { point, .. } => point.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*point` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:244:24 [INFO] [stdout] | [INFO] [stdout] 244 | if !best_queue.iter() [INFO] [stdout] | ________________________^ [INFO] [stdout] 245 | | .find(|(a, _)| *a == side_node.as_ref()) [INFO] [stdout] 246 | | .is_some() [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] 244 ~ if best_queue.iter() [INFO] [stdout] 245 + .find(|(a, _)| *a == side_node.as_ref()).is_none() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/lib.rs:251:33 [INFO] [stdout] | [INFO] [stdout] 251 | / ... if !point.in_radius(&origin, dim, radius) { [INFO] [stdout] 252 | | ... continue; [INFO] [stdout] 253 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 250 ~ Node { point, dim, .. } [INFO] [stdout] 251 ~ if !point.in_radius(&origin, dim, radius) => { [INFO] [stdout] 252 | continue; [INFO] [stdout] 253 ~ }, [INFO] [stdout] | [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/lib.rs:249:25 [INFO] [stdout] | [INFO] [stdout] 249 | / match side_node.as_ref() { [INFO] [stdout] 250 | | Node { point, dim, .. } => { [INFO] [stdout] 251 | | if !point.in_radius(&origin, dim, radius) { [INFO] [stdout] 252 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 255 | | _ => {} [INFO] [stdout] 256 | | } [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] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 249 ~ if let Node { point, dim, .. } = side_node.as_ref() { [INFO] [stdout] 250 + if !point.in_radius(&origin, dim, radius) { [INFO] [stdout] 251 + continue; [INFO] [stdout] 252 + } [INFO] [stdout] 253 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:302:9 [INFO] [stdout] | [INFO] [stdout] 302 | return parents; [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] 302 - return parents; [INFO] [stdout] 302 + parents [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/lib.rs:309:6 [INFO] [stdout] | [INFO] [stdout] 309 | ) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [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: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:335:24 [INFO] [stdout] | [INFO] [stdout] 335 | point: points[0].clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `points[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:365:59 [INFO] [stdout] | [INFO] [stdout] 365 | points.sort_by(|a: &Point, b: &Point| a.cmp(&b, &axis)); [INFO] [stdout] | ^^ help: change this to: `b` [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/lib.rs:365:63 [INFO] [stdout] | [INFO] [stdout] 365 | points.sort_by(|a: &Point, b: &Point| a.cmp(&b, &axis)); [INFO] [stdout] | ^^^^^ help: change this to: `axis` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/lib.rs:366:38 [INFO] [stdout] | [INFO] [stdout] 366 | let median_index: usize = if points.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `points.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: eliding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/lib.rs:217:15 [INFO] [stdout] | [INFO] [stdout] 211 | &'a self, [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] ... [INFO] [stdout] 214 | best_queue: &mut Vec<(&'a KdNode, f64)>, [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 215 | parent_queue: &mut Vec<&'a KdNode>, [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 216 | max: Option, [INFO] [stdout] 217 | ) -> Vec<(&KdNode, f64)> { [INFO] [stdout] | ^^^^^^^^^^ the same 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: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 217 | ) -> Vec<(&'a KdNode, f64)> { [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/point.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | return (origin + radius > point && origin < point) || (origin - radius < point && origin > point); [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] 34 - return (origin + radius > point && origin < point) || (origin - radius < point && origin > point); [INFO] [stdout] 34 + (origin + radius > point && origin < point) || (origin - radius < point && origin > point) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/point.rs:40:30 [INFO] [stdout] | [INFO] [stdout] 40 | ls_value.partial_cmp(&rs_value).unwrap() [INFO] [stdout] | ^^^^^^^^^ help: change this to: `rs_value` [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: module has the same name as its containing module [INFO] [stdout] --> src/tests.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / mod tests { [INFO] [stdout] 4 | | use crate::dim::Dim; [INFO] [stdout] 5 | | use crate::point::Point; [INFO] [stdout] 6 | | use crate::*; [INFO] [stdout] ... | [INFO] [stdout] 210 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `KdNode` [INFO] [stdout] --> src/lib.rs:106:5 [INFO] [stdout] | [INFO] [stdout] 106 | / pub fn new() -> Self { [INFO] [stdout] 107 | | Empty [INFO] [stdout] 108 | | } [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] 104 + impl + Sub + Add + std::fmt::Debug> Default for KdNode { [INFO] [stdout] 105 + fn default() -> Self { [INFO] [stdout] 106 + Self::new() [INFO] [stdout] 107 + } [INFO] [stdout] 108 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/lib.rs:159:29 [INFO] [stdout] | [INFO] [stdout] 159 | pub fn nearest_neighbor<'a>(&self, origin: Point, radius: f64) -> Vec> { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:169:9 [INFO] [stdout] | [INFO] [stdout] 169 | / return best_queue [INFO] [stdout] 170 | | .iter() [INFO] [stdout] 171 | | .map(|(node, _)| match node { [INFO] [stdout] 172 | | Node { point, .. } => point.clone(), [INFO] [stdout] 173 | | _ => panic!("Empty node in best queue"), [INFO] [stdout] 174 | | }) [INFO] [stdout] 175 | | .collect(); [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] 169 ~ best_queue [INFO] [stdout] 170 + .iter() [INFO] [stdout] 171 + .map(|(node, _)| match node { [INFO] [stdout] 172 + Node { point, .. } => point.clone(), [INFO] [stdout] 173 + _ => panic!("Empty node in best queue"), [INFO] [stdout] 174 + }) [INFO] [stdout] 175 ~ .collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `parent_queue.get(0)` [INFO] [stdout] --> src/lib.rs:164:35 [INFO] [stdout] | [INFO] [stdout] 164 | let deepest: &KdNode = parent_queue.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `parent_queue.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:172:39 [INFO] [stdout] | [INFO] [stdout] 172 | Node { point, .. } => point.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*point` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/lib.rs:181:33 [INFO] [stdout] | [INFO] [stdout] 181 | pub fn nearest_neighbor_x_y<'a>(&self, x: T, y: T, radius: f64) -> Vec> { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/lib.rs:189:31 [INFO] [stdout] | [INFO] [stdout] 189 | pub fn n_nearest_neighbor<'a>(&self, origin: Point, max: usize) -> Vec> { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | / return best_queue [INFO] [stdout] 198 | | .iter() [INFO] [stdout] 199 | | .map(|(node, _)| match node { [INFO] [stdout] 200 | | Node { point, .. } => point.clone(), [INFO] [stdout] 201 | | _ => panic!("Empty node in best queue"), [INFO] [stdout] 202 | | }) [INFO] [stdout] 203 | | .collect(); [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] 197 ~ best_queue [INFO] [stdout] 198 + .iter() [INFO] [stdout] 199 + .map(|(node, _)| match node { [INFO] [stdout] 200 + Node { point, .. } => point.clone(), [INFO] [stdout] 201 + _ => panic!("Empty node in best queue"), [INFO] [stdout] 202 + }) [INFO] [stdout] 203 ~ .collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `parent_queue.get(0)` [INFO] [stdout] --> src/lib.rs:192:35 [INFO] [stdout] | [INFO] [stdout] 192 | let deepest: &KdNode = parent_queue.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `parent_queue.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:200:39 [INFO] [stdout] | [INFO] [stdout] 200 | Node { point, .. } => point.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*point` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:244:24 [INFO] [stdout] | [INFO] [stdout] 244 | if !best_queue.iter() [INFO] [stdout] | ________________________^ [INFO] [stdout] 245 | | .find(|(a, _)| *a == side_node.as_ref()) [INFO] [stdout] 246 | | .is_some() [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] 244 ~ if best_queue.iter() [INFO] [stdout] 245 + .find(|(a, _)| *a == side_node.as_ref()).is_none() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/lib.rs:251:33 [INFO] [stdout] | [INFO] [stdout] 251 | / ... if !point.in_radius(&origin, dim, radius) { [INFO] [stdout] 252 | | ... continue; [INFO] [stdout] 253 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 250 ~ Node { point, dim, .. } [INFO] [stdout] 251 ~ if !point.in_radius(&origin, dim, radius) => { [INFO] [stdout] 252 | continue; [INFO] [stdout] 253 ~ }, [INFO] [stdout] | [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/lib.rs:249:25 [INFO] [stdout] | [INFO] [stdout] 249 | / match side_node.as_ref() { [INFO] [stdout] 250 | | Node { point, dim, .. } => { [INFO] [stdout] 251 | | if !point.in_radius(&origin, dim, radius) { [INFO] [stdout] 252 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 255 | | _ => {} [INFO] [stdout] 256 | | } [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] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 249 ~ if let Node { point, dim, .. } = side_node.as_ref() { [INFO] [stdout] 250 + if !point.in_radius(&origin, dim, radius) { [INFO] [stdout] 251 + continue; [INFO] [stdout] 252 + } [INFO] [stdout] 253 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/lib.rs:302:9 [INFO] [stdout] | [INFO] [stdout] 302 | return parents; [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] 302 - return parents; [INFO] [stdout] 302 + parents [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/lib.rs:309:6 [INFO] [stdout] | [INFO] [stdout] 309 | ) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [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: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/lib.rs:335:24 [INFO] [stdout] | [INFO] [stdout] 335 | point: points[0].clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `points[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/lib.rs:365:59 [INFO] [stdout] | [INFO] [stdout] 365 | points.sort_by(|a: &Point, b: &Point| a.cmp(&b, &axis)); [INFO] [stdout] | ^^ help: change this to: `b` [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/lib.rs:365:63 [INFO] [stdout] | [INFO] [stdout] 365 | points.sort_by(|a: &Point, b: &Point| a.cmp(&b, &axis)); [INFO] [stdout] | ^^^^^ help: change this to: `axis` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/lib.rs:366:38 [INFO] [stdout] | [INFO] [stdout] 366 | let median_index: usize = if points.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace with: `points.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: eliding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/lib.rs:217:15 [INFO] [stdout] | [INFO] [stdout] 211 | &'a self, [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] ... [INFO] [stdout] 214 | best_queue: &mut Vec<(&'a KdNode, f64)>, [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 215 | parent_queue: &mut Vec<&'a KdNode>, [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 216 | max: Option, [INFO] [stdout] 217 | ) -> Vec<(&KdNode, f64)> { [INFO] [stdout] | ^^^^^^^^^^ the same 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: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 217 | ) -> Vec<(&'a KdNode, f64)> { [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s [INFO] running `Command { std: "docker" "inspect" "4384b8f9b3eb3e5e3746271387e7f8bc47b449ed91bfd4bdcd6225d0946ce3c0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4384b8f9b3eb3e5e3746271387e7f8bc47b449ed91bfd4bdcd6225d0946ce3c0", kill_on_drop: false }` [INFO] [stdout] 4384b8f9b3eb3e5e3746271387e7f8bc47b449ed91bfd4bdcd6225d0946ce3c0