[INFO] cloning repository https://github.com/chakflying/CS3700-Project2 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/chakflying/CS3700-Project2" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fchakflying%2FCS3700-Project2", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fchakflying%2FCS3700-Project2'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 751ac703120ea0aac28245675b799ad55ff69535 [INFO] linting chakflying/CS3700-Project2 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fchakflying%2FCS3700-Project2" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/chakflying/CS3700-Project2 [INFO] finished tweaking git repo https://github.com/chakflying/CS3700-Project2 [INFO] tweaked toml for git repo https://github.com/chakflying/CS3700-Project2 written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/chakflying/CS3700-Project2 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/chakflying/CS3700-Project2 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Updating git repository `https://github.com/dkl/unix-socket` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded proc-macro2 v1.0.4 [INFO] [stderr] Downloaded env_logger v0.7.0 [INFO] [stderr] Downloaded ipnet v2.0.0 [INFO] [stderr] Downloaded cute v0.3.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 5cf3345a4404d059e92dc9906a08b9828a8e49c32a7e7175b81a30c293506040 [INFO] running `Command { std: "docker" "start" "-a" "5cf3345a4404d059e92dc9906a08b9828a8e49c32a7e7175b81a30c293506040", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "5cf3345a4404d059e92dc9906a08b9828a8e49c32a7e7175b81a30c293506040", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5cf3345a4404d059e92dc9906a08b9828a8e49c32a7e7175b81a30c293506040", kill_on_drop: false }` [INFO] [stdout] 5cf3345a4404d059e92dc9906a08b9828a8e49c32a7e7175b81a30c293506040 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 1074f837183dd263e3ced7c0819c85623dc586882e9cca050fbc02e37d87e571 [INFO] running `Command { std: "docker" "start" "-a" "1074f837183dd263e3ced7c0819c85623dc586882e9cca050fbc02e37d87e571", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.4 [INFO] [stderr] Compiling libc v0.2.62 [INFO] [stderr] Compiling memchr v2.2.1 [INFO] [stderr] Compiling syn v1.0.5 [INFO] [stderr] Compiling log v0.4.8 [INFO] [stderr] Compiling serde v1.0.101 [INFO] [stderr] Compiling bitflags v1.2.0 [INFO] [stderr] Compiling ryu v1.0.0 [INFO] [stderr] Checking regex-syntax v0.6.12 [INFO] [stderr] Checking unicode-width v0.1.6 [INFO] [stderr] Checking thread_local v0.3.6 [INFO] [stderr] Checking humantime v1.3.0 [INFO] [stderr] Checking itoa v0.4.4 [INFO] [stderr] Checking ipnet v2.0.0 [INFO] [stderr] Checking cute v0.3.0 [INFO] [stderr] Checking textwrap v0.11.0 [INFO] [stderr] Checking atty v0.2.13 [INFO] [stderr] Checking unix_socket v0.5.0 (https://github.com/dkl/unix-socket?branch=seqpacket#152a9f36) [INFO] [stderr] Compiling quote v1.0.2 [INFO] [stderr] Checking clap v2.33.0 [INFO] [stderr] Checking aho-corasick v0.7.6 [INFO] [stderr] Checking regex v1.3.1 [INFO] [stderr] Compiling serde_derive v1.0.101 [INFO] [stderr] Checking env_logger v0.7.0 [INFO] [stderr] Checking serde_json v1.0.40 [INFO] [stderr] Checking PROJECT2 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:38:45 [INFO] [stdout] | [INFO] [stdout] 38 | #[derive(PartialEq, Eq, Debug, Copy, Clone, Serialize, PartialOrd, Ord)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Serialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:110:10 [INFO] [stdout] | [INFO] [stdout] 110 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Serialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Deserialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:117:10 [INFO] [stdout] | [INFO] [stdout] 117 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Serialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:117:21 [INFO] [stdout] | [INFO] [stdout] 117 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Deserialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:127:10 [INFO] [stdout] | [INFO] [stdout] 127 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Serialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:127:21 [INFO] [stdout] | [INFO] [stdout] 127 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Deserialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:38:45 [INFO] [stdout] | [INFO] [stdout] 38 | #[derive(PartialEq, Eq, Debug, Copy, Clone, Serialize, PartialOrd, Ord)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Serialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:110:10 [INFO] [stdout] | [INFO] [stdout] 110 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Serialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Deserialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:117:10 [INFO] [stdout] | [INFO] [stdout] 117 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Serialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:117:21 [INFO] [stdout] | [INFO] [stdout] 117 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Deserialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:127:10 [INFO] [stdout] | [INFO] [stdout] 127 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Serialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `cargo-clippy` [INFO] [stdout] --> src/bin/router.rs:127:21 [INFO] [stdout] | [INFO] [stdout] 127 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = note: using a cfg inside a derive macro will use the cfgs from the destination crate and not the ones from the defining crate [INFO] [stdout] = help: try referring to `Deserialize` crate for guidance on how handle this unexpected cfg [INFO] [stdout] = help: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `IGP` contains a capitalized acronym [INFO] [stdout] --> src/bin/router.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | IGP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Igp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EGP` contains a capitalized acronym [INFO] [stdout] --> src/bin/router.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | EGP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Egp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `UNK` contains a capitalized acronym [INFO] [stdout] --> src/bin/router.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | UNK, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Unk` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/router.rs:147:18 [INFO] [stdout] | [INFO] [stdout] 147 | .expect(&format!("Error connecting to Unix socket {}.", self.ip)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Error connecting to Unix socket {}.", self.ip))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/bin/router.rs:169:25 [INFO] [stdout] | [INFO] [stdout] 169 | let count = match self.stream.recv(&mut buf) { [INFO] [stdout] | _________________________^ [INFO] [stdout] 170 | | Ok(c) => c, [INFO] [stdout] 171 | | Err(_err) => { [INFO] [stdout] ... | [INFO] [stdout] 175 | | }; [INFO] [stdout] | |_____________^ help: replace it with: `self.stream.recv(&mut buf).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/router.rs:225:33 [INFO] [stdout] | [INFO] [stdout] 225 | tx.send(packet).expect( [INFO] [stdout] | _________________________________^ [INFO] [stdout] 226 | | &format!("[{}] Error sending message back to main thread.", self.ip)[..], [INFO] [stdout] 227 | | ); [INFO] [stdout] | |_________________^ help: try: `unwrap_or_else(|_| panic!("{}", format!("[{}] Error sending message back to main thread.", self.ip)[..]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/router.rs:230:13 [INFO] [stdout] | [INFO] [stdout] 230 | / match rx.try_recv() { [INFO] [stdout] 231 | | Ok(msgjson) => { [INFO] [stdout] 232 | | debug!("[{}] Message to send: {}", self.ip, msgjson); [INFO] [stdout] 233 | | self.stream [INFO] [stdout] ... | [INFO] [stdout] 237 | | Err(_) => {} // Err(e) => debug!("[{}] Error when sending: {}", self.ip, e), [INFO] [stdout] 238 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 230 ~ if let Ok(msgjson) = rx.try_recv() { [INFO] [stdout] 231 + debug!("[{}] Message to send: {}", self.ip, msgjson); [INFO] [stdout] 232 + self.stream [INFO] [stdout] 233 + .send(msgjson.as_bytes()) [INFO] [stdout] 234 + .expect(&format!("[{}] Error when sending message", self.ip)[..]); [INFO] [stdout] 235 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/router.rs:235:26 [INFO] [stdout] | [INFO] [stdout] 235 | .expect(&format!("[{}] Error when sending message", self.ip)[..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{}", format!("[{}] Error when sending message", self.ip)[..]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/router.rs:243:45 [INFO] [stdout] | [INFO] [stdout] 243 | fn choose_route(dst: Ipv4Addr, route_table: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 243 - fn choose_route(dst: Ipv4Addr, route_table: &Vec) -> i32 { [INFO] [stdout] 243 + fn choose_route(dst: Ipv4Addr, route_table: &[RouteInfo]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/router.rs:257:15 [INFO] [stdout] | [INFO] [stdout] 257 | } else if potential_routes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `potential_routes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:261:26 [INFO] [stdout] | [INFO] [stdout] 261 | let max_prefix = prefixes.iter().max().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*prefixes.iter().max().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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:270:37 [INFO] [stdout] | [INFO] [stdout] 270 | let highestlocalprefs = localprefs.iter().max().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*localprefs.iter().max().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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:288:49 [INFO] [stdout] | [INFO] [stdout] 288 | let shortest_aspathlength = aspathlengths.iter().min().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*aspathlengths.iter().min().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: using `clone` on type `RouteOrgin` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:294:42 [INFO] [stdout] | [INFO] [stdout] 294 | let bestorigin = origins.iter().min().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*origins.iter().min().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: using `clone` on type `Ipv4Addr` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:300:49 [INFO] [stdout] | [INFO] [stdout] 300 | ... let minsrcaddress = srcaddresses.iter().min().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*srcaddresses.iter().min().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/bin/router.rs:388:24 [INFO] [stdout] | [INFO] [stdout] 388 | if !(other_route.neighbor == i [INFO] [stdout] | ________________________^ [INFO] [stdout] 389 | | && other_route.localpref == route.localpref [INFO] [stdout] 390 | | && other_route.selfOrigin == route.selfOrigin [INFO] [stdout] 391 | | && other_route.ASPath == route.ASPath [INFO] [stdout] 392 | | && other_route.origin == route.origin) [INFO] [stdout] 393 | | || !avaliable[roi] [INFO] [stdout] | |__________________________________________^ help: try: `!(other_route.neighbor == i && other_route.localpref == route.localpref && other_route.selfOrigin == route.selfOrigin && other_route.ASPath == route.ASPath && other_route.origin == route.origin && avaliable[roi])` [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: using `clone` on type `Ipv4Net` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:418:54 [INFO] [stdout] | [INFO] [stdout] 418 | ... Ipv4Net::aggregate(&vec![other_route.net.clone(), route.net.clone()]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `other_route.net` [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 `Ipv4Net` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:418:79 [INFO] [stdout] | [INFO] [stdout] 418 | ... Ipv4Net::aggregate(&vec![other_route.net.clone(), route.net.clone()]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `route.net` [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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/router.rs:429:20 [INFO] [stdout] | [INFO] [stdout] 429 | if pushed == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `!pushed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/router.rs:519:17 [INFO] [stdout] | [INFO] [stdout] 519 | / match received.msg { [INFO] [stdout] 520 | | PacketMsg::Update(x) => { [INFO] [stdout] 521 | | let netmask: u32 = x.netmask.into(); [INFO] [stdout] 522 | | let prefix: u8 = netmask.count_ones() as u8; [INFO] [stdout] ... | [INFO] [stdout] 569 | | _ => {} [INFO] [stdout] 570 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 519 ~ if let PacketMsg::Update(x) = received.msg { [INFO] [stdout] 520 + let netmask: u32 = x.netmask.into(); [INFO] [stdout] 521 + let prefix: u8 = netmask.count_ones() as u8; [INFO] [stdout] 522 + route_table.push(RouteInfo { [INFO] [stdout] 523 + src: received.src, [INFO] [stdout] 524 + neighbor: received.neighbor, [INFO] [stdout] 525 + net: Ipv4Net::new(x.network, prefix).unwrap(), [INFO] [stdout] 526 + localpref: x.localpref.clone(), [INFO] [stdout] 527 + selfOrigin: x.selfOrigin.clone(), [INFO] [stdout] 528 + ASPath: x.ASPath.clone(), [INFO] [stdout] 529 + origin: match x.origin.as_ref() { [INFO] [stdout] 530 + "IGP" => RouteOrgin::IGP, [INFO] [stdout] 531 + "EGP" => RouteOrgin::EGP, [INFO] [stdout] 532 + "UNK" => RouteOrgin::UNK, [INFO] [stdout] 533 + _ => RouteOrgin::UNK, [INFO] [stdout] 534 + }, [INFO] [stdout] 535 + }); [INFO] [stdout] 536 + route_table = aggregate_routes(neighbors.len(), route_table); [INFO] [stdout] 537 + [INFO] [stdout] 538 + for (i, nei) in neighbors.iter().enumerate() { [INFO] [stdout] 539 + if i == received.neighbor { [INFO] [stdout] 540 + continue; [INFO] [stdout] 541 + } [INFO] [stdout] 542 + if neighbors[received.neighbor].n_type == NeighborType::Cust [INFO] [stdout] 543 + || (neighbors[received.neighbor].n_type != NeighborType::Cust [INFO] [stdout] 544 + && nei.n_type == NeighborType::Cust) [INFO] [stdout] 545 + { [INFO] [stdout] 546 + debug!("[Main Thread] Forwarding update to neighbor [{}]", nei.ip); [INFO] [stdout] 547 + neighbors_senders[i] [INFO] [stdout] 548 + .send( [INFO] [stdout] 549 + json!({ [INFO] [stdout] 550 + "src": nei.ip.saturating_sub(1), [INFO] [stdout] 551 + "dst": nei.ip, [INFO] [stdout] 552 + "type": BGPPacketType::Update, [INFO] [stdout] 553 + "msg": { [INFO] [stdout] 554 + "network": x.network, [INFO] [stdout] 555 + "netmask": x.netmask, [INFO] [stdout] 556 + "localpref": x.localpref, [INFO] [stdout] 557 + "selfOrigin": x.selfOrigin, [INFO] [stdout] 558 + "ASPath": x.ASPath.clone(), [INFO] [stdout] 559 + "origin": x.origin, [INFO] [stdout] 560 + } [INFO] [stdout] 561 + }) [INFO] [stdout] 562 + .to_string(), [INFO] [stdout] 563 + ) [INFO] [stdout] 564 + .expect("[Main Thread] Error sending message to other thread"); [INFO] [stdout] 565 + } [INFO] [stdout] 566 + } [INFO] [stdout] 567 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/router.rs:576:17 [INFO] [stdout] | [INFO] [stdout] 576 | / match received.msg { [INFO] [stdout] 577 | | PacketMsg::Revoke(x) => { [INFO] [stdout] 578 | | route_table = revoke_routes(received.neighbor, x.clone(), route_table); [INFO] [stdout] 579 | | route_table = aggregate_routes(neighbors.len(), route_table); [INFO] [stdout] ... | [INFO] [stdout] 604 | | _ => {} [INFO] [stdout] 605 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 576 ~ if let PacketMsg::Revoke(x) = received.msg { [INFO] [stdout] 577 + route_table = revoke_routes(received.neighbor, x.clone(), route_table); [INFO] [stdout] 578 + route_table = aggregate_routes(neighbors.len(), route_table); [INFO] [stdout] 579 + [INFO] [stdout] 580 + for (i, nei) in neighbors.iter().enumerate() { [INFO] [stdout] 581 + if i == received.neighbor { [INFO] [stdout] 582 + continue; [INFO] [stdout] 583 + } [INFO] [stdout] 584 + if neighbors[received.neighbor].n_type == NeighborType::Cust [INFO] [stdout] 585 + || (neighbors[received.neighbor].n_type != NeighborType::Cust [INFO] [stdout] 586 + && nei.n_type == NeighborType::Cust) [INFO] [stdout] 587 + { [INFO] [stdout] 588 + debug!("[Main Thread] Forwarding revoke to neighbor [{}]", nei.ip); [INFO] [stdout] 589 + neighbors_senders[i] [INFO] [stdout] 590 + .send( [INFO] [stdout] 591 + json!({ [INFO] [stdout] 592 + "src": nei.ip.saturating_sub(1), [INFO] [stdout] 593 + "dst": nei.ip, [INFO] [stdout] 594 + "type": BGPPacketType::Revoke, [INFO] [stdout] 595 + "msg": x.clone() [INFO] [stdout] 596 + }) [INFO] [stdout] 597 + .to_string(), [INFO] [stdout] 598 + ) [INFO] [stdout] 599 + .expect("[Main Thread] Error sending message to other thread"); [INFO] [stdout] 600 + } [INFO] [stdout] 601 + } [INFO] [stdout] 602 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/router.rs:607:36 [INFO] [stdout] | [INFO] [stdout] 607 | BGPPacketType::Data => match received.msg { [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 608 | | PacketMsg::Data(msg) => { [INFO] [stdout] 609 | | let nei_no = choose_route(received.dst, &route_table); [INFO] [stdout] 610 | | if nei_no == -1 [INFO] [stdout] ... | [INFO] [stdout] 647 | | _ => {} [INFO] [stdout] 648 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 607 ~ BGPPacketType::Data => if let PacketMsg::Data(msg) = received.msg { [INFO] [stdout] 608 + let nei_no = choose_route(received.dst, &route_table); [INFO] [stdout] 609 + if nei_no == -1 [INFO] [stdout] 610 + || (neighbors[nei_no as usize].n_type != NeighborType::Cust [INFO] [stdout] 611 + && neighbors[received.neighbor].n_type != NeighborType::Cust) [INFO] [stdout] 612 + { [INFO] [stdout] 613 + debug!( [INFO] [stdout] 614 + "[Main Thread] Reporting no route to neighbor [{}]", [INFO] [stdout] 615 + &neighbors[received.neighbor].ip [INFO] [stdout] 616 + ); [INFO] [stdout] 617 + neighbors_senders[received.neighbor] [INFO] [stdout] 618 + .send( [INFO] [stdout] 619 + json!({ [INFO] [stdout] 620 + "src": neighbors[received.neighbor].ip.saturating_sub(1), [INFO] [stdout] 621 + "dst": received.src, [INFO] [stdout] 622 + "type": BGPPacketType::NoRoute, [INFO] [stdout] 623 + "msg": {}, [INFO] [stdout] 624 + }) [INFO] [stdout] 625 + .to_string(), [INFO] [stdout] 626 + ) [INFO] [stdout] 627 + .expect("[Main Thread] Error sending message to other thread"); [INFO] [stdout] 628 + } else { [INFO] [stdout] 629 + debug!( [INFO] [stdout] 630 + "[Main Thread] Forwarding data to neighbor [{}]", [INFO] [stdout] 631 + &neighbors[nei_no as usize].ip [INFO] [stdout] 632 + ); [INFO] [stdout] 633 + neighbors_senders[nei_no as usize] [INFO] [stdout] 634 + .send( [INFO] [stdout] 635 + json!({ [INFO] [stdout] 636 + "src": received.src, [INFO] [stdout] 637 + "dst": received.dst, [INFO] [stdout] 638 + "type": BGPPacketType::Data, [INFO] [stdout] 639 + "msg": msg, [INFO] [stdout] 640 + }) [INFO] [stdout] 641 + .to_string(), [INFO] [stdout] 642 + ) [INFO] [stdout] 643 + .expect("[Main Thread] Error sending message to other thread"); [INFO] [stdout] 644 + } [INFO] [stdout] 645 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `IGP` contains a capitalized acronym [INFO] [stdout] --> src/bin/router.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | IGP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Igp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EGP` contains a capitalized acronym [INFO] [stdout] --> src/bin/router.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | EGP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Egp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `UNK` contains a capitalized acronym [INFO] [stdout] --> src/bin/router.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | UNK, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Unk` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:38:45 [INFO] [stdout] | [INFO] [stdout] 38 | #[derive(PartialEq, Eq, Debug, Copy, Clone, Serialize, PartialOrd, Ord)] [INFO] [stdout] | ^-------- [INFO] [stdout] | | [INFO] [stdout] | `Serialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_RouteOrgin` [INFO] [stdout] 39 | enum RouteOrgin { [INFO] [stdout] | ---------- `RouteOrgin` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: `#[warn(non_local_definitions)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:110:10 [INFO] [stdout] | [INFO] [stdout] 110 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^-------- [INFO] [stdout] | | [INFO] [stdout] | `Serialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_RouteInfoJson` [INFO] [stdout] 111 | struct RouteInfoJson { [INFO] [stdout] | ------------- `RouteInfoJson` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^---------- [INFO] [stdout] | | [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_RouteInfoJson` [INFO] [stdout] 111 | struct RouteInfoJson { [INFO] [stdout] | ------------- `RouteInfoJson` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:117:10 [INFO] [stdout] | [INFO] [stdout] 117 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^-------- [INFO] [stdout] | | [INFO] [stdout] | `Serialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_RouteUpdateInfoJson` [INFO] [stdout] 118 | struct RouteUpdateInfoJson { [INFO] [stdout] | ------------------- `RouteUpdateInfoJson` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:117:21 [INFO] [stdout] | [INFO] [stdout] 117 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^---------- [INFO] [stdout] | | [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_RouteUpdateInfoJson` [INFO] [stdout] 118 | struct RouteUpdateInfoJson { [INFO] [stdout] | ------------------- `RouteUpdateInfoJson` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:127:10 [INFO] [stdout] | [INFO] [stdout] 127 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^-------- [INFO] [stdout] | | [INFO] [stdout] | `Serialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_MsgRevoke` [INFO] [stdout] 128 | struct MsgRevoke { [INFO] [stdout] | --------- `MsgRevoke` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:127:21 [INFO] [stdout] | [INFO] [stdout] 127 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^---------- [INFO] [stdout] | | [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_MsgRevoke` [INFO] [stdout] 128 | struct MsgRevoke { [INFO] [stdout] | --------- `MsgRevoke` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/router.rs:147:18 [INFO] [stdout] | [INFO] [stdout] 147 | .expect(&format!("Error connecting to Unix socket {}.", self.ip)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Error connecting to Unix socket {}.", self.ip))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/bin/router.rs:169:25 [INFO] [stdout] | [INFO] [stdout] 169 | let count = match self.stream.recv(&mut buf) { [INFO] [stdout] | _________________________^ [INFO] [stdout] 170 | | Ok(c) => c, [INFO] [stdout] 171 | | Err(_err) => { [INFO] [stdout] ... | [INFO] [stdout] 175 | | }; [INFO] [stdout] | |_____________^ help: replace it with: `self.stream.recv(&mut buf).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/router.rs:225:33 [INFO] [stdout] | [INFO] [stdout] 225 | tx.send(packet).expect( [INFO] [stdout] | _________________________________^ [INFO] [stdout] 226 | | &format!("[{}] Error sending message back to main thread.", self.ip)[..], [INFO] [stdout] 227 | | ); [INFO] [stdout] | |_________________^ help: try: `unwrap_or_else(|_| panic!("{}", format!("[{}] Error sending message back to main thread.", self.ip)[..]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/router.rs:230:13 [INFO] [stdout] | [INFO] [stdout] 230 | / match rx.try_recv() { [INFO] [stdout] 231 | | Ok(msgjson) => { [INFO] [stdout] 232 | | debug!("[{}] Message to send: {}", self.ip, msgjson); [INFO] [stdout] 233 | | self.stream [INFO] [stdout] ... | [INFO] [stdout] 237 | | Err(_) => {} // Err(e) => debug!("[{}] Error when sending: {}", self.ip, e), [INFO] [stdout] 238 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 230 ~ if let Ok(msgjson) = rx.try_recv() { [INFO] [stdout] 231 + debug!("[{}] Message to send: {}", self.ip, msgjson); [INFO] [stdout] 232 + self.stream [INFO] [stdout] 233 + .send(msgjson.as_bytes()) [INFO] [stdout] 234 + .expect(&format!("[{}] Error when sending message", self.ip)[..]); [INFO] [stdout] 235 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/router.rs:235:26 [INFO] [stdout] | [INFO] [stdout] 235 | .expect(&format!("[{}] Error when sending message", self.ip)[..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{}", format!("[{}] Error when sending message", self.ip)[..]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/router.rs:243:45 [INFO] [stdout] | [INFO] [stdout] 243 | fn choose_route(dst: Ipv4Addr, route_table: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 243 - fn choose_route(dst: Ipv4Addr, route_table: &Vec) -> i32 { [INFO] [stdout] 243 + fn choose_route(dst: Ipv4Addr, route_table: &[RouteInfo]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/router.rs:257:15 [INFO] [stdout] | [INFO] [stdout] 257 | } else if potential_routes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `potential_routes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:261:26 [INFO] [stdout] | [INFO] [stdout] 261 | let max_prefix = prefixes.iter().max().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*prefixes.iter().max().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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:270:37 [INFO] [stdout] | [INFO] [stdout] 270 | let highestlocalprefs = localprefs.iter().max().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*localprefs.iter().max().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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:288:49 [INFO] [stdout] | [INFO] [stdout] 288 | let shortest_aspathlength = aspathlengths.iter().min().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*aspathlengths.iter().min().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: using `clone` on type `RouteOrgin` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:294:42 [INFO] [stdout] | [INFO] [stdout] 294 | let bestorigin = origins.iter().min().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*origins.iter().min().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: using `clone` on type `Ipv4Addr` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:300:49 [INFO] [stdout] | [INFO] [stdout] 300 | ... let minsrcaddress = srcaddresses.iter().min().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*srcaddresses.iter().min().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/bin/router.rs:388:24 [INFO] [stdout] | [INFO] [stdout] 388 | if !(other_route.neighbor == i [INFO] [stdout] | ________________________^ [INFO] [stdout] 389 | | && other_route.localpref == route.localpref [INFO] [stdout] 390 | | && other_route.selfOrigin == route.selfOrigin [INFO] [stdout] 391 | | && other_route.ASPath == route.ASPath [INFO] [stdout] 392 | | && other_route.origin == route.origin) [INFO] [stdout] 393 | | || !avaliable[roi] [INFO] [stdout] | |__________________________________________^ help: try: `!(other_route.neighbor == i && other_route.localpref == route.localpref && other_route.selfOrigin == route.selfOrigin && other_route.ASPath == route.ASPath && other_route.origin == route.origin && avaliable[roi])` [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: using `clone` on type `Ipv4Net` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:418:54 [INFO] [stdout] | [INFO] [stdout] 418 | ... Ipv4Net::aggregate(&vec![other_route.net.clone(), route.net.clone()]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `other_route.net` [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 `Ipv4Net` which implements the `Copy` trait [INFO] [stdout] --> src/bin/router.rs:418:79 [INFO] [stdout] | [INFO] [stdout] 418 | ... Ipv4Net::aggregate(&vec![other_route.net.clone(), route.net.clone()]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `route.net` [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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/router.rs:429:20 [INFO] [stdout] | [INFO] [stdout] 429 | if pushed == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `!pushed` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/router.rs:519:17 [INFO] [stdout] | [INFO] [stdout] 519 | / match received.msg { [INFO] [stdout] 520 | | PacketMsg::Update(x) => { [INFO] [stdout] 521 | | let netmask: u32 = x.netmask.into(); [INFO] [stdout] 522 | | let prefix: u8 = netmask.count_ones() as u8; [INFO] [stdout] ... | [INFO] [stdout] 569 | | _ => {} [INFO] [stdout] 570 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 519 ~ if let PacketMsg::Update(x) = received.msg { [INFO] [stdout] 520 + let netmask: u32 = x.netmask.into(); [INFO] [stdout] 521 + let prefix: u8 = netmask.count_ones() as u8; [INFO] [stdout] 522 + route_table.push(RouteInfo { [INFO] [stdout] 523 + src: received.src, [INFO] [stdout] 524 + neighbor: received.neighbor, [INFO] [stdout] 525 + net: Ipv4Net::new(x.network, prefix).unwrap(), [INFO] [stdout] 526 + localpref: x.localpref.clone(), [INFO] [stdout] 527 + selfOrigin: x.selfOrigin.clone(), [INFO] [stdout] 528 + ASPath: x.ASPath.clone(), [INFO] [stdout] 529 + origin: match x.origin.as_ref() { [INFO] [stdout] 530 + "IGP" => RouteOrgin::IGP, [INFO] [stdout] 531 + "EGP" => RouteOrgin::EGP, [INFO] [stdout] 532 + "UNK" => RouteOrgin::UNK, [INFO] [stdout] 533 + _ => RouteOrgin::UNK, [INFO] [stdout] 534 + }, [INFO] [stdout] 535 + }); [INFO] [stdout] 536 + route_table = aggregate_routes(neighbors.len(), route_table); [INFO] [stdout] 537 + [INFO] [stdout] 538 + for (i, nei) in neighbors.iter().enumerate() { [INFO] [stdout] 539 + if i == received.neighbor { [INFO] [stdout] 540 + continue; [INFO] [stdout] 541 + } [INFO] [stdout] 542 + if neighbors[received.neighbor].n_type == NeighborType::Cust [INFO] [stdout] 543 + || (neighbors[received.neighbor].n_type != NeighborType::Cust [INFO] [stdout] 544 + && nei.n_type == NeighborType::Cust) [INFO] [stdout] 545 + { [INFO] [stdout] 546 + debug!("[Main Thread] Forwarding update to neighbor [{}]", nei.ip); [INFO] [stdout] 547 + neighbors_senders[i] [INFO] [stdout] 548 + .send( [INFO] [stdout] 549 + json!({ [INFO] [stdout] 550 + "src": nei.ip.saturating_sub(1), [INFO] [stdout] 551 + "dst": nei.ip, [INFO] [stdout] 552 + "type": BGPPacketType::Update, [INFO] [stdout] 553 + "msg": { [INFO] [stdout] 554 + "network": x.network, [INFO] [stdout] 555 + "netmask": x.netmask, [INFO] [stdout] 556 + "localpref": x.localpref, [INFO] [stdout] 557 + "selfOrigin": x.selfOrigin, [INFO] [stdout] 558 + "ASPath": x.ASPath.clone(), [INFO] [stdout] 559 + "origin": x.origin, [INFO] [stdout] 560 + } [INFO] [stdout] 561 + }) [INFO] [stdout] 562 + .to_string(), [INFO] [stdout] 563 + ) [INFO] [stdout] 564 + .expect("[Main Thread] Error sending message to other thread"); [INFO] [stdout] 565 + } [INFO] [stdout] 566 + } [INFO] [stdout] 567 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/router.rs:576:17 [INFO] [stdout] | [INFO] [stdout] 576 | / match received.msg { [INFO] [stdout] 577 | | PacketMsg::Revoke(x) => { [INFO] [stdout] 578 | | route_table = revoke_routes(received.neighbor, x.clone(), route_table); [INFO] [stdout] 579 | | route_table = aggregate_routes(neighbors.len(), route_table); [INFO] [stdout] ... | [INFO] [stdout] 604 | | _ => {} [INFO] [stdout] 605 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 576 ~ if let PacketMsg::Revoke(x) = received.msg { [INFO] [stdout] 577 + route_table = revoke_routes(received.neighbor, x.clone(), route_table); [INFO] [stdout] 578 + route_table = aggregate_routes(neighbors.len(), route_table); [INFO] [stdout] 579 + [INFO] [stdout] 580 + for (i, nei) in neighbors.iter().enumerate() { [INFO] [stdout] 581 + if i == received.neighbor { [INFO] [stdout] 582 + continue; [INFO] [stdout] 583 + } [INFO] [stdout] 584 + if neighbors[received.neighbor].n_type == NeighborType::Cust [INFO] [stdout] 585 + || (neighbors[received.neighbor].n_type != NeighborType::Cust [INFO] [stdout] 586 + && nei.n_type == NeighborType::Cust) [INFO] [stdout] 587 + { [INFO] [stdout] 588 + debug!("[Main Thread] Forwarding revoke to neighbor [{}]", nei.ip); [INFO] [stdout] 589 + neighbors_senders[i] [INFO] [stdout] 590 + .send( [INFO] [stdout] 591 + json!({ [INFO] [stdout] 592 + "src": nei.ip.saturating_sub(1), [INFO] [stdout] 593 + "dst": nei.ip, [INFO] [stdout] 594 + "type": BGPPacketType::Revoke, [INFO] [stdout] 595 + "msg": x.clone() [INFO] [stdout] 596 + }) [INFO] [stdout] 597 + .to_string(), [INFO] [stdout] 598 + ) [INFO] [stdout] 599 + .expect("[Main Thread] Error sending message to other thread"); [INFO] [stdout] 600 + } [INFO] [stdout] 601 + } [INFO] [stdout] 602 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/router.rs:607:36 [INFO] [stdout] | [INFO] [stdout] 607 | BGPPacketType::Data => match received.msg { [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 608 | | PacketMsg::Data(msg) => { [INFO] [stdout] 609 | | let nei_no = choose_route(received.dst, &route_table); [INFO] [stdout] 610 | | if nei_no == -1 [INFO] [stdout] ... | [INFO] [stdout] 647 | | _ => {} [INFO] [stdout] 648 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 607 ~ BGPPacketType::Data => if let PacketMsg::Data(msg) = received.msg { [INFO] [stdout] 608 + let nei_no = choose_route(received.dst, &route_table); [INFO] [stdout] 609 + if nei_no == -1 [INFO] [stdout] 610 + || (neighbors[nei_no as usize].n_type != NeighborType::Cust [INFO] [stdout] 611 + && neighbors[received.neighbor].n_type != NeighborType::Cust) [INFO] [stdout] 612 + { [INFO] [stdout] 613 + debug!( [INFO] [stdout] 614 + "[Main Thread] Reporting no route to neighbor [{}]", [INFO] [stdout] 615 + &neighbors[received.neighbor].ip [INFO] [stdout] 616 + ); [INFO] [stdout] 617 + neighbors_senders[received.neighbor] [INFO] [stdout] 618 + .send( [INFO] [stdout] 619 + json!({ [INFO] [stdout] 620 + "src": neighbors[received.neighbor].ip.saturating_sub(1), [INFO] [stdout] 621 + "dst": received.src, [INFO] [stdout] 622 + "type": BGPPacketType::NoRoute, [INFO] [stdout] 623 + "msg": {}, [INFO] [stdout] 624 + }) [INFO] [stdout] 625 + .to_string(), [INFO] [stdout] 626 + ) [INFO] [stdout] 627 + .expect("[Main Thread] Error sending message to other thread"); [INFO] [stdout] 628 + } else { [INFO] [stdout] 629 + debug!( [INFO] [stdout] 630 + "[Main Thread] Forwarding data to neighbor [{}]", [INFO] [stdout] 631 + &neighbors[nei_no as usize].ip [INFO] [stdout] 632 + ); [INFO] [stdout] 633 + neighbors_senders[nei_no as usize] [INFO] [stdout] 634 + .send( [INFO] [stdout] 635 + json!({ [INFO] [stdout] 636 + "src": received.src, [INFO] [stdout] 637 + "dst": received.dst, [INFO] [stdout] 638 + "type": BGPPacketType::Data, [INFO] [stdout] 639 + "msg": msg, [INFO] [stdout] 640 + }) [INFO] [stdout] 641 + .to_string(), [INFO] [stdout] 642 + ) [INFO] [stdout] 643 + .expect("[Main Thread] Error sending message to other thread"); [INFO] [stdout] 644 + } [INFO] [stdout] 645 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:38:45 [INFO] [stdout] | [INFO] [stdout] 38 | #[derive(PartialEq, Eq, Debug, Copy, Clone, Serialize, PartialOrd, Ord)] [INFO] [stdout] | ^-------- [INFO] [stdout] | | [INFO] [stdout] | `Serialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_RouteOrgin` [INFO] [stdout] 39 | enum RouteOrgin { [INFO] [stdout] | ---------- `RouteOrgin` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: `#[warn(non_local_definitions)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:110:10 [INFO] [stdout] | [INFO] [stdout] 110 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^-------- [INFO] [stdout] | | [INFO] [stdout] | `Serialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_RouteInfoJson` [INFO] [stdout] 111 | struct RouteInfoJson { [INFO] [stdout] | ------------- `RouteInfoJson` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^---------- [INFO] [stdout] | | [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_RouteInfoJson` [INFO] [stdout] 111 | struct RouteInfoJson { [INFO] [stdout] | ------------- `RouteInfoJson` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:117:10 [INFO] [stdout] | [INFO] [stdout] 117 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^-------- [INFO] [stdout] | | [INFO] [stdout] | `Serialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_RouteUpdateInfoJson` [INFO] [stdout] 118 | struct RouteUpdateInfoJson { [INFO] [stdout] | ------------------- `RouteUpdateInfoJson` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:117:21 [INFO] [stdout] | [INFO] [stdout] 117 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^---------- [INFO] [stdout] | | [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_RouteUpdateInfoJson` [INFO] [stdout] 118 | struct RouteUpdateInfoJson { [INFO] [stdout] | ------------------- `RouteUpdateInfoJson` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:127:10 [INFO] [stdout] | [INFO] [stdout] 127 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^-------- [INFO] [stdout] | | [INFO] [stdout] | `Serialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_SERIALIZE_FOR_MsgRevoke` [INFO] [stdout] 128 | struct MsgRevoke { [INFO] [stdout] | --------- `MsgRevoke` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Serialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Serialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/bin/router.rs:127:21 [INFO] [stdout] | [INFO] [stdout] 127 | #[derive(Serialize, Deserialize, Clone, Debug)] [INFO] [stdout] | ^---------- [INFO] [stdout] | | [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_MsgRevoke` [INFO] [stdout] 128 | struct MsgRevoke { [INFO] [stdout] | --------- `MsgRevoke` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 15.87s [INFO] running `Command { std: "docker" "inspect" "1074f837183dd263e3ced7c0819c85623dc586882e9cca050fbc02e37d87e571", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1074f837183dd263e3ced7c0819c85623dc586882e9cca050fbc02e37d87e571", kill_on_drop: false }` [INFO] [stdout] 1074f837183dd263e3ced7c0819c85623dc586882e9cca050fbc02e37d87e571