[INFO] cloning repository https://github.com/HaosGames/rust_pinecone [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/HaosGames/rust_pinecone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FHaosGames%2Frust_pinecone", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FHaosGames%2Frust_pinecone'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 231a97528730786307fbac5a6ad3bc3397bd9810 [INFO] linting HaosGames/rust_pinecone against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FHaosGames%2Frust_pinecone" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/HaosGames/rust_pinecone [INFO] finished tweaking git repo https://github.com/HaosGames/rust_pinecone [INFO] tweaked toml for git repo https://github.com/HaosGames/rust_pinecone written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/HaosGames/rust_pinecone 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/HaosGames/rust_pinecone already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded tracing-core v0.1.24 [INFO] [stderr] Downloaded ed25519-consensus v2.0.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] abe35ed63e75d9ed22dd228ee8214cccf050bf086cea66ababd4133d62216e6a [INFO] running `Command { std: "docker" "start" "-a" "abe35ed63e75d9ed22dd228ee8214cccf050bf086cea66ababd4133d62216e6a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "abe35ed63e75d9ed22dd228ee8214cccf050bf086cea66ababd4133d62216e6a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "abe35ed63e75d9ed22dd228ee8214cccf050bf086cea66ababd4133d62216e6a", kill_on_drop: false }` [INFO] [stdout] abe35ed63e75d9ed22dd228ee8214cccf050bf086cea66ababd4133d62216e6a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 8b2eb57febeac5ae01353eef2787a75be615b51fa92bb28bdbfcd635127fa968 [INFO] running `Command { std: "docker" "start" "-a" "8b2eb57febeac5ae01353eef2787a75be615b51fa92bb28bdbfcd635127fa968", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.36 [INFO] [stderr] Compiling libc v0.2.121 [INFO] [stderr] Compiling syn v1.0.90 [INFO] [stderr] Checking pin-project-lite v0.2.8 [INFO] [stderr] Compiling parking_lot_core v0.9.2 [INFO] [stderr] Compiling futures-channel v0.3.21 [INFO] [stderr] Compiling generic-array v0.14.5 [INFO] [stderr] Checking futures-io v0.3.21 [INFO] [stderr] Checking aho-corasick v0.7.18 [INFO] [stderr] Checking regex-syntax v0.6.25 [INFO] [stderr] Checking zeroize v1.5.4 [INFO] [stderr] Checking byteorder v1.4.3 [INFO] [stderr] Checking tracing-core v0.1.24 [INFO] [stderr] Checking subtle-ng v2.5.0 [INFO] [stderr] Checking fastrand v1.7.0 [INFO] [stderr] Compiling serde_json v1.0.79 [INFO] [stderr] Checking waker-fn v1.1.0 [INFO] [stderr] Checking parking v2.0.0 [INFO] [stderr] Checking hex v0.4.3 [INFO] [stderr] Checking futures-lite v1.12.0 [INFO] [stderr] Checking digest v0.9.0 [INFO] [stderr] Checking block-buffer v0.9.0 [INFO] [stderr] Checking sha2 v0.9.9 [INFO] [stderr] Checking getrandom v0.2.6 [INFO] [stderr] Checking num_cpus v1.13.1 [INFO] [stderr] Checking socket2 v0.4.4 [INFO] [stderr] Checking mio v0.8.2 [INFO] [stderr] Checking signal-hook-registry v1.4.0 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking regex v1.5.5 [INFO] [stderr] Compiling quote v1.0.17 [INFO] [stderr] Checking rand_core v0.6.3 [INFO] [stderr] Checking parking_lot v0.12.0 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking curve25519-dalek-ng v4.1.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking env_logger v0.9.0 [INFO] [stderr] Compiling futures-macro v0.3.21 [INFO] [stderr] Compiling serde_derive v1.0.136 [INFO] [stderr] Compiling tokio-macros v1.7.0 [INFO] [stderr] Compiling thiserror-impl v1.0.30 [INFO] [stderr] Compiling tracing-attributes v0.1.20 [INFO] [stderr] Checking tokio v1.17.0 [INFO] [stderr] Checking futures-util v0.3.21 [INFO] [stderr] Checking tracing v0.1.32 [INFO] [stderr] Checking thiserror v1.0.30 [INFO] [stderr] Checking serde v1.0.136 [INFO] [stderr] Checking tokio-util v0.7.1 [INFO] [stderr] Checking tokio-stream v0.1.8 [INFO] [stderr] Checking futures-executor v0.3.21 [INFO] [stderr] Checking futures v0.3.21 [INFO] [stderr] Checking ed25519-consensus v2.0.1 [INFO] [stderr] Checking rust_pinecone v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/connection.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | / return match self { [INFO] [stdout] 31 | | DownloadConnection::Tcp(stream) => stream.next().await, [INFO] [stdout] 32 | | #[cfg(test)] [INFO] [stdout] 33 | | DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] ... | [INFO] [stdout] 36 | | }, [INFO] [stdout] 37 | | }; [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] 30 ~ match self { [INFO] [stdout] 31 + DownloadConnection::Tcp(stream) => stream.next().await, [INFO] [stdout] 32 + #[cfg(test)] [INFO] [stdout] 33 + DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] 34 + None => None, [INFO] [stdout] 35 + Some(frame) => Some(Ok(frame)), [INFO] [stdout] 36 + }, [INFO] [stdout] 37 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/coordinates.rs:11:84 [INFO] [stdout] | [INFO] [stdout] 11 | self.coordinates.len() + to.coordinates.len() - 2 * self.get_common_prefix(&to) [INFO] [stdout] | ^^^ help: change this to: `to` [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: this `impl` can be derived [INFO] [stdout] --> src/coordinates.rs:34:1 [INFO] [stdout] | [INFO] [stdout] 34 | / impl Default for Coordinates { [INFO] [stdout] 35 | | fn default() -> Self { [INFO] [stdout] 36 | | Coordinates { [INFO] [stdout] 37 | | coordinates: vec![], [INFO] [stdout] ... | [INFO] [stdout] 40 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 5 + #[derive(Default)] [INFO] [stdout] 6 | pub(crate) struct Coordinates { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its scrutinee and body [INFO] [stdout] --> src/error.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / match e.kind() { [INFO] [stdout] 21 | | _ => RouterError::ConnectionClosed, [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using the scrutinee and body instead [INFO] [stdout] | [INFO] [stdout] 20 ~ e.kind(); [INFO] [stdout] 21 + RouterError::ConnectionClosed [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.signatures.get(0)` [INFO] [stdout] --> src/frames.rs:61:36 [INFO] [stdout] | [INFO] [stdout] 61 | if self.root.public_key != self.signatures.get(0).unwrap().signing_public_key { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.signatures.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: accessing last element with `self [INFO] [stdout] .signatures.get(self [INFO] [stdout] .signatures.len() - 1)` [INFO] [stdout] --> src/frames.rs:66:17 [INFO] [stdout] | [INFO] [stdout] 66 | != &self [INFO] [stdout] | _________________^ [INFO] [stdout] 67 | | .signatures [INFO] [stdout] 68 | | .get(self.signatures.len() - 1) [INFO] [stdout] | |_______________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len [INFO] [stdout] = note: `#[warn(clippy::get_last_with_len)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 66 ~ != &self [INFO] [stdout] 67 + .signatures.last() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | / if self.root.sequence_number < of.root.sequence_number { [INFO] [stdout] 127 | | true [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | false [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.sequence_number < of.root.sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | / if self.root.sequence_number == of.root.sequence_number { [INFO] [stdout] 135 | | true [INFO] [stdout] 136 | | } else { [INFO] [stdout] 137 | | false [INFO] [stdout] 138 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.sequence_number == of.root.sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | / if self.root.public_key == as_.root.public_key { [INFO] [stdout] 142 | | true [INFO] [stdout] 143 | | } else { [INFO] [stdout] 144 | | false [INFO] [stdout] 145 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.public_key == as_.root.public_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | upload_connections: Arc< [INFO] [stdout] | _________________________^ [INFO] [stdout] 46 | | RwLock< [INFO] [stdout] 47 | | HashMap< [INFO] [stdout] 48 | | PublicKey, [INFO] [stdout] ... | [INFO] [stdout] 51 | | >, [INFO] [stdout] 52 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:53:27 [INFO] [stdout] | [INFO] [stdout] 53 | download_connections: Arc< [INFO] [stdout] | ___________________________^ [INFO] [stdout] 54 | | RwLock< [INFO] [stdout] 55 | | HashMap< [INFO] [stdout] 56 | | PublicKey, [INFO] [stdout] ... | [INFO] [stdout] 59 | | >, [INFO] [stdout] 60 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / return match download.next().await { [INFO] [stdout] 182 | | Some(decoding_result) => match decoding_result { [INFO] [stdout] 183 | | Ok(Frame::TreeAnnouncement(ann)) => { [INFO] [stdout] 184 | | return if let Some(signature) = ann.signatures.last() { [INFO] [stdout] ... | [INFO] [stdout] 201 | | None => Err(RouterError::ConnectionClosed), [INFO] [stdout] 202 | | }; [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] 181 ~ match download.next().await { [INFO] [stdout] 182 + Some(decoding_result) => match decoding_result { [INFO] [stdout] 183 + Ok(Frame::TreeAnnouncement(ann)) => { [INFO] [stdout] 184 + return if let Some(signature) = ann.signatures.last() { [INFO] [stdout] 185 + let public_key = signature.signing_public_key; [INFO] [stdout] 186 + let mut ports = self.ports.write().await; [INFO] [stdout] 187 + ports.insert(port, Some(public_key)); [INFO] [stdout] 188 + drop(ports); [INFO] [stdout] 189 + self.add_peer(public_key, port, upload, download, false) [INFO] [stdout] 190 + .await; [INFO] [stdout] 191 + self.handle_frame(Frame::TreeAnnouncement(ann), public_key) [INFO] [stdout] 192 + .await?; [INFO] [stdout] 193 + Ok(public_key) [INFO] [stdout] 194 + } else { [INFO] [stdout] 195 + Err(RouterError::MissingSignature) [INFO] [stdout] 196 + } [INFO] [stdout] 197 + } [INFO] [stdout] 198 + Ok(_e) => Err(RouterError::InvalidFrame), [INFO] [stdout] 199 + Err(e) => Err(e), [INFO] [stdout] 200 + }, [INFO] [stdout] 201 + None => Err(RouterError::ConnectionClosed), [INFO] [stdout] 202 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:280:17 [INFO] [stdout] | [INFO] [stdout] 280 | socket: Arc> + Send + Unpin>>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/router.rs:289:13 [INFO] [stdout] | [INFO] [stdout] 289 | / if !ports.contains_key(&i) { [INFO] [stdout] 290 | | ports.insert(i, None); [INFO] [stdout] 291 | | return i; [INFO] [stdout] 292 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 289 ~ if let std::collections::hash_map::Entry::Vacant(e) = ports.entry(i) { [INFO] [stdout] 290 + e.insert(None); [INFO] [stdout] 291 + return i; [INFO] [stdout] 292 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/router.rs:371:21 [INFO] [stdout] | [INFO] [stdout] 371 | / if peer == &of { [INFO] [stdout] 372 | | return Some(*port); [INFO] [stdout] 373 | | } [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] 370 ~ Some(peer) [INFO] [stdout] 371 ~ if peer == &of => { [INFO] [stdout] 372 | return Some(*port); [INFO] [stdout] 373 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:464:9 [INFO] [stdout] | [INFO] [stdout] 464 | / return if let Some(socket) = socket { [INFO] [stdout] 465 | | trace!("Sending {:?}", frame); [INFO] [stdout] 466 | | let mut socket = socket.lock().await; [INFO] [stdout] 467 | | socket.send(frame).await [INFO] [stdout] ... | [INFO] [stdout] 471 | | Ok(()) [INFO] [stdout] 472 | | }; [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] 464 ~ if let Some(socket) = socket { [INFO] [stdout] 465 + trace!("Sending {:?}", frame); [INFO] [stdout] 466 + let mut socket = socket.lock().await; [INFO] [stdout] 467 + socket.send(frame).await [INFO] [stdout] 468 + } else { [INFO] [stdout] 469 + // Ignore frames that are sent to unknown peer [INFO] [stdout] 470 + debug!("No Socket for {:?}", to); [INFO] [stdout] 471 + Ok(()) [INFO] [stdout] 472 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `peer` [INFO] [stdout] --> src/router.rs:479:21 [INFO] [stdout] | [INFO] [stdout] 479 | let peer = peer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `peer` is initially defined here [INFO] [stdout] --> src/router.rs:478:29 [INFO] [stdout] | [INFO] [stdout] 478 | if let Some(peer) = self.next_tree_hop(&packet, from).await { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `peer` [INFO] [stdout] --> src/router.rs:489:21 [INFO] [stdout] | [INFO] [stdout] 489 | let peer = peer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `peer` is initially defined here [INFO] [stdout] --> src/router.rs:488:29 [INFO] [stdout] | [INFO] [stdout] 488 | if let Some(peer) = self.next_snek_hop(&packet, false, true).await { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:564:20 [INFO] [stdout] | [INFO] [stdout] 564 | if let None = self.tree_announcement(peer).await { [INFO] [stdout] | -------^^^^------------------------------------- help: try: `if self.tree_announcement(peer).await.is_none()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:670:17 [INFO] [stdout] | [INFO] [stdout] 670 | return; [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] 669 - self.reparent(true).await; [INFO] [stdout] 670 - return; [INFO] [stdout] 669 + self.reparent(true).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:698:17 [INFO] [stdout] | [INFO] [stdout] 698 | return; [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] 697 - self.reparent(false).await; [INFO] [stdout] 698 - return; [INFO] [stdout] 697 + self.reparent(false).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:620:13 [INFO] [stdout] | [INFO] [stdout] 620 | / if frame.has_same_root_key(&announcement) { [INFO] [stdout] 621 | | if frame.replayed_old_sequence(&announcement) { [INFO] [stdout] 622 | | debug!("Announcement replayed old sequence. Dropping"); [INFO] [stdout] 623 | | return; [INFO] [stdout] 624 | | } [INFO] [stdout] 625 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 620 ~ if frame.has_same_root_key(&announcement) [INFO] [stdout] 621 ~ && frame.replayed_old_sequence(&announcement) { [INFO] [stdout] 622 | debug!("Announcement replayed old sequence. Dropping"); [INFO] [stdout] 623 | return; [INFO] [stdout] 624 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:682:33 [INFO] [stdout] | [INFO] [stdout] 682 | self.set_parent(from.clone()).await; [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `from` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:779:9 [INFO] [stdout] | [INFO] [stdout] 779 | / return match best_peer { [INFO] [stdout] 780 | | Some(best_peer) => { [INFO] [stdout] 781 | | if best_peer == self.parent().await { [INFO] [stdout] 782 | | debug!("Current parent is the best available parent"); [INFO] [stdout] ... | [INFO] [stdout] 796 | | }; [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] 779 ~ match best_peer { [INFO] [stdout] 780 + Some(best_peer) => { [INFO] [stdout] 781 + if best_peer == self.parent().await { [INFO] [stdout] 782 + debug!("Current parent is the best available parent"); [INFO] [stdout] 783 + return false; [INFO] [stdout] 784 + } [INFO] [stdout] 785 + let best_peer = best_peer.clone(); [INFO] [stdout] 786 + self.set_parent(best_peer).await; [INFO] [stdout] 787 + self.send_tree_announcements_to_all(self.current_announcement().await) [INFO] [stdout] 788 + .await; [INFO] [stdout] 789 + true [INFO] [stdout] 790 + } [INFO] [stdout] 791 + None => { [INFO] [stdout] 792 + trace!("I am root"); [INFO] [stdout] 793 + self.become_root().await; [INFO] [stdout] 794 + false [INFO] [stdout] 795 + } [INFO] [stdout] 796 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:785:33 [INFO] [stdout] | [INFO] [stdout] 785 | let best_peer = best_peer.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `best_peer` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:800:25 [INFO] [stdout] | [INFO] [stdout] 800 | self.set_parent(self.public_key().clone()).await; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.public_key()` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1019:38 [INFO] [stdout] | [INFO] [stdout] 1019 | best_peer = Some(peer.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*peer` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1023:38 [INFO] [stdout] | [INFO] [stdout] 1023 | best_peer = Some(peer.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*peer` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:1183:17 [INFO] [stdout] | [INFO] [stdout] 1183 | return; [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] 1182 - debug!("No next tree hop for SnekSetup"); [INFO] [stdout] 1183 - return; [INFO] [stdout] 1182 + debug!("No next tree hop for SnekSetup"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/router.rs:1144:19 [INFO] [stdout] | [INFO] [stdout] 1144 | } else if None == *ascending_path { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `(*ascending_path).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1170:30 [INFO] [stdout] | [INFO] [stdout] 1170 | destination_key: ack.source_key.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ack.source_key` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1196:30 [INFO] [stdout] | [INFO] [stdout] 1196 | path_id: ack.path_id.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ack.path_id` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1203:34 [INFO] [stdout] | [INFO] [stdout] 1203 | destination: self.port(next_peer).await.unwrap().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port(next_peer).await.unwrap()` [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/router.rs:1269:23 [INFO] [stdout] | [INFO] [stdout] 1269 | } else if !(rx.source_key < self.public_key()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(rx.source_key >= self.public_key())` [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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:1300:27 [INFO] [stdout] | [INFO] [stdout] 1300 | } else if let None = *descending_path { [INFO] [stdout] | -------^^^^------------------- help: try: `if descending_path.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1334:25 [INFO] [stdout] | [INFO] [stdout] 1334 | source: from.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `from` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:1491:9 [INFO] [stdout] | [INFO] [stdout] 1491 | return vec![]; [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] 1491 - return vec![]; [INFO] [stdout] 1491 + vec![] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:1450:13 [INFO] [stdout] | [INFO] [stdout] 1450 | / if asc.index.public_key == path_key && asc.index.path_id == path_id { [INFO] [stdout] 1451 | | if from == asc.destination || from == 0 { [INFO] [stdout] 1452 | | trace!("Removing ascending path."); [INFO] [stdout] 1453 | | paths.remove(&asc.index); [INFO] [stdout] ... | [INFO] [stdout] 1457 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1450 ~ if asc.index.public_key == path_key && asc.index.path_id == path_id [INFO] [stdout] 1451 ~ && (from == asc.destination || from == 0) { [INFO] [stdout] 1452 | trace!("Removing ascending path."); [INFO] [stdout] ... [INFO] [stdout] 1455 | return vec![asc.destination]; [INFO] [stdout] 1456 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:1460:13 [INFO] [stdout] | [INFO] [stdout] 1460 | / if desc.index.public_key == path_key && desc.index.path_id == path_id { [INFO] [stdout] 1461 | | if from == desc.destination || from == 0 { [INFO] [stdout] 1462 | | trace!("Removing descending path."); [INFO] [stdout] 1463 | | paths.remove(&desc.index); [INFO] [stdout] ... | [INFO] [stdout] 1467 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1460 ~ if desc.index.public_key == path_key && desc.index.path_id == path_id [INFO] [stdout] 1461 ~ && (from == desc.destination || from == 0) { [INFO] [stdout] 1462 | trace!("Removing descending path."); [INFO] [stdout] ... [INFO] [stdout] 1465 | return vec![desc.destination]; [INFO] [stdout] 1466 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/router.rs:1469:29 [INFO] [stdout] | [INFO] [stdout] 1469 | for (key, value) in paths.to_owned() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `paths.iter().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/tree.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | / impl PartialOrd for Root { [INFO] [stdout] 14 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 15 | | let key = self.public_key.cmp(&other.public_key); [INFO] [stdout] 16 | | if key != Ordering::Equal { [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 15 - let key = self.public_key.cmp(&other.public_key); [INFO] [stdout] 16 - if key != Ordering::Equal { [INFO] [stdout] 17 - return Some(key); [INFO] [stdout] 18 - } else { [INFO] [stdout] 19 - let sequence = self.sequence_number.cmp(&other.sequence_number); [INFO] [stdout] 20 - Some(sequence) [INFO] [stdout] 21 - } [INFO] [stdout] 22 - } [INFO] [stdout] 14 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tree.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | return Some(key); [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] 17 - return Some(key); [INFO] [stdout] 17 + Some(key) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/wait_timer.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / if duration > self.duration { [INFO] [stdout] 19 | | true [INFO] [stdout] 20 | | } else { [INFO] [stdout] 21 | | false [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `duration > self.duration` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `key` [INFO] [stdout] --> src/wire_frame.rs:166:14 [INFO] [stdout] | [INFO] [stdout] 166 | for i in 0..32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 166 - for i in 0..32 { [INFO] [stdout] 166 + for in &mut key { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `sig` [INFO] [stdout] --> src/wire_frame.rs:173:14 [INFO] [stdout] | [INFO] [stdout] 173 | for i in 0..64 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 173 - for i in 0..64 { [INFO] [stdout] 173 + for in &mut sig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/connection.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | / return match self { [INFO] [stdout] 31 | | DownloadConnection::Tcp(stream) => stream.next().await, [INFO] [stdout] 32 | | #[cfg(test)] [INFO] [stdout] 33 | | DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] ... | [INFO] [stdout] 36 | | }, [INFO] [stdout] 37 | | }; [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] 30 ~ match self { [INFO] [stdout] 31 + DownloadConnection::Tcp(stream) => stream.next().await, [INFO] [stdout] 32 + #[cfg(test)] [INFO] [stdout] 33 + DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] 34 + None => None, [INFO] [stdout] 35 + Some(frame) => Some(Ok(frame)), [INFO] [stdout] 36 + }, [INFO] [stdout] 37 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/connection.rs:33:49 [INFO] [stdout] | [INFO] [stdout] 33 | DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 34 | | None => None, [INFO] [stdout] 35 | | Some(frame) => Some(Ok(frame)), [INFO] [stdout] 36 | | }, [INFO] [stdout] | |_____________^ help: try: `stream.recv().await.map(Ok)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/coordinates.rs:11:84 [INFO] [stdout] | [INFO] [stdout] 11 | self.coordinates.len() + to.coordinates.len() - 2 * self.get_common_prefix(&to) [INFO] [stdout] | ^^^ help: change this to: `to` [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: this `impl` can be derived [INFO] [stdout] --> src/coordinates.rs:34:1 [INFO] [stdout] | [INFO] [stdout] 34 | / impl Default for Coordinates { [INFO] [stdout] 35 | | fn default() -> Self { [INFO] [stdout] 36 | | Coordinates { [INFO] [stdout] 37 | | coordinates: vec![], [INFO] [stdout] ... | [INFO] [stdout] 40 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 5 + #[derive(Default)] [INFO] [stdout] 6 | pub(crate) struct Coordinates { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its scrutinee and body [INFO] [stdout] --> src/error.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / match e.kind() { [INFO] [stdout] 21 | | _ => RouterError::ConnectionClosed, [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using the scrutinee and body instead [INFO] [stdout] | [INFO] [stdout] 20 ~ e.kind(); [INFO] [stdout] 21 + RouterError::ConnectionClosed [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.signatures.get(0)` [INFO] [stdout] --> src/frames.rs:61:36 [INFO] [stdout] | [INFO] [stdout] 61 | if self.root.public_key != self.signatures.get(0).unwrap().signing_public_key { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.signatures.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: accessing last element with `self [INFO] [stdout] .signatures.get(self [INFO] [stdout] .signatures.len() - 1)` [INFO] [stdout] --> src/frames.rs:66:17 [INFO] [stdout] | [INFO] [stdout] 66 | != &self [INFO] [stdout] | _________________^ [INFO] [stdout] 67 | | .signatures [INFO] [stdout] 68 | | .get(self.signatures.len() - 1) [INFO] [stdout] | |_______________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len [INFO] [stdout] = note: `#[warn(clippy::get_last_with_len)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 66 ~ != &self [INFO] [stdout] 67 + .signatures.last() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | / if self.root.sequence_number < of.root.sequence_number { [INFO] [stdout] 127 | | true [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | false [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.sequence_number < of.root.sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | / if self.root.sequence_number == of.root.sequence_number { [INFO] [stdout] 135 | | true [INFO] [stdout] 136 | | } else { [INFO] [stdout] 137 | | false [INFO] [stdout] 138 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.sequence_number == of.root.sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | / if self.root.public_key == as_.root.public_key { [INFO] [stdout] 142 | | true [INFO] [stdout] 143 | | } else { [INFO] [stdout] 144 | | false [INFO] [stdout] 145 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.public_key == as_.root.public_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | upload_connections: Arc< [INFO] [stdout] | _________________________^ [INFO] [stdout] 46 | | RwLock< [INFO] [stdout] 47 | | HashMap< [INFO] [stdout] 48 | | PublicKey, [INFO] [stdout] ... | [INFO] [stdout] 51 | | >, [INFO] [stdout] 52 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:53:27 [INFO] [stdout] | [INFO] [stdout] 53 | download_connections: Arc< [INFO] [stdout] | ___________________________^ [INFO] [stdout] 54 | | RwLock< [INFO] [stdout] 55 | | HashMap< [INFO] [stdout] 56 | | PublicKey, [INFO] [stdout] ... | [INFO] [stdout] 59 | | >, [INFO] [stdout] 60 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / return match download.next().await { [INFO] [stdout] 182 | | Some(decoding_result) => match decoding_result { [INFO] [stdout] 183 | | Ok(Frame::TreeAnnouncement(ann)) => { [INFO] [stdout] 184 | | return if let Some(signature) = ann.signatures.last() { [INFO] [stdout] ... | [INFO] [stdout] 201 | | None => Err(RouterError::ConnectionClosed), [INFO] [stdout] 202 | | }; [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] 181 ~ match download.next().await { [INFO] [stdout] 182 + Some(decoding_result) => match decoding_result { [INFO] [stdout] 183 + Ok(Frame::TreeAnnouncement(ann)) => { [INFO] [stdout] 184 + return if let Some(signature) = ann.signatures.last() { [INFO] [stdout] 185 + let public_key = signature.signing_public_key; [INFO] [stdout] 186 + let mut ports = self.ports.write().await; [INFO] [stdout] 187 + ports.insert(port, Some(public_key)); [INFO] [stdout] 188 + drop(ports); [INFO] [stdout] 189 + self.add_peer(public_key, port, upload, download, false) [INFO] [stdout] 190 + .await; [INFO] [stdout] 191 + self.handle_frame(Frame::TreeAnnouncement(ann), public_key) [INFO] [stdout] 192 + .await?; [INFO] [stdout] 193 + Ok(public_key) [INFO] [stdout] 194 + } else { [INFO] [stdout] 195 + Err(RouterError::MissingSignature) [INFO] [stdout] 196 + } [INFO] [stdout] 197 + } [INFO] [stdout] 198 + Ok(_e) => Err(RouterError::InvalidFrame), [INFO] [stdout] 199 + Err(e) => Err(e), [INFO] [stdout] 200 + }, [INFO] [stdout] 201 + None => Err(RouterError::ConnectionClosed), [INFO] [stdout] 202 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:280:17 [INFO] [stdout] | [INFO] [stdout] 280 | socket: Arc> + Send + Unpin>>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/router.rs:289:13 [INFO] [stdout] | [INFO] [stdout] 289 | / if !ports.contains_key(&i) { [INFO] [stdout] 290 | | ports.insert(i, None); [INFO] [stdout] 291 | | return i; [INFO] [stdout] 292 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 289 ~ if let std::collections::hash_map::Entry::Vacant(e) = ports.entry(i) { [INFO] [stdout] 290 + e.insert(None); [INFO] [stdout] 291 + return i; [INFO] [stdout] 292 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/router.rs:371:21 [INFO] [stdout] | [INFO] [stdout] 371 | / if peer == &of { [INFO] [stdout] 372 | | return Some(*port); [INFO] [stdout] 373 | | } [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] 370 ~ Some(peer) [INFO] [stdout] 371 ~ if peer == &of => { [INFO] [stdout] 372 | return Some(*port); [INFO] [stdout] 373 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:464:9 [INFO] [stdout] | [INFO] [stdout] 464 | / return if let Some(socket) = socket { [INFO] [stdout] 465 | | trace!("Sending {:?}", frame); [INFO] [stdout] 466 | | let mut socket = socket.lock().await; [INFO] [stdout] 467 | | socket.send(frame).await [INFO] [stdout] ... | [INFO] [stdout] 471 | | Ok(()) [INFO] [stdout] 472 | | }; [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] 464 ~ if let Some(socket) = socket { [INFO] [stdout] 465 + trace!("Sending {:?}", frame); [INFO] [stdout] 466 + let mut socket = socket.lock().await; [INFO] [stdout] 467 + socket.send(frame).await [INFO] [stdout] 468 + } else { [INFO] [stdout] 469 + // Ignore frames that are sent to unknown peer [INFO] [stdout] 470 + debug!("No Socket for {:?}", to); [INFO] [stdout] 471 + Ok(()) [INFO] [stdout] 472 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `peer` [INFO] [stdout] --> src/router.rs:479:21 [INFO] [stdout] | [INFO] [stdout] 479 | let peer = peer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `peer` is initially defined here [INFO] [stdout] --> src/router.rs:478:29 [INFO] [stdout] | [INFO] [stdout] 478 | if let Some(peer) = self.next_tree_hop(&packet, from).await { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `peer` [INFO] [stdout] --> src/router.rs:489:21 [INFO] [stdout] | [INFO] [stdout] 489 | let peer = peer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `peer` is initially defined here [INFO] [stdout] --> src/router.rs:488:29 [INFO] [stdout] | [INFO] [stdout] 488 | if let Some(peer) = self.next_snek_hop(&packet, false, true).await { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:564:20 [INFO] [stdout] | [INFO] [stdout] 564 | if let None = self.tree_announcement(peer).await { [INFO] [stdout] | -------^^^^------------------------------------- help: try: `if self.tree_announcement(peer).await.is_none()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:670:17 [INFO] [stdout] | [INFO] [stdout] 670 | return; [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] 669 - self.reparent(true).await; [INFO] [stdout] 670 - return; [INFO] [stdout] 669 + self.reparent(true).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:698:17 [INFO] [stdout] | [INFO] [stdout] 698 | return; [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] 697 - self.reparent(false).await; [INFO] [stdout] 698 - return; [INFO] [stdout] 697 + self.reparent(false).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:620:13 [INFO] [stdout] | [INFO] [stdout] 620 | / if frame.has_same_root_key(&announcement) { [INFO] [stdout] 621 | | if frame.replayed_old_sequence(&announcement) { [INFO] [stdout] 622 | | debug!("Announcement replayed old sequence. Dropping"); [INFO] [stdout] 623 | | return; [INFO] [stdout] 624 | | } [INFO] [stdout] 625 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 620 ~ if frame.has_same_root_key(&announcement) [INFO] [stdout] 621 ~ && frame.replayed_old_sequence(&announcement) { [INFO] [stdout] 622 | debug!("Announcement replayed old sequence. Dropping"); [INFO] [stdout] 623 | return; [INFO] [stdout] 624 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:682:33 [INFO] [stdout] | [INFO] [stdout] 682 | self.set_parent(from.clone()).await; [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `from` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:779:9 [INFO] [stdout] | [INFO] [stdout] 779 | / return match best_peer { [INFO] [stdout] 780 | | Some(best_peer) => { [INFO] [stdout] 781 | | if best_peer == self.parent().await { [INFO] [stdout] 782 | | debug!("Current parent is the best available parent"); [INFO] [stdout] ... | [INFO] [stdout] 796 | | }; [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] 779 ~ match best_peer { [INFO] [stdout] 780 + Some(best_peer) => { [INFO] [stdout] 781 + if best_peer == self.parent().await { [INFO] [stdout] 782 + debug!("Current parent is the best available parent"); [INFO] [stdout] 783 + return false; [INFO] [stdout] 784 + } [INFO] [stdout] 785 + let best_peer = best_peer.clone(); [INFO] [stdout] 786 + self.set_parent(best_peer).await; [INFO] [stdout] 787 + self.send_tree_announcements_to_all(self.current_announcement().await) [INFO] [stdout] 788 + .await; [INFO] [stdout] 789 + true [INFO] [stdout] 790 + } [INFO] [stdout] 791 + None => { [INFO] [stdout] 792 + trace!("I am root"); [INFO] [stdout] 793 + self.become_root().await; [INFO] [stdout] 794 + false [INFO] [stdout] 795 + } [INFO] [stdout] 796 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:785:33 [INFO] [stdout] | [INFO] [stdout] 785 | let best_peer = best_peer.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `best_peer` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:800:25 [INFO] [stdout] | [INFO] [stdout] 800 | self.set_parent(self.public_key().clone()).await; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.public_key()` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1019:38 [INFO] [stdout] | [INFO] [stdout] 1019 | best_peer = Some(peer.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*peer` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1023:38 [INFO] [stdout] | [INFO] [stdout] 1023 | best_peer = Some(peer.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*peer` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:1183:17 [INFO] [stdout] | [INFO] [stdout] 1183 | return; [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] 1182 - debug!("No next tree hop for SnekSetup"); [INFO] [stdout] 1183 - return; [INFO] [stdout] 1182 + debug!("No next tree hop for SnekSetup"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/router.rs:1144:19 [INFO] [stdout] | [INFO] [stdout] 1144 | } else if None == *ascending_path { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `(*ascending_path).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1170:30 [INFO] [stdout] | [INFO] [stdout] 1170 | destination_key: ack.source_key.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ack.source_key` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1196:30 [INFO] [stdout] | [INFO] [stdout] 1196 | path_id: ack.path_id.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ack.path_id` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1203:34 [INFO] [stdout] | [INFO] [stdout] 1203 | destination: self.port(next_peer).await.unwrap().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port(next_peer).await.unwrap()` [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/router.rs:1269:23 [INFO] [stdout] | [INFO] [stdout] 1269 | } else if !(rx.source_key < self.public_key()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(rx.source_key >= self.public_key())` [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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:1300:27 [INFO] [stdout] | [INFO] [stdout] 1300 | } else if let None = *descending_path { [INFO] [stdout] | -------^^^^------------------- help: try: `if descending_path.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1334:25 [INFO] [stdout] | [INFO] [stdout] 1334 | source: from.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `from` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:1491:9 [INFO] [stdout] | [INFO] [stdout] 1491 | return vec![]; [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] 1491 - return vec![]; [INFO] [stdout] 1491 + vec![] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:1450:13 [INFO] [stdout] | [INFO] [stdout] 1450 | / if asc.index.public_key == path_key && asc.index.path_id == path_id { [INFO] [stdout] 1451 | | if from == asc.destination || from == 0 { [INFO] [stdout] 1452 | | trace!("Removing ascending path."); [INFO] [stdout] 1453 | | paths.remove(&asc.index); [INFO] [stdout] ... | [INFO] [stdout] 1457 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1450 ~ if asc.index.public_key == path_key && asc.index.path_id == path_id [INFO] [stdout] 1451 ~ && (from == asc.destination || from == 0) { [INFO] [stdout] 1452 | trace!("Removing ascending path."); [INFO] [stdout] ... [INFO] [stdout] 1455 | return vec![asc.destination]; [INFO] [stdout] 1456 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:1460:13 [INFO] [stdout] | [INFO] [stdout] 1460 | / if desc.index.public_key == path_key && desc.index.path_id == path_id { [INFO] [stdout] 1461 | | if from == desc.destination || from == 0 { [INFO] [stdout] 1462 | | trace!("Removing descending path."); [INFO] [stdout] 1463 | | paths.remove(&desc.index); [INFO] [stdout] ... | [INFO] [stdout] 1467 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1460 ~ if desc.index.public_key == path_key && desc.index.path_id == path_id [INFO] [stdout] 1461 ~ && (from == desc.destination || from == 0) { [INFO] [stdout] 1462 | trace!("Removing descending path."); [INFO] [stdout] ... [INFO] [stdout] 1465 | return vec![desc.destination]; [INFO] [stdout] 1466 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/router.rs:1469:29 [INFO] [stdout] | [INFO] [stdout] 1469 | for (key, value) in paths.to_owned() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `paths.iter().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1598:28 [INFO] [stdout] | [INFO] [stdout] 1598 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1599:28 [INFO] [stdout] | [INFO] [stdout] 1599 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1644:28 [INFO] [stdout] | [INFO] [stdout] 1644 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1645:28 [INFO] [stdout] | [INFO] [stdout] 1645 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1690:28 [INFO] [stdout] | [INFO] [stdout] 1690 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1691:28 [INFO] [stdout] | [INFO] [stdout] 1691 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1777:28 [INFO] [stdout] | [INFO] [stdout] 1777 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1778:28 [INFO] [stdout] | [INFO] [stdout] 1778 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1808:28 [INFO] [stdout] | [INFO] [stdout] 1808 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1809:28 [INFO] [stdout] | [INFO] [stdout] 1809 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:1998:16 [INFO] [stdout] | [INFO] [stdout] 1998 | if let None = frame { [INFO] [stdout] | -------^^^^-------- help: try: `if frame.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/tree.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | / impl PartialOrd for Root { [INFO] [stdout] 14 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 15 | | let key = self.public_key.cmp(&other.public_key); [INFO] [stdout] 16 | | if key != Ordering::Equal { [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 15 - let key = self.public_key.cmp(&other.public_key); [INFO] [stdout] 16 - if key != Ordering::Equal { [INFO] [stdout] 17 - return Some(key); [INFO] [stdout] 18 - } else { [INFO] [stdout] 19 - let sequence = self.sequence_number.cmp(&other.sequence_number); [INFO] [stdout] 20 - Some(sequence) [INFO] [stdout] 21 - } [INFO] [stdout] 22 - } [INFO] [stdout] 14 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tree.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | return Some(key); [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] 17 - return Some(key); [INFO] [stdout] 17 + Some(key) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/wait_timer.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / if duration > self.duration { [INFO] [stdout] 19 | | true [INFO] [stdout] 20 | | } else { [INFO] [stdout] 21 | | false [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `duration > self.duration` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `key` [INFO] [stdout] --> src/wire_frame.rs:166:14 [INFO] [stdout] | [INFO] [stdout] 166 | for i in 0..32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 166 - for i in 0..32 { [INFO] [stdout] 166 + for in &mut key { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `sig` [INFO] [stdout] --> src/wire_frame.rs:173:14 [INFO] [stdout] | [INFO] [stdout] 173 | for i in 0..64 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 173 - for i in 0..64 { [INFO] [stdout] 173 + for in &mut sig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/error.rs:9:19 [INFO] [stdout] | [INFO] [stdout] 9 | DecodingError(&'static str), [INFO] [stdout] | ------------- ^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `RouterError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 9 - DecodingError(&'static str), [INFO] [stdout] 9 + DecodingError(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/error.rs:10:19 [INFO] [stdout] | [INFO] [stdout] 10 | EncodingError(&'static str), [INFO] [stdout] | ------------- ^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `RouterError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 10 - EncodingError(&'static str), [INFO] [stdout] 10 + EncodingError(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/connection.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | / return match self { [INFO] [stdout] 31 | | DownloadConnection::Tcp(stream) => stream.next().await, [INFO] [stdout] 32 | | #[cfg(test)] [INFO] [stdout] 33 | | DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] ... | [INFO] [stdout] 36 | | }, [INFO] [stdout] 37 | | }; [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] 30 ~ match self { [INFO] [stdout] 31 + DownloadConnection::Tcp(stream) => stream.next().await, [INFO] [stdout] 32 + #[cfg(test)] [INFO] [stdout] 33 + DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] 34 + None => None, [INFO] [stdout] 35 + Some(frame) => Some(Ok(frame)), [INFO] [stdout] 36 + }, [INFO] [stdout] 37 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/coordinates.rs:11:84 [INFO] [stdout] | [INFO] [stdout] 11 | self.coordinates.len() + to.coordinates.len() - 2 * self.get_common_prefix(&to) [INFO] [stdout] | ^^^ help: change this to: `to` [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: this `impl` can be derived [INFO] [stdout] --> src/coordinates.rs:34:1 [INFO] [stdout] | [INFO] [stdout] 34 | / impl Default for Coordinates { [INFO] [stdout] 35 | | fn default() -> Self { [INFO] [stdout] 36 | | Coordinates { [INFO] [stdout] 37 | | coordinates: vec![], [INFO] [stdout] ... | [INFO] [stdout] 40 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 5 + #[derive(Default)] [INFO] [stdout] 6 | pub(crate) struct Coordinates { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its scrutinee and body [INFO] [stdout] --> src/error.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / match e.kind() { [INFO] [stdout] 21 | | _ => RouterError::ConnectionClosed, [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using the scrutinee and body instead [INFO] [stdout] | [INFO] [stdout] 20 ~ e.kind(); [INFO] [stdout] 21 + RouterError::ConnectionClosed [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.signatures.get(0)` [INFO] [stdout] --> src/frames.rs:61:36 [INFO] [stdout] | [INFO] [stdout] 61 | if self.root.public_key != self.signatures.get(0).unwrap().signing_public_key { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.signatures.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: accessing last element with `self [INFO] [stdout] .signatures.get(self [INFO] [stdout] .signatures.len() - 1)` [INFO] [stdout] --> src/frames.rs:66:17 [INFO] [stdout] | [INFO] [stdout] 66 | != &self [INFO] [stdout] | _________________^ [INFO] [stdout] 67 | | .signatures [INFO] [stdout] 68 | | .get(self.signatures.len() - 1) [INFO] [stdout] | |_______________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len [INFO] [stdout] = note: `#[warn(clippy::get_last_with_len)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 66 ~ != &self [INFO] [stdout] 67 + .signatures.last() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | / if self.root.sequence_number < of.root.sequence_number { [INFO] [stdout] 127 | | true [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | false [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.sequence_number < of.root.sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | / if self.root.sequence_number == of.root.sequence_number { [INFO] [stdout] 135 | | true [INFO] [stdout] 136 | | } else { [INFO] [stdout] 137 | | false [INFO] [stdout] 138 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.sequence_number == of.root.sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | / if self.root.public_key == as_.root.public_key { [INFO] [stdout] 142 | | true [INFO] [stdout] 143 | | } else { [INFO] [stdout] 144 | | false [INFO] [stdout] 145 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.public_key == as_.root.public_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | upload_connections: Arc< [INFO] [stdout] | _________________________^ [INFO] [stdout] 46 | | RwLock< [INFO] [stdout] 47 | | HashMap< [INFO] [stdout] 48 | | PublicKey, [INFO] [stdout] ... | [INFO] [stdout] 51 | | >, [INFO] [stdout] 52 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:53:27 [INFO] [stdout] | [INFO] [stdout] 53 | download_connections: Arc< [INFO] [stdout] | ___________________________^ [INFO] [stdout] 54 | | RwLock< [INFO] [stdout] 55 | | HashMap< [INFO] [stdout] 56 | | PublicKey, [INFO] [stdout] ... | [INFO] [stdout] 59 | | >, [INFO] [stdout] 60 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/error.rs:9:19 [INFO] [stdout] | [INFO] [stdout] 9 | DecodingError(&'static str), [INFO] [stdout] | ------------- ^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `RouterError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 9 - DecodingError(&'static str), [INFO] [stdout] 9 + DecodingError(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/error.rs:10:19 [INFO] [stdout] | [INFO] [stdout] 10 | EncodingError(&'static str), [INFO] [stdout] | ------------- ^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `RouterError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 10 - EncodingError(&'static str), [INFO] [stdout] 10 + EncodingError(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / return match download.next().await { [INFO] [stdout] 182 | | Some(decoding_result) => match decoding_result { [INFO] [stdout] 183 | | Ok(Frame::TreeAnnouncement(ann)) => { [INFO] [stdout] 184 | | return if let Some(signature) = ann.signatures.last() { [INFO] [stdout] ... | [INFO] [stdout] 201 | | None => Err(RouterError::ConnectionClosed), [INFO] [stdout] 202 | | }; [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] 181 ~ match download.next().await { [INFO] [stdout] 182 + Some(decoding_result) => match decoding_result { [INFO] [stdout] 183 + Ok(Frame::TreeAnnouncement(ann)) => { [INFO] [stdout] 184 + return if let Some(signature) = ann.signatures.last() { [INFO] [stdout] 185 + let public_key = signature.signing_public_key; [INFO] [stdout] 186 + let mut ports = self.ports.write().await; [INFO] [stdout] 187 + ports.insert(port, Some(public_key)); [INFO] [stdout] 188 + drop(ports); [INFO] [stdout] 189 + self.add_peer(public_key, port, upload, download, false) [INFO] [stdout] 190 + .await; [INFO] [stdout] 191 + self.handle_frame(Frame::TreeAnnouncement(ann), public_key) [INFO] [stdout] 192 + .await?; [INFO] [stdout] 193 + Ok(public_key) [INFO] [stdout] 194 + } else { [INFO] [stdout] 195 + Err(RouterError::MissingSignature) [INFO] [stdout] 196 + } [INFO] [stdout] 197 + } [INFO] [stdout] 198 + Ok(_e) => Err(RouterError::InvalidFrame), [INFO] [stdout] 199 + Err(e) => Err(e), [INFO] [stdout] 200 + }, [INFO] [stdout] 201 + None => Err(RouterError::ConnectionClosed), [INFO] [stdout] 202 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:280:17 [INFO] [stdout] | [INFO] [stdout] 280 | socket: Arc> + Send + Unpin>>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/connection.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | / return match self { [INFO] [stdout] 31 | | DownloadConnection::Tcp(stream) => stream.next().await, [INFO] [stdout] 32 | | #[cfg(test)] [INFO] [stdout] 33 | | DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] ... | [INFO] [stdout] 36 | | }, [INFO] [stdout] 37 | | }; [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] 30 ~ match self { [INFO] [stdout] 31 + DownloadConnection::Tcp(stream) => stream.next().await, [INFO] [stdout] 32 + #[cfg(test)] [INFO] [stdout] 33 + DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] 34 + None => None, [INFO] [stdout] 35 + Some(frame) => Some(Ok(frame)), [INFO] [stdout] 36 + }, [INFO] [stdout] 37 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/connection.rs:33:49 [INFO] [stdout] | [INFO] [stdout] 33 | DownloadConnection::Test(stream) => match stream.recv().await { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 34 | | None => None, [INFO] [stdout] 35 | | Some(frame) => Some(Ok(frame)), [INFO] [stdout] 36 | | }, [INFO] [stdout] | |_____________^ help: try: `stream.recv().await.map(Ok)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/router.rs:289:13 [INFO] [stdout] | [INFO] [stdout] 289 | / if !ports.contains_key(&i) { [INFO] [stdout] 290 | | ports.insert(i, None); [INFO] [stdout] 291 | | return i; [INFO] [stdout] 292 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 289 ~ if let std::collections::hash_map::Entry::Vacant(e) = ports.entry(i) { [INFO] [stdout] 290 + e.insert(None); [INFO] [stdout] 291 + return i; [INFO] [stdout] 292 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/coordinates.rs:11:84 [INFO] [stdout] | [INFO] [stdout] 11 | self.coordinates.len() + to.coordinates.len() - 2 * self.get_common_prefix(&to) [INFO] [stdout] | ^^^ help: change this to: `to` [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: this `impl` can be derived [INFO] [stdout] --> src/coordinates.rs:34:1 [INFO] [stdout] | [INFO] [stdout] 34 | / impl Default for Coordinates { [INFO] [stdout] 35 | | fn default() -> Self { [INFO] [stdout] 36 | | Coordinates { [INFO] [stdout] 37 | | coordinates: vec![], [INFO] [stdout] ... | [INFO] [stdout] 40 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 5 + #[derive(Default)] [INFO] [stdout] 6 | pub(crate) struct Coordinates { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its scrutinee and body [INFO] [stdout] --> src/error.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / match e.kind() { [INFO] [stdout] 21 | | _ => RouterError::ConnectionClosed, [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using the scrutinee and body instead [INFO] [stdout] | [INFO] [stdout] 20 ~ e.kind(); [INFO] [stdout] 21 + RouterError::ConnectionClosed [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/router.rs:371:21 [INFO] [stdout] | [INFO] [stdout] 371 | / if peer == &of { [INFO] [stdout] 372 | | return Some(*port); [INFO] [stdout] 373 | | } [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] 370 ~ Some(peer) [INFO] [stdout] 371 ~ if peer == &of => { [INFO] [stdout] 372 | return Some(*port); [INFO] [stdout] 373 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.signatures.get(0)` [INFO] [stdout] --> src/frames.rs:61:36 [INFO] [stdout] | [INFO] [stdout] 61 | if self.root.public_key != self.signatures.get(0).unwrap().signing_public_key { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.signatures.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: accessing last element with `self [INFO] [stdout] .signatures.get(self [INFO] [stdout] .signatures.len() - 1)` [INFO] [stdout] --> src/frames.rs:66:17 [INFO] [stdout] | [INFO] [stdout] 66 | != &self [INFO] [stdout] | _________________^ [INFO] [stdout] 67 | | .signatures [INFO] [stdout] 68 | | .get(self.signatures.len() - 1) [INFO] [stdout] | |_______________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len [INFO] [stdout] = note: `#[warn(clippy::get_last_with_len)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 66 ~ != &self [INFO] [stdout] 67 + .signatures.last() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:464:9 [INFO] [stdout] | [INFO] [stdout] 464 | / return if let Some(socket) = socket { [INFO] [stdout] 465 | | trace!("Sending {:?}", frame); [INFO] [stdout] 466 | | let mut socket = socket.lock().await; [INFO] [stdout] 467 | | socket.send(frame).await [INFO] [stdout] ... | [INFO] [stdout] 471 | | Ok(()) [INFO] [stdout] 472 | | }; [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] 464 ~ if let Some(socket) = socket { [INFO] [stdout] 465 + trace!("Sending {:?}", frame); [INFO] [stdout] 466 + let mut socket = socket.lock().await; [INFO] [stdout] 467 + socket.send(frame).await [INFO] [stdout] 468 + } else { [INFO] [stdout] 469 + // Ignore frames that are sent to unknown peer [INFO] [stdout] 470 + debug!("No Socket for {:?}", to); [INFO] [stdout] 471 + Ok(()) [INFO] [stdout] 472 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | / if self.root.sequence_number < of.root.sequence_number { [INFO] [stdout] 127 | | true [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | false [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.sequence_number < of.root.sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | / if self.root.sequence_number == of.root.sequence_number { [INFO] [stdout] 135 | | true [INFO] [stdout] 136 | | } else { [INFO] [stdout] 137 | | false [INFO] [stdout] 138 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.sequence_number == of.root.sequence_number` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/frames.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | / if self.root.public_key == as_.root.public_key { [INFO] [stdout] 142 | | true [INFO] [stdout] 143 | | } else { [INFO] [stdout] 144 | | false [INFO] [stdout] 145 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `self.root.public_key == as_.root.public_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `peer` [INFO] [stdout] --> src/router.rs:479:21 [INFO] [stdout] | [INFO] [stdout] 479 | let peer = peer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `peer` is initially defined here [INFO] [stdout] --> src/router.rs:478:29 [INFO] [stdout] | [INFO] [stdout] 478 | if let Some(peer) = self.next_tree_hop(&packet, from).await { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `peer` [INFO] [stdout] --> src/router.rs:489:21 [INFO] [stdout] | [INFO] [stdout] 489 | let peer = peer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `peer` is initially defined here [INFO] [stdout] --> src/router.rs:488:29 [INFO] [stdout] | [INFO] [stdout] 488 | if let Some(peer) = self.next_snek_hop(&packet, false, true).await { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | upload_connections: Arc< [INFO] [stdout] | _________________________^ [INFO] [stdout] 46 | | RwLock< [INFO] [stdout] 47 | | HashMap< [INFO] [stdout] 48 | | PublicKey, [INFO] [stdout] ... | [INFO] [stdout] 51 | | >, [INFO] [stdout] 52 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:53:27 [INFO] [stdout] | [INFO] [stdout] 53 | download_connections: Arc< [INFO] [stdout] | ___________________________^ [INFO] [stdout] 54 | | RwLock< [INFO] [stdout] 55 | | HashMap< [INFO] [stdout] 56 | | PublicKey, [INFO] [stdout] ... | [INFO] [stdout] 59 | | >, [INFO] [stdout] 60 | | >, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:564:20 [INFO] [stdout] | [INFO] [stdout] 564 | if let None = self.tree_announcement(peer).await { [INFO] [stdout] | -------^^^^------------------------------------- help: try: `if self.tree_announcement(peer).await.is_none()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:670:17 [INFO] [stdout] | [INFO] [stdout] 670 | return; [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] 669 - self.reparent(true).await; [INFO] [stdout] 670 - return; [INFO] [stdout] 669 + self.reparent(true).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:698:17 [INFO] [stdout] | [INFO] [stdout] 698 | return; [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] 697 - self.reparent(false).await; [INFO] [stdout] 698 - return; [INFO] [stdout] 697 + self.reparent(false).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / return match download.next().await { [INFO] [stdout] 182 | | Some(decoding_result) => match decoding_result { [INFO] [stdout] 183 | | Ok(Frame::TreeAnnouncement(ann)) => { [INFO] [stdout] 184 | | return if let Some(signature) = ann.signatures.last() { [INFO] [stdout] ... | [INFO] [stdout] 201 | | None => Err(RouterError::ConnectionClosed), [INFO] [stdout] 202 | | }; [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] 181 ~ match download.next().await { [INFO] [stdout] 182 + Some(decoding_result) => match decoding_result { [INFO] [stdout] 183 + Ok(Frame::TreeAnnouncement(ann)) => { [INFO] [stdout] 184 + return if let Some(signature) = ann.signatures.last() { [INFO] [stdout] 185 + let public_key = signature.signing_public_key; [INFO] [stdout] 186 + let mut ports = self.ports.write().await; [INFO] [stdout] 187 + ports.insert(port, Some(public_key)); [INFO] [stdout] 188 + drop(ports); [INFO] [stdout] 189 + self.add_peer(public_key, port, upload, download, false) [INFO] [stdout] 190 + .await; [INFO] [stdout] 191 + self.handle_frame(Frame::TreeAnnouncement(ann), public_key) [INFO] [stdout] 192 + .await?; [INFO] [stdout] 193 + Ok(public_key) [INFO] [stdout] 194 + } else { [INFO] [stdout] 195 + Err(RouterError::MissingSignature) [INFO] [stdout] 196 + } [INFO] [stdout] 197 + } [INFO] [stdout] 198 + Ok(_e) => Err(RouterError::InvalidFrame), [INFO] [stdout] 199 + Err(e) => Err(e), [INFO] [stdout] 200 + }, [INFO] [stdout] 201 + None => Err(RouterError::ConnectionClosed), [INFO] [stdout] 202 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:620:13 [INFO] [stdout] | [INFO] [stdout] 620 | / if frame.has_same_root_key(&announcement) { [INFO] [stdout] 621 | | if frame.replayed_old_sequence(&announcement) { [INFO] [stdout] 622 | | debug!("Announcement replayed old sequence. Dropping"); [INFO] [stdout] 623 | | return; [INFO] [stdout] 624 | | } [INFO] [stdout] 625 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 620 ~ if frame.has_same_root_key(&announcement) [INFO] [stdout] 621 ~ && frame.replayed_old_sequence(&announcement) { [INFO] [stdout] 622 | debug!("Announcement replayed old sequence. Dropping"); [INFO] [stdout] 623 | return; [INFO] [stdout] 624 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:682:33 [INFO] [stdout] | [INFO] [stdout] 682 | self.set_parent(from.clone()).await; [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `from` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/router.rs:280:17 [INFO] [stdout] | [INFO] [stdout] 280 | socket: Arc> + Send + Unpin>>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/router.rs:289:13 [INFO] [stdout] | [INFO] [stdout] 289 | / if !ports.contains_key(&i) { [INFO] [stdout] 290 | | ports.insert(i, None); [INFO] [stdout] 291 | | return i; [INFO] [stdout] 292 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 289 ~ if let std::collections::hash_map::Entry::Vacant(e) = ports.entry(i) { [INFO] [stdout] 290 + e.insert(None); [INFO] [stdout] 291 + return i; [INFO] [stdout] 292 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:779:9 [INFO] [stdout] | [INFO] [stdout] 779 | / return match best_peer { [INFO] [stdout] 780 | | Some(best_peer) => { [INFO] [stdout] 781 | | if best_peer == self.parent().await { [INFO] [stdout] 782 | | debug!("Current parent is the best available parent"); [INFO] [stdout] ... | [INFO] [stdout] 796 | | }; [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] 779 ~ match best_peer { [INFO] [stdout] 780 + Some(best_peer) => { [INFO] [stdout] 781 + if best_peer == self.parent().await { [INFO] [stdout] 782 + debug!("Current parent is the best available parent"); [INFO] [stdout] 783 + return false; [INFO] [stdout] 784 + } [INFO] [stdout] 785 + let best_peer = best_peer.clone(); [INFO] [stdout] 786 + self.set_parent(best_peer).await; [INFO] [stdout] 787 + self.send_tree_announcements_to_all(self.current_announcement().await) [INFO] [stdout] 788 + .await; [INFO] [stdout] 789 + true [INFO] [stdout] 790 + } [INFO] [stdout] 791 + None => { [INFO] [stdout] 792 + trace!("I am root"); [INFO] [stdout] 793 + self.become_root().await; [INFO] [stdout] 794 + false [INFO] [stdout] 795 + } [INFO] [stdout] 796 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/router.rs:371:21 [INFO] [stdout] | [INFO] [stdout] 371 | / if peer == &of { [INFO] [stdout] 372 | | return Some(*port); [INFO] [stdout] 373 | | } [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] 370 ~ Some(peer) [INFO] [stdout] 371 ~ if peer == &of => { [INFO] [stdout] 372 | return Some(*port); [INFO] [stdout] 373 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:785:33 [INFO] [stdout] | [INFO] [stdout] 785 | let best_peer = best_peer.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `best_peer` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:800:25 [INFO] [stdout] | [INFO] [stdout] 800 | self.set_parent(self.public_key().clone()).await; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.public_key()` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:464:9 [INFO] [stdout] | [INFO] [stdout] 464 | / return if let Some(socket) = socket { [INFO] [stdout] 465 | | trace!("Sending {:?}", frame); [INFO] [stdout] 466 | | let mut socket = socket.lock().await; [INFO] [stdout] 467 | | socket.send(frame).await [INFO] [stdout] ... | [INFO] [stdout] 471 | | Ok(()) [INFO] [stdout] 472 | | }; [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] 464 ~ if let Some(socket) = socket { [INFO] [stdout] 465 + trace!("Sending {:?}", frame); [INFO] [stdout] 466 + let mut socket = socket.lock().await; [INFO] [stdout] 467 + socket.send(frame).await [INFO] [stdout] 468 + } else { [INFO] [stdout] 469 + // Ignore frames that are sent to unknown peer [INFO] [stdout] 470 + debug!("No Socket for {:?}", to); [INFO] [stdout] 471 + Ok(()) [INFO] [stdout] 472 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `peer` [INFO] [stdout] --> src/router.rs:479:21 [INFO] [stdout] | [INFO] [stdout] 479 | let peer = peer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `peer` is initially defined here [INFO] [stdout] --> src/router.rs:478:29 [INFO] [stdout] | [INFO] [stdout] 478 | if let Some(peer) = self.next_tree_hop(&packet, from).await { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `peer` [INFO] [stdout] --> src/router.rs:489:21 [INFO] [stdout] | [INFO] [stdout] 489 | let peer = peer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `peer` is initially defined here [INFO] [stdout] --> src/router.rs:488:29 [INFO] [stdout] | [INFO] [stdout] 488 | if let Some(peer) = self.next_snek_hop(&packet, false, true).await { [INFO] [stdout] | ^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:564:20 [INFO] [stdout] | [INFO] [stdout] 564 | if let None = self.tree_announcement(peer).await { [INFO] [stdout] | -------^^^^------------------------------------- help: try: `if self.tree_announcement(peer).await.is_none()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:670:17 [INFO] [stdout] | [INFO] [stdout] 670 | return; [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] 669 - self.reparent(true).await; [INFO] [stdout] 670 - return; [INFO] [stdout] 669 + self.reparent(true).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:698:17 [INFO] [stdout] | [INFO] [stdout] 698 | return; [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] 697 - self.reparent(false).await; [INFO] [stdout] 698 - return; [INFO] [stdout] 697 + self.reparent(false).await; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1019:38 [INFO] [stdout] | [INFO] [stdout] 1019 | best_peer = Some(peer.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*peer` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1023:38 [INFO] [stdout] | [INFO] [stdout] 1023 | best_peer = Some(peer.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*peer` [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 `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:620:13 [INFO] [stdout] | [INFO] [stdout] 620 | / if frame.has_same_root_key(&announcement) { [INFO] [stdout] 621 | | if frame.replayed_old_sequence(&announcement) { [INFO] [stdout] 622 | | debug!("Announcement replayed old sequence. Dropping"); [INFO] [stdout] 623 | | return; [INFO] [stdout] 624 | | } [INFO] [stdout] 625 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 620 ~ if frame.has_same_root_key(&announcement) [INFO] [stdout] 621 ~ && frame.replayed_old_sequence(&announcement) { [INFO] [stdout] 622 | debug!("Announcement replayed old sequence. Dropping"); [INFO] [stdout] 623 | return; [INFO] [stdout] 624 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:1183:17 [INFO] [stdout] | [INFO] [stdout] 1183 | return; [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] 1182 - debug!("No next tree hop for SnekSetup"); [INFO] [stdout] 1183 - return; [INFO] [stdout] 1182 + debug!("No next tree hop for SnekSetup"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:682:33 [INFO] [stdout] | [INFO] [stdout] 682 | self.set_parent(from.clone()).await; [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `from` [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: binary comparison to literal `Option::None` [INFO] [stdout] --> src/router.rs:1144:19 [INFO] [stdout] | [INFO] [stdout] 1144 | } else if None == *ascending_path { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `(*ascending_path).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1170:30 [INFO] [stdout] | [INFO] [stdout] 1170 | destination_key: ack.source_key.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ack.source_key` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1196:30 [INFO] [stdout] | [INFO] [stdout] 1196 | path_id: ack.path_id.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ack.path_id` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1203:34 [INFO] [stdout] | [INFO] [stdout] 1203 | destination: self.port(next_peer).await.unwrap().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port(next_peer).await.unwrap()` [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/router.rs:1269:23 [INFO] [stdout] | [INFO] [stdout] 1269 | } else if !(rx.source_key < self.public_key()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(rx.source_key >= self.public_key())` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:779:9 [INFO] [stdout] | [INFO] [stdout] 779 | / return match best_peer { [INFO] [stdout] 780 | | Some(best_peer) => { [INFO] [stdout] 781 | | if best_peer == self.parent().await { [INFO] [stdout] 782 | | debug!("Current parent is the best available parent"); [INFO] [stdout] ... | [INFO] [stdout] 796 | | }; [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] 779 ~ match best_peer { [INFO] [stdout] 780 + Some(best_peer) => { [INFO] [stdout] 781 + if best_peer == self.parent().await { [INFO] [stdout] 782 + debug!("Current parent is the best available parent"); [INFO] [stdout] 783 + return false; [INFO] [stdout] 784 + } [INFO] [stdout] 785 + let best_peer = best_peer.clone(); [INFO] [stdout] 786 + self.set_parent(best_peer).await; [INFO] [stdout] 787 + self.send_tree_announcements_to_all(self.current_announcement().await) [INFO] [stdout] 788 + .await; [INFO] [stdout] 789 + true [INFO] [stdout] 790 + } [INFO] [stdout] 791 + None => { [INFO] [stdout] 792 + trace!("I am root"); [INFO] [stdout] 793 + self.become_root().await; [INFO] [stdout] 794 + false [INFO] [stdout] 795 + } [INFO] [stdout] 796 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:785:33 [INFO] [stdout] | [INFO] [stdout] 785 | let best_peer = best_peer.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `best_peer` [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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:1300:27 [INFO] [stdout] | [INFO] [stdout] 1300 | } else if let None = *descending_path { [INFO] [stdout] | -------^^^^------------------- help: try: `if descending_path.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:800:25 [INFO] [stdout] | [INFO] [stdout] 800 | self.set_parent(self.public_key().clone()).await; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.public_key()` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1334:25 [INFO] [stdout] | [INFO] [stdout] 1334 | source: from.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `from` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:1491:9 [INFO] [stdout] | [INFO] [stdout] 1491 | return vec![]; [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] 1491 - return vec![]; [INFO] [stdout] 1491 + vec![] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:1450:13 [INFO] [stdout] | [INFO] [stdout] 1450 | / if asc.index.public_key == path_key && asc.index.path_id == path_id { [INFO] [stdout] 1451 | | if from == asc.destination || from == 0 { [INFO] [stdout] 1452 | | trace!("Removing ascending path."); [INFO] [stdout] 1453 | | paths.remove(&asc.index); [INFO] [stdout] ... | [INFO] [stdout] 1457 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1450 ~ if asc.index.public_key == path_key && asc.index.path_id == path_id [INFO] [stdout] 1451 ~ && (from == asc.destination || from == 0) { [INFO] [stdout] 1452 | trace!("Removing ascending path."); [INFO] [stdout] ... [INFO] [stdout] 1455 | return vec![asc.destination]; [INFO] [stdout] 1456 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:1460:13 [INFO] [stdout] | [INFO] [stdout] 1460 | / if desc.index.public_key == path_key && desc.index.path_id == path_id { [INFO] [stdout] 1461 | | if from == desc.destination || from == 0 { [INFO] [stdout] 1462 | | trace!("Removing descending path."); [INFO] [stdout] 1463 | | paths.remove(&desc.index); [INFO] [stdout] ... | [INFO] [stdout] 1467 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1460 ~ if desc.index.public_key == path_key && desc.index.path_id == path_id [INFO] [stdout] 1461 ~ && (from == desc.destination || from == 0) { [INFO] [stdout] 1462 | trace!("Removing descending path."); [INFO] [stdout] ... [INFO] [stdout] 1465 | return vec![desc.destination]; [INFO] [stdout] 1466 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/router.rs:1469:29 [INFO] [stdout] | [INFO] [stdout] 1469 | for (key, value) in paths.to_owned() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `paths.iter().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1019:38 [INFO] [stdout] | [INFO] [stdout] 1019 | best_peer = Some(peer.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*peer` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1023:38 [INFO] [stdout] | [INFO] [stdout] 1023 | best_peer = Some(peer.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*peer` [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: unneeded `return` statement [INFO] [stdout] --> src/router.rs:1183:17 [INFO] [stdout] | [INFO] [stdout] 1183 | return; [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] 1182 - debug!("No next tree hop for SnekSetup"); [INFO] [stdout] 1183 - return; [INFO] [stdout] 1182 + debug!("No next tree hop for SnekSetup"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/router.rs:1144:19 [INFO] [stdout] | [INFO] [stdout] 1144 | } else if None == *ascending_path { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `(*ascending_path).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1170:30 [INFO] [stdout] | [INFO] [stdout] 1170 | destination_key: ack.source_key.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ack.source_key` [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: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/tree.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | / impl PartialOrd for Root { [INFO] [stdout] 14 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 15 | | let key = self.public_key.cmp(&other.public_key); [INFO] [stdout] 16 | | if key != Ordering::Equal { [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 15 - let key = self.public_key.cmp(&other.public_key); [INFO] [stdout] 16 - if key != Ordering::Equal { [INFO] [stdout] 17 - return Some(key); [INFO] [stdout] 18 - } else { [INFO] [stdout] 19 - let sequence = self.sequence_number.cmp(&other.sequence_number); [INFO] [stdout] 20 - Some(sequence) [INFO] [stdout] 21 - } [INFO] [stdout] 22 - } [INFO] [stdout] 14 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tree.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | return Some(key); [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] 17 - return Some(key); [INFO] [stdout] 17 + Some(key) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1196:30 [INFO] [stdout] | [INFO] [stdout] 1196 | path_id: ack.path_id.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `ack.path_id` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1203:34 [INFO] [stdout] | [INFO] [stdout] 1203 | destination: self.port(next_peer).await.unwrap().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.port(next_peer).await.unwrap()` [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 if-then-else expression returns a bool literal [INFO] [stdout] --> src/wait_timer.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / if duration > self.duration { [INFO] [stdout] 19 | | true [INFO] [stdout] 20 | | } else { [INFO] [stdout] 21 | | false [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `duration > self.duration` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/router.rs:1269:23 [INFO] [stdout] | [INFO] [stdout] 1269 | } else if !(rx.source_key < self.public_key()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(rx.source_key >= self.public_key())` [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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:1300:27 [INFO] [stdout] | [INFO] [stdout] 1300 | } else if let None = *descending_path { [INFO] [stdout] | -------^^^^------------------- help: try: `if descending_path.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `key` [INFO] [stdout] --> src/wire_frame.rs:166:14 [INFO] [stdout] | [INFO] [stdout] 166 | for i in 0..32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 166 - for i in 0..32 { [INFO] [stdout] 166 + for in &mut key { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `sig` [INFO] [stdout] --> src/wire_frame.rs:173:14 [INFO] [stdout] | [INFO] [stdout] 173 | for i in 0..64 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 173 - for i in 0..64 { [INFO] [stdout] 173 + for in &mut sig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/router.rs:1334:25 [INFO] [stdout] | [INFO] [stdout] 1334 | source: from.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `from` [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 let-binding has unit value [INFO] [stdout] --> src/main.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / let _ = env_logger::builder() [INFO] [stdout] 28 | | .write_style(WriteStyle::Always) [INFO] [stdout] 29 | | .format_timestamp(None) [INFO] [stdout] 30 | | .filter_level(LevelFilter::Debug) [INFO] [stdout] 31 | | //.filter_module("rust_pinecone", LevelFilter::Trace) [INFO] [stdout] 32 | | .init(); [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 27 - let _ = env_logger::builder() [INFO] [stdout] 27 + env_logger::builder() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/router.rs:1491:9 [INFO] [stdout] | [INFO] [stdout] 1491 | return vec![]; [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] 1491 - return vec![]; [INFO] [stdout] 1491 + vec![] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:1450:13 [INFO] [stdout] | [INFO] [stdout] 1450 | / if asc.index.public_key == path_key && asc.index.path_id == path_id { [INFO] [stdout] 1451 | | if from == asc.destination || from == 0 { [INFO] [stdout] 1452 | | trace!("Removing ascending path."); [INFO] [stdout] 1453 | | paths.remove(&asc.index); [INFO] [stdout] ... | [INFO] [stdout] 1457 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1450 ~ if asc.index.public_key == path_key && asc.index.path_id == path_id [INFO] [stdout] 1451 ~ && (from == asc.destination || from == 0) { [INFO] [stdout] 1452 | trace!("Removing ascending path."); [INFO] [stdout] ... [INFO] [stdout] 1455 | return vec![asc.destination]; [INFO] [stdout] 1456 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/router.rs:1460:13 [INFO] [stdout] | [INFO] [stdout] 1460 | / if desc.index.public_key == path_key && desc.index.path_id == path_id { [INFO] [stdout] 1461 | | if from == desc.destination || from == 0 { [INFO] [stdout] 1462 | | trace!("Removing descending path."); [INFO] [stdout] 1463 | | paths.remove(&desc.index); [INFO] [stdout] ... | [INFO] [stdout] 1467 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1460 ~ if desc.index.public_key == path_key && desc.index.path_id == path_id [INFO] [stdout] 1461 ~ && (from == desc.destination || from == 0) { [INFO] [stdout] 1462 | trace!("Removing descending path."); [INFO] [stdout] ... [INFO] [stdout] 1465 | return vec![desc.destination]; [INFO] [stdout] 1466 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/router.rs:1469:29 [INFO] [stdout] | [INFO] [stdout] 1469 | for (key, value) in paths.to_owned() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `paths.iter().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1598:28 [INFO] [stdout] | [INFO] [stdout] 1598 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1599:28 [INFO] [stdout] | [INFO] [stdout] 1599 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1644:28 [INFO] [stdout] | [INFO] [stdout] 1644 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1645:28 [INFO] [stdout] | [INFO] [stdout] 1645 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1690:28 [INFO] [stdout] | [INFO] [stdout] 1690 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1691:28 [INFO] [stdout] | [INFO] [stdout] 1691 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1777:28 [INFO] [stdout] | [INFO] [stdout] 1777 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1778:28 [INFO] [stdout] | [INFO] [stdout] 1778 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1808:28 [INFO] [stdout] | [INFO] [stdout] 1808 | assert_eq!(ann.signatures.get(0).unwrap().signing_public_key, pub2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: accessing first element with `ann.signatures.get(0)` [INFO] [stdout] --> src/router.rs:1809:28 [INFO] [stdout] | [INFO] [stdout] 1809 | assert_eq!(ann.signatures.get(0).unwrap().destination_port, 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `ann.signatures.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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/router.rs:1998:16 [INFO] [stdout] | [INFO] [stdout] 1998 | if let None = frame { [INFO] [stdout] | -------^^^^-------- help: try: `if frame.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/tree.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | / impl PartialOrd for Root { [INFO] [stdout] 14 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 15 | | let key = self.public_key.cmp(&other.public_key); [INFO] [stdout] 16 | | if key != Ordering::Equal { [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 15 - let key = self.public_key.cmp(&other.public_key); [INFO] [stdout] 16 - if key != Ordering::Equal { [INFO] [stdout] 17 - return Some(key); [INFO] [stdout] 18 - } else { [INFO] [stdout] 19 - let sequence = self.sequence_number.cmp(&other.sequence_number); [INFO] [stdout] 20 - Some(sequence) [INFO] [stdout] 21 - } [INFO] [stdout] 22 - } [INFO] [stdout] 14 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/tree.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | return Some(key); [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] 17 - return Some(key); [INFO] [stdout] 17 + Some(key) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/wait_timer.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / if duration > self.duration { [INFO] [stdout] 19 | | true [INFO] [stdout] 20 | | } else { [INFO] [stdout] 21 | | false [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `duration > self.duration` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `key` [INFO] [stdout] --> src/wire_frame.rs:166:14 [INFO] [stdout] | [INFO] [stdout] 166 | for i in 0..32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 166 - for i in 0..32 { [INFO] [stdout] 166 + for in &mut key { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `sig` [INFO] [stdout] --> src/wire_frame.rs:173:14 [INFO] [stdout] | [INFO] [stdout] 173 | for i in 0..64 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 173 - for i in 0..64 { [INFO] [stdout] 173 + for in &mut sig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/main.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | / let _ = env_logger::builder() [INFO] [stdout] 28 | | .write_style(WriteStyle::Always) [INFO] [stdout] 29 | | .format_timestamp(None) [INFO] [stdout] 30 | | .filter_level(LevelFilter::Debug) [INFO] [stdout] 31 | | //.filter_module("rust_pinecone", LevelFilter::Trace) [INFO] [stdout] 32 | | .init(); [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 27 - let _ = env_logger::builder() [INFO] [stdout] 27 + env_logger::builder() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 22.85s [INFO] running `Command { std: "docker" "inspect" "8b2eb57febeac5ae01353eef2787a75be615b51fa92bb28bdbfcd635127fa968", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8b2eb57febeac5ae01353eef2787a75be615b51fa92bb28bdbfcd635127fa968", kill_on_drop: false }` [INFO] [stdout] 8b2eb57febeac5ae01353eef2787a75be615b51fa92bb28bdbfcd635127fa968