[INFO] cloning repository https://github.com/RagePly/aoc16 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/RagePly/aoc16" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FRagePly%2Faoc16", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FRagePly%2Faoc16'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 96433090d52169ee2f68d043d82d1edf7ba24d58 [INFO] linting RagePly/aoc16 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FRagePly%2Faoc16" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/RagePly/aoc16 [INFO] finished tweaking git repo https://github.com/RagePly/aoc16 [INFO] tweaked toml for git repo https://github.com/RagePly/aoc16 written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/RagePly/aoc16 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/RagePly/aoc16 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] d89e911c60241d0148c505d7fc744cea497683a4e8a09be389a9a43eb9ee9f17 [INFO] running `Command { std: "docker" "start" "-a" "d89e911c60241d0148c505d7fc744cea497683a4e8a09be389a9a43eb9ee9f17", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "d89e911c60241d0148c505d7fc744cea497683a4e8a09be389a9a43eb9ee9f17", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d89e911c60241d0148c505d7fc744cea497683a4e8a09be389a9a43eb9ee9f17", kill_on_drop: false }` [INFO] [stdout] d89e911c60241d0148c505d7fc744cea497683a4e8a09be389a9a43eb9ee9f17 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 9e9bede530670effb50a837e13c756be384d980016b3407e50df9ef869ef9335 [INFO] running `Command { std: "docker" "start" "-a" "9e9bede530670effb50a837e13c756be384d980016b3407e50df9ef869ef9335", kill_on_drop: false }` [INFO] [stderr] Compiling num-bigint v0.4.2 [INFO] [stderr] Compiling num-rational v0.4.0 [INFO] [stderr] Compiling num-iter v0.1.42 [INFO] [stderr] Checking itertools v0.10.1 [INFO] [stderr] Checking num-complex v0.4.0 [INFO] [stderr] Checking num v0.4.0 [INFO] [stderr] Checking aoc16 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day12.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | program: program [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day12.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | program: program [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day13.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day13.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | y: y [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day22.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day22.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | y: y [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day23.rs:176:9 [INFO] [stdout] | [INFO] [stdout] 176 | program: program [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day23.rs:188:9 [INFO] [stdout] | [INFO] [stdout] 188 | program: program [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day24.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day24.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | y: y [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day12.rs:77:9 [INFO] [stdout] | [INFO] [stdout] 77 | program: program [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day12.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | program: program [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day13.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day13.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | y: y [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day22.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day22.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | y: y [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day23.rs:176:9 [INFO] [stdout] | [INFO] [stdout] 176 | program: program [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day23.rs:188:9 [INFO] [stdout] | [INFO] [stdout] 188 | program: program [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day24.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day24.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | y: y [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `size` is never read [INFO] [stdout] --> src/day22.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 29 | struct Node { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 30 | point: Point, [INFO] [stdout] 31 | size: i32, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Node` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day1.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | return (x.abs() + y.abs(), duration); [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 - return (x.abs() + y.abs(), duration); [INFO] [stdout] 30 + (x.abs() + y.abs(), duration) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day1.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | return (-1, duration); [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] 81 - return (-1, duration); [INFO] [stdout] 81 + (-1, duration) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day2.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | return (code, now.elapsed().as_micros()); [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] 35 - return (code, now.elapsed().as_micros()); [INFO] [stdout] 35 + (code, now.elapsed().as_micros()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day2.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | return (code.into_iter().collect(), now.elapsed().as_micros()); [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] 72 - return (code.into_iter().collect(), now.elapsed().as_micros()); [INFO] [stdout] 72 + (code.into_iter().collect(), now.elapsed().as_micros()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day3.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | return (count, now.elapsed().as_micros()); [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] 21 - return (count, now.elapsed().as_micros()); [INFO] [stdout] 21 + (count, now.elapsed().as_micros()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `sides.get(0)` [INFO] [stdout] --> src/day3.rs:12:18 [INFO] [stdout] | [INFO] [stdout] 12 | let a = *sides.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `sides.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: unneeded `return` statement [INFO] [stdout] --> src/day3.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | return count; [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] 48 - return count; [INFO] [stdout] 48 + count [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day3.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return (count_valid(a) + count_valid(b) + count_valid(c), now.elapsed().as_micros()); [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] 67 - return (count_valid(a) + count_valid(b) + count_valid(c), now.elapsed().as_micros()); [INFO] [stdout] 67 + (count_valid(a) + count_valid(b) + count_valid(c), now.elapsed().as_micros()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `sides.get(0)` [INFO] [stdout] --> src/day3.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | a.push(*sides.get(0).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `sides.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 `remainder.get(0)` [INFO] [stdout] --> src/day4.rs:30:33 [INFO] [stdout] | [INFO] [stdout] 30 | let id: i64 = String::from(*remainder.get(0).unwrap()).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `remainder.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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:53:8 [INFO] [stdout] | [INFO] [stdout] 53 | if 97 <= c && c <= 122 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: use: `(97..=122).contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `remainder.get(0)` [INFO] [stdout] --> src/day4.rs:69:33 [INFO] [stdout] | [INFO] [stdout] 69 | let id: i64 = String::from(*remainder.get(0).unwrap()).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `remainder.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: field `size` is never read [INFO] [stdout] --> src/day22.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 29 | struct Node { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 30 | point: Point, [INFO] [stdout] 31 | size: i32, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Node` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day1.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | return (x.abs() + y.abs(), duration); [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 - return (x.abs() + y.abs(), duration); [INFO] [stdout] 30 + (x.abs() + y.abs(), duration) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/day6.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | temp_vec.sort_by(|a, b| a.1.cmp(&b.1)); // sort in increasing order instead [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 53 - temp_vec.sort_by(|a, b| a.1.cmp(&b.1)); // sort in increasing order instead [INFO] [stdout] 53 + temp_vec.sort_by_key(|a| a.1); // sort in increasing order instead [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day7.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | return false; [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] 23 - return false; [INFO] [stdout] 23 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day7.rs:40:16 [INFO] [stdout] | [INFO] [stdout] 40 | if !(!is_hypernet && any_outside_hypernet) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_hypernet || !any_outside_hypernet` [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/day1.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | return (-1, duration); [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] 81 - return (-1, duration); [INFO] [stdout] 81 + (-1, duration) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/day7.rs:39:37 [INFO] [stdout] | [INFO] [stdout] 39 | for sequence in line.split(|c| c == '[' || c == ']') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day2.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | return (code, now.elapsed().as_micros()); [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] 35 - return (code, now.elapsed().as_micros()); [INFO] [stdout] 35 + (code, now.elapsed().as_micros()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/day7.rs:96:37 [INFO] [stdout] | [INFO] [stdout] 96 | for sequence in line.split(|c| c == '[' || c == ']') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day2.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | return (code.into_iter().collect(), now.elapsed().as_micros()); [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] 72 - return (code.into_iter().collect(), now.elapsed().as_micros()); [INFO] [stdout] 72 + (code.into_iter().collect(), now.elapsed().as_micros()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day3.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | return (count, now.elapsed().as_micros()); [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] 21 - return (count, now.elapsed().as_micros()); [INFO] [stdout] 21 + (count, now.elapsed().as_micros()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `board` [INFO] [stdout] --> src/day8.rs:36:14 [INFO] [stdout] | [INFO] [stdout] 36 | for y in 0..height as usize { [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] 36 - for y in 0..height as usize { [INFO] [stdout] 36 + for in board.iter_mut().take(height as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `board` [INFO] [stdout] --> src/day8.rs:37:18 [INFO] [stdout] | [INFO] [stdout] 37 | for x in 0..width as usize { [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] 37 - for x in 0..width as usize { [INFO] [stdout] 37 + for in board.iter_mut().take(width as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `sides.get(0)` [INFO] [stdout] --> src/day3.rs:12:18 [INFO] [stdout] | [INFO] [stdout] 12 | let a = *sides.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `sides.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: it looks like you're manually copying between slices [INFO] [stdout] --> src/day8.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | / for x in 0..WIDTH { [INFO] [stdout] 50 | | board[row as usize][x] = temp_row[x]; [INFO] [stdout] 51 | | } [INFO] [stdout] | |_____^ help: try replacing the loop by: `board[row as usize][..WIDTH].copy_from_slice(&temp_row[..WIDTH]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day3.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | return count; [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] 48 - return count; [INFO] [stdout] 48 + count [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day3.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return (count_valid(a) + count_valid(b) + count_valid(c), now.elapsed().as_micros()); [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] 67 - return (count_valid(a) + count_valid(b) + count_valid(c), now.elapsed().as_micros()); [INFO] [stdout] 67 + (count_valid(a) + count_valid(b) + count_valid(c), now.elapsed().as_micros()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `board` [INFO] [stdout] --> src/day8.rs:87:14 [INFO] [stdout] | [INFO] [stdout] 87 | for y in 0..HEIGHT { [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] 87 - for y in 0..HEIGHT { [INFO] [stdout] 87 + for in board.iter().take(HEIGHT) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `board` [INFO] [stdout] --> src/day8.rs:88:18 [INFO] [stdout] | [INFO] [stdout] 88 | for x in 0..WIDTH { [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] 88 - for x in 0..WIDTH { [INFO] [stdout] 88 + for in board.iter().take(WIDTH) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `sides.get(0)` [INFO] [stdout] --> src/day3.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | a.push(*sides.get(0).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `sides.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: the loop variable `y` is only used to index `board` [INFO] [stdout] --> src/day8.rs:114:14 [INFO] [stdout] | [INFO] [stdout] 114 | for y in 0..HEIGHT { [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] 114 - for y in 0..HEIGHT { [INFO] [stdout] 114 + for in board.iter().take(HEIGHT) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `board` [INFO] [stdout] --> src/day8.rs:115:18 [INFO] [stdout] | [INFO] [stdout] 115 | for x in 0..WIDTH { [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] 115 - for x in 0..WIDTH { [INFO] [stdout] 115 + for in board.iter().take(WIDTH) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day8.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 123 - print!("\n"); [INFO] [stdout] 123 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `remainder.get(0)` [INFO] [stdout] --> src/day4.rs:30:33 [INFO] [stdout] | [INFO] [stdout] 30 | let id: i64 = String::from(*remainder.get(0).unwrap()).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `remainder.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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:53:8 [INFO] [stdout] | [INFO] [stdout] 53 | if 97 <= c && c <= 122 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: use: `(97..=122).contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `remainder.get(0)` [INFO] [stdout] --> src/day4.rs:69:33 [INFO] [stdout] | [INFO] [stdout] 69 | let id: i64 = String::from(*remainder.get(0).unwrap()).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `remainder.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:106:50 [INFO] [stdout] | [INFO] [stdout] 106 | let (low_id, high_id) = bots.get(&k).unwrap(); [INFO] [stdout] | ^^ help: change this to: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day10.rs:107:17 [INFO] [stdout] | [INFO] [stdout] 107 | / match high_id { [INFO] [stdout] 108 | | Bot(id) => { [INFO] [stdout] 109 | | update_queue.push_back((*id, *high)); [INFO] [stdout] 110 | | }, [INFO] [stdout] 111 | | _ => () [INFO] [stdout] 112 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 107 ~ if let Bot(id) = high_id { [INFO] [stdout] 108 + update_queue.push_back((*id, *high)); [INFO] [stdout] 109 ~ }; [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/day10.rs:113:17 [INFO] [stdout] | [INFO] [stdout] 113 | / match low_id { [INFO] [stdout] 114 | | Bot(id) => { [INFO] [stdout] 115 | | update_queue.push_back((*id, *low)); [INFO] [stdout] 116 | | }, [INFO] [stdout] 117 | | _ => () [INFO] [stdout] 118 | | }; [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] 113 ~ if let Bot(id) = low_id { [INFO] [stdout] 114 + update_queue.push_back((*id, *low)); [INFO] [stdout] 115 ~ }; [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/day10.rs:136:25 [INFO] [stdout] | [INFO] [stdout] 136 | / match high_id { [INFO] [stdout] 137 | | Bot(bot_id) => { [INFO] [stdout] 138 | | update_queue.push_back((*bot_id, max)); [INFO] [stdout] 139 | | }, [INFO] [stdout] 140 | | _ => () [INFO] [stdout] 141 | | }; [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] 136 ~ if let Bot(bot_id) = high_id { [INFO] [stdout] 137 + update_queue.push_back((*bot_id, max)); [INFO] [stdout] 138 ~ }; [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/day10.rs:142:25 [INFO] [stdout] | [INFO] [stdout] 142 | / match low_id { [INFO] [stdout] 143 | | Bot(bot_id) => { [INFO] [stdout] 144 | | update_queue.push_back((*bot_id, min)); [INFO] [stdout] 145 | | }, [INFO] [stdout] 146 | | _ => () [INFO] [stdout] 147 | | }; [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] 142 ~ if let Bot(bot_id) = low_id { [INFO] [stdout] 143 + update_queue.push_back((*bot_id, min)); [INFO] [stdout] 144 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/day6.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | temp_vec.sort_by(|a, b| a.1.cmp(&b.1)); // sort in increasing order instead [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 53 - temp_vec.sort_by(|a, b| a.1.cmp(&b.1)); // sort in increasing order instead [INFO] [stdout] 53 + temp_vec.sort_by_key(|a| a.1); // sort in increasing order instead [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:195:50 [INFO] [stdout] | [INFO] [stdout] 195 | let (low_id, high_id) = bots.get(&k).unwrap(); [INFO] [stdout] | ^^ help: change this to: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day7.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | return false; [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] 23 - return false; [INFO] [stdout] 23 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day7.rs:40:16 [INFO] [stdout] | [INFO] [stdout] 40 | if !(!is_hypernet && any_outside_hypernet) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_hypernet || !any_outside_hypernet` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/day7.rs:39:37 [INFO] [stdout] | [INFO] [stdout] 39 | for sequence in line.split(|c| c == '[' || c == ']') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/day7.rs:96:37 [INFO] [stdout] | [INFO] [stdout] 96 | for sequence in line.split(|c| c == '[' || c == ']') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `board` [INFO] [stdout] --> src/day8.rs:36:14 [INFO] [stdout] | [INFO] [stdout] 36 | for y in 0..height as usize { [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] 36 - for y in 0..height as usize { [INFO] [stdout] 36 + for in board.iter_mut().take(height as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `board` [INFO] [stdout] --> src/day8.rs:37:18 [INFO] [stdout] | [INFO] [stdout] 37 | for x in 0..width as usize { [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] 37 - for x in 0..width as usize { [INFO] [stdout] 37 + for in board.iter_mut().take(width as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/day8.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | / for x in 0..WIDTH { [INFO] [stdout] 50 | | board[row as usize][x] = temp_row[x]; [INFO] [stdout] 51 | | } [INFO] [stdout] | |_____^ help: try replacing the loop by: `board[row as usize][..WIDTH].copy_from_slice(&temp_row[..WIDTH]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `board` [INFO] [stdout] --> src/day8.rs:87:14 [INFO] [stdout] | [INFO] [stdout] 87 | for y in 0..HEIGHT { [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] 87 - for y in 0..HEIGHT { [INFO] [stdout] 87 + for in board.iter().take(HEIGHT) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `board` [INFO] [stdout] --> src/day8.rs:88:18 [INFO] [stdout] | [INFO] [stdout] 88 | for x in 0..WIDTH { [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] 88 - for x in 0..WIDTH { [INFO] [stdout] 88 + for in board.iter().take(WIDTH) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `board` [INFO] [stdout] --> src/day8.rs:114:14 [INFO] [stdout] | [INFO] [stdout] 114 | for y in 0..HEIGHT { [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] 114 - for y in 0..HEIGHT { [INFO] [stdout] 114 + for in board.iter().take(HEIGHT) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `board` [INFO] [stdout] --> src/day8.rs:115:18 [INFO] [stdout] | [INFO] [stdout] 115 | for x in 0..WIDTH { [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] 115 - for x in 0..WIDTH { [INFO] [stdout] 115 + for in board.iter().take(WIDTH) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day8.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 123 - print!("\n"); [INFO] [stdout] 123 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day11.rs:294:30 [INFO] [stdout] | [INFO] [stdout] 294 | let components: Vec<_> = component_map.values().map(|v| *v).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `component_map.values().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day11.rs:374:30 [INFO] [stdout] | [INFO] [stdout] 374 | let components: Vec<_> = component_map.values().map(|v| *v).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `component_map.values().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:106:50 [INFO] [stdout] | [INFO] [stdout] 106 | let (low_id, high_id) = bots.get(&k).unwrap(); [INFO] [stdout] | ^^ help: change this to: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day10.rs:107:17 [INFO] [stdout] | [INFO] [stdout] 107 | / match high_id { [INFO] [stdout] 108 | | Bot(id) => { [INFO] [stdout] 109 | | update_queue.push_back((*id, *high)); [INFO] [stdout] 110 | | }, [INFO] [stdout] 111 | | _ => () [INFO] [stdout] 112 | | }; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 107 ~ if let Bot(id) = high_id { [INFO] [stdout] 108 + update_queue.push_back((*id, *high)); [INFO] [stdout] 109 ~ }; [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/day10.rs:113:17 [INFO] [stdout] | [INFO] [stdout] 113 | / match low_id { [INFO] [stdout] 114 | | Bot(id) => { [INFO] [stdout] 115 | | update_queue.push_back((*id, *low)); [INFO] [stdout] 116 | | }, [INFO] [stdout] 117 | | _ => () [INFO] [stdout] 118 | | }; [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] 113 ~ if let Bot(id) = low_id { [INFO] [stdout] 114 + update_queue.push_back((*id, *low)); [INFO] [stdout] 115 ~ }; [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/day10.rs:136:25 [INFO] [stdout] | [INFO] [stdout] 136 | / match high_id { [INFO] [stdout] 137 | | Bot(bot_id) => { [INFO] [stdout] 138 | | update_queue.push_back((*bot_id, max)); [INFO] [stdout] 139 | | }, [INFO] [stdout] 140 | | _ => () [INFO] [stdout] 141 | | }; [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] 136 ~ if let Bot(bot_id) = high_id { [INFO] [stdout] 137 + update_queue.push_back((*bot_id, max)); [INFO] [stdout] 138 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day12.rs:73:53 [INFO] [stdout] | [INFO] [stdout] 73 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day10.rs:142:25 [INFO] [stdout] | [INFO] [stdout] 142 | / match low_id { [INFO] [stdout] 143 | | Bot(bot_id) => { [INFO] [stdout] 144 | | update_queue.push_back((*bot_id, min)); [INFO] [stdout] 145 | | }, [INFO] [stdout] 146 | | _ => () [INFO] [stdout] 147 | | }; [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] 142 ~ if let Bot(bot_id) = low_id { [INFO] [stdout] 143 + update_queue.push_back((*bot_id, min)); [INFO] [stdout] 144 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day12.rs:86:53 [INFO] [stdout] | [INFO] [stdout] 86 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day13.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | v.count_ones() % 2 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `v.count_ones().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:195:50 [INFO] [stdout] | [INFO] [stdout] 195 | let (low_id, high_id) = bots.get(&k).unwrap(); [INFO] [stdout] | ^^ help: change this to: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day13.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | queue.make_contiguous().sort_unstable_by(|a, b| dist_to(&a.p, &goal).cmp(&dist_to(&b.p, &goal))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 69 - queue.make_contiguous().sort_unstable_by(|a, b| dist_to(&a.p, &goal).cmp(&dist_to(&b.p, &goal))); [INFO] [stdout] 69 + queue.make_contiguous().sort_unstable_by_key(|a| dist_to(&a.p, &goal)); [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/day14.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | / match find_triple(&digest) { [INFO] [stdout] 74 | | Some(h) => { [INFO] [stdout] 75 | | circular_hash_list[current_index].hash = h; [INFO] [stdout] 76 | | circular_hash_list[current_index].is_active = true; [INFO] [stdout] ... | [INFO] [stdout] 81 | | None => () [INFO] [stdout] 82 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 ~ if let Some(h) = find_triple(&digest) { [INFO] [stdout] 74 + circular_hash_list[current_index].hash = h; [INFO] [stdout] 75 + circular_hash_list[current_index].is_active = true; [INFO] [stdout] 76 + circular_hash_list[current_index].index = hash_count; [INFO] [stdout] 77 + if hash_count > 11250 && hash_count < 11400 { [INFO] [stdout] 78 + } [INFO] [stdout] 79 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `circular_hash_list` [INFO] [stdout] --> src/day14.rs:86:22 [INFO] [stdout] | [INFO] [stdout] 86 | for i in current_index+1..SIZE { [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] 86 - for i in current_index+1..SIZE { [INFO] [stdout] 86 + for in circular_hash_list.iter_mut().take(SIZE).skip(current_index+1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `circular_hash_list` [INFO] [stdout] --> src/day14.rs:98:22 [INFO] [stdout] | [INFO] [stdout] 98 | for i in 0..current_index { [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] 98 - for i in 0..current_index { [INFO] [stdout] 98 + for in circular_hash_list.iter_mut().take(current_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day11.rs:294:30 [INFO] [stdout] | [INFO] [stdout] 294 | let components: Vec<_> = component_map.values().map(|v| *v).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `component_map.values().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [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/day14.rs:137:9 [INFO] [stdout] | [INFO] [stdout] 137 | / match find_triple(&digest) { [INFO] [stdout] 138 | | Some(h) => { [INFO] [stdout] 139 | | circular_hash_list[current_index].hash = h; [INFO] [stdout] 140 | | circular_hash_list[current_index].is_active = true; [INFO] [stdout] ... | [INFO] [stdout] 145 | | None => () [INFO] [stdout] 146 | | }; [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] 137 ~ if let Some(h) = find_triple(&digest) { [INFO] [stdout] 138 + circular_hash_list[current_index].hash = h; [INFO] [stdout] 139 + circular_hash_list[current_index].is_active = true; [INFO] [stdout] 140 + circular_hash_list[current_index].index = hash_count; [INFO] [stdout] 141 + if hash_count > 11250 && hash_count < 11400 { [INFO] [stdout] 142 + } [INFO] [stdout] 143 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `circular_hash_list` [INFO] [stdout] --> src/day14.rs:150:22 [INFO] [stdout] | [INFO] [stdout] 150 | for i in current_index+1..SIZE { [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] 150 - for i in current_index+1..SIZE { [INFO] [stdout] 150 + for in circular_hash_list.iter_mut().take(SIZE).skip(current_index+1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `circular_hash_list` [INFO] [stdout] --> src/day14.rs:161:22 [INFO] [stdout] | [INFO] [stdout] 161 | for i in 0..current_index { [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] 161 - for i in 0..current_index { [INFO] [stdout] 161 + for in circular_hash_list.iter_mut().take(current_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day11.rs:374:30 [INFO] [stdout] | [INFO] [stdout] 374 | let components: Vec<_> = component_map.values().map(|v| *v).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `component_map.values().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day15.rs:23:59 [INFO] [stdout] | [INFO] [stdout] 23 | let mut disks: VecDeque<_> = source.split("\r\n").map(|line| parse_disk(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_disk` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day15.rs:47:59 [INFO] [stdout] | [INFO] [stdout] 47 | let mut disks: VecDeque<_> = source.split("\r\n").map(|line| parse_disk(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_disk` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day16.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | |w| if w[0] == w[1] { true } else { false } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `w[0] == w[1]` [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/day16.rs:10:69 [INFO] [stdout] | [INFO] [stdout] 10 | let mut bitstring: BitString = source.as_bytes().iter().map(|b| if *b == '1' as u8 {true} else {false}).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `*b == '1' as u8` [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 closure [INFO] [stdout] --> src/day12.rs:73:53 [INFO] [stdout] | [INFO] [stdout] 73 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day16.rs:10:78 [INFO] [stdout] | [INFO] [stdout] 10 | let mut bitstring: BitString = source.as_bytes().iter().map(|b| if *b == '1' as u8 {true} else {false}).collect(); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day12.rs:86:53 [INFO] [stdout] | [INFO] [stdout] 86 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day16.rs:21:11 [INFO] [stdout] | [INFO] [stdout] 21 | while bitstring_checksum.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `bitstring_checksum.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day13.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | v.count_ones() % 2 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `v.count_ones().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day16.rs:29:52 [INFO] [stdout] | [INFO] [stdout] 29 | source.as_bytes().iter().for_each(|b| if *b == '1' as u8 {bitstring.push(true) } else { bitstring.push(false)}); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day16.rs:40:11 [INFO] [stdout] | [INFO] [stdout] 40 | while bitstring_checksum.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `bitstring_checksum.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day13.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | queue.make_contiguous().sort_unstable_by(|a, b| dist_to(&a.p, &goal).cmp(&dist_to(&b.p, &goal))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 69 - queue.make_contiguous().sort_unstable_by(|a, b| dist_to(&a.p, &goal).cmp(&dist_to(&b.p, &goal))); [INFO] [stdout] 69 + queue.make_contiguous().sort_unstable_by_key(|a| dist_to(&a.p, &goal)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day17.rs:64:17 [INFO] [stdout] | [INFO] [stdout] 64 | / if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] 65 | | false [INFO] [stdout] 66 | | } else { [INFO] [stdout] 67 | | true [INFO] [stdout] 68 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `!(('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8)` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:64:21 [INFO] [stdout] | [INFO] [stdout] 64 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:64:46 [INFO] [stdout] | [INFO] [stdout] 64 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'9'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:64:66 [INFO] [stdout] | [INFO] [stdout] 64 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day17.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | / if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] 111 | | false [INFO] [stdout] 112 | | } else { [INFO] [stdout] 113 | | true [INFO] [stdout] 114 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `!(('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8)` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:110:46 [INFO] [stdout] | [INFO] [stdout] 110 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'9'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [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/day14.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | / match find_triple(&digest) { [INFO] [stdout] 74 | | Some(h) => { [INFO] [stdout] 75 | | circular_hash_list[current_index].hash = h; [INFO] [stdout] 76 | | circular_hash_list[current_index].is_active = true; [INFO] [stdout] ... | [INFO] [stdout] 81 | | None => () [INFO] [stdout] 82 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 ~ if let Some(h) = find_triple(&digest) { [INFO] [stdout] 74 + circular_hash_list[current_index].hash = h; [INFO] [stdout] 75 + circular_hash_list[current_index].is_active = true; [INFO] [stdout] 76 + circular_hash_list[current_index].index = hash_count; [INFO] [stdout] 77 + if hash_count > 11250 && hash_count < 11400 { [INFO] [stdout] 78 + } [INFO] [stdout] 79 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `circular_hash_list` [INFO] [stdout] --> src/day14.rs:86:22 [INFO] [stdout] | [INFO] [stdout] 86 | for i in current_index+1..SIZE { [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] 86 - for i in current_index+1..SIZE { [INFO] [stdout] 86 + for in circular_hash_list.iter_mut().take(SIZE).skip(current_index+1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `circular_hash_list` [INFO] [stdout] --> src/day14.rs:98:22 [INFO] [stdout] | [INFO] [stdout] 98 | for i in 0..current_index { [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] 98 - for i in 0..current_index { [INFO] [stdout] 98 + for in circular_hash_list.iter_mut().take(current_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:110:66 [INFO] [stdout] | [INFO] [stdout] 110 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day18.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | / (l && c && !r) || [INFO] [stdout] 5 | | (!l && c && r) || [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4 - (l && c && !r) || [INFO] [stdout] 5 - (!l && c && r) || [INFO] [stdout] 4 + !(!c || l && r || !l && !r) || [INFO] [stdout] | [INFO] [stdout] 4 - (l && c && !r) || [INFO] [stdout] 5 - (!l && c && r) || [INFO] [stdout] 4 + (r || l) && (!r || !l) && c || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day18.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | / [false].iter() [INFO] [stdout] 12 | | .chain(prev_row.iter()) [INFO] [stdout] 13 | | .chain([false].iter()) [INFO] [stdout] 14 | | .map(|b_ref| *b_ref) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 11 ~ [false].iter() [INFO] [stdout] 12 + .chain(prev_row.iter()) [INFO] [stdout] 13 + .chain([false].iter()).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day18.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | |b| if *b == '^' as u8 { true } else { false } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `*b == '^' as u8` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day18.rs:25:22 [INFO] [stdout] | [INFO] [stdout] 25 | |b| if *b == '^' as u8 { true } else { false } [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'^'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day18.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | |b| if *b == '^' as u8 { true } else { false } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `*b == '^' as u8` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day18.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | |b| if *b == '^' as u8 { true } else { false } [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'^'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [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/day14.rs:137:9 [INFO] [stdout] | [INFO] [stdout] 137 | / match find_triple(&digest) { [INFO] [stdout] 138 | | Some(h) => { [INFO] [stdout] 139 | | circular_hash_list[current_index].hash = h; [INFO] [stdout] 140 | | circular_hash_list[current_index].is_active = true; [INFO] [stdout] ... | [INFO] [stdout] 145 | | None => () [INFO] [stdout] 146 | | }; [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] 137 ~ if let Some(h) = find_triple(&digest) { [INFO] [stdout] 138 + circular_hash_list[current_index].hash = h; [INFO] [stdout] 139 + circular_hash_list[current_index].is_active = true; [INFO] [stdout] 140 + circular_hash_list[current_index].index = hash_count; [INFO] [stdout] 141 + if hash_count > 11250 && hash_count < 11400 { [INFO] [stdout] 142 + } [INFO] [stdout] 143 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day19.rs:4:15 [INFO] [stdout] | [INFO] [stdout] 4 | } else if total % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace with: `total.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `circular_hash_list` [INFO] [stdout] --> src/day14.rs:150:22 [INFO] [stdout] | [INFO] [stdout] 150 | for i in current_index+1..SIZE { [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] 150 - for i in current_index+1..SIZE { [INFO] [stdout] 150 + for in circular_hash_list.iter_mut().take(SIZE).skip(current_index+1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `circular_hash_list` [INFO] [stdout] --> src/day14.rs:161:22 [INFO] [stdout] | [INFO] [stdout] 161 | for i in 0..current_index { [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] 161 - for i in 0..current_index { [INFO] [stdout] 161 + for in circular_hash_list.iter_mut().take(current_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/day19.rs:7:71 [INFO] [stdout] | [INFO] [stdout] 7 | get_winner(lower_bound + 2u32.pow(index + 1u32), upper_bound, (total + 1)/2 - 1, index + 1) [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `total.div_ceil(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/day19.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | fn get_winner(lower_bound: u32, upper_bound: u32, total: u32, index: u32) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_upper_bound` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/day19.rs:5:33 [INFO] [stdout] | [INFO] [stdout] 5 | get_winner(lower_bound, upper_bound - 2u32.pow(index), total/2, index + 1) [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 6 | } else { [INFO] [stdout] 7 | get_winner(lower_bound + 2u32.pow(index + 1u32), upper_bound, (total + 1)/2 - 1, index + 1) [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day20.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | ip_ranges.sort_unstable_by(|r1, r2| r1.0.cmp(&r2.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 9 - ip_ranges.sort_unstable_by(|r1, r2| r1.0.cmp(&r2.0)); [INFO] [stdout] 9 + ip_ranges.sort_unstable_by_key(|r1| r1.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day15.rs:23:59 [INFO] [stdout] | [INFO] [stdout] 23 | let mut disks: VecDeque<_> = source.split("\r\n").map(|line| parse_disk(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_disk` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day20.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | ip_ranges.sort_unstable_by(|r1, r2| r1.0.cmp(&r2.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 29 - ip_ranges.sort_unstable_by(|r1, r2| r1.0.cmp(&r2.0)); [INFO] [stdout] 29 + ip_ranges.sort_unstable_by_key(|r1| r1.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day15.rs:47:59 [INFO] [stdout] | [INFO] [stdout] 47 | let mut disks: VecDeque<_> = source.split("\r\n").map(|line| parse_disk(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_disk` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day16.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | |w| if w[0] == w[1] { true } else { false } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `w[0] == w[1]` [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/day16.rs:10:69 [INFO] [stdout] | [INFO] [stdout] 10 | let mut bitstring: BitString = source.as_bytes().iter().map(|b| if *b == '1' as u8 {true} else {false}).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `*b == '1' as u8` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day16.rs:10:78 [INFO] [stdout] | [INFO] [stdout] 10 | let mut bitstring: BitString = source.as_bytes().iter().map(|b| if *b == '1' as u8 {true} else {false}).collect(); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day16.rs:21:11 [INFO] [stdout] | [INFO] [stdout] 21 | while bitstring_checksum.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `bitstring_checksum.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day16.rs:29:52 [INFO] [stdout] | [INFO] [stdout] 29 | source.as_bytes().iter().for_each(|b| if *b == '1' as u8 {bitstring.push(true) } else { bitstring.push(false)}); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:60:23 [INFO] [stdout] | [INFO] [stdout] 60 | fn apply_operation(s: &mut Vec, operation: Operation) { [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] 60 ~ fn apply_operation(s: &mut [u8], operation: Operation) { [INFO] [stdout] 61 | use Operation::*; [INFO] [stdout] ... [INFO] [stdout] 75 | RotateSteps(direction, amount) => { [INFO] [stdout] 76 ~ let temp = s.to_owned(); [INFO] [stdout] 77 | let len = s.len(); [INFO] [stdout] ... [INFO] [stdout] 89 | let amount = 1 + i + if i >= 4 { 1 } else { 0 }; [INFO] [stdout] 90 ~ let temp = s.to_owned(); [INFO] [stdout] 91 | let len = s.len(); [INFO] [stdout] ... [INFO] [stdout] 96 | Reverse(x, y) => { [INFO] [stdout] 97 ~ let temp = s.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping elements of `s` manually [INFO] [stdout] --> src/day21.rs:65:13 [INFO] [stdout] | [INFO] [stdout] 65 | / let z = s[x]; [INFO] [stdout] 66 | | s[x] = s[y]; [INFO] [stdout] 67 | | s[y] = z; [INFO] [stdout] | |_____________________^ help: try: `s.swap(x, y);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day16.rs:40:11 [INFO] [stdout] | [INFO] [stdout] 40 | while bitstring_checksum.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `bitstring_checksum.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day17.rs:64:17 [INFO] [stdout] | [INFO] [stdout] 64 | / if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] 65 | | false [INFO] [stdout] 66 | | } else { [INFO] [stdout] 67 | | true [INFO] [stdout] 68 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `!(('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8)` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:64:21 [INFO] [stdout] | [INFO] [stdout] 64 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:64:46 [INFO] [stdout] | [INFO] [stdout] 64 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'9'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day21.rs:121:26 [INFO] [stdout] | [INFO] [stdout] 121 | let mut s: Vec = "abcdefgh".as_bytes().into_iter().map(|b| *b).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `"abcdefgh".as_bytes().into_iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:64:66 [INFO] [stdout] | [INFO] [stdout] 64 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day21.rs:121:48 [INFO] [stdout] | [INFO] [stdout] 121 | let mut s: Vec = "abcdefgh".as_bytes().into_iter().map(|b| *b).collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:122:30 [INFO] [stdout] | [INFO] [stdout] 122 | source.split("\r\n").map(|line| parse_line(line)).for_each( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:128:27 [INFO] [stdout] | [INFO] [stdout] 128 | fn apply_operation_rev(s: &mut Vec, operation: Operation) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 128 ~ fn apply_operation_rev(s: &mut [u8], operation: Operation) { [INFO] [stdout] 129 | use Operation::*; [INFO] [stdout] ... [INFO] [stdout] 143 | RotateSteps(direction, amount) => { [INFO] [stdout] 144 ~ let temp = s.to_owned(); [INFO] [stdout] 145 | let len = s.len(); [INFO] [stdout] ... [INFO] [stdout] 165 | }; [INFO] [stdout] 166 ~ let temp = s.to_owned(); [INFO] [stdout] 167 | let len = s.len(); [INFO] [stdout] ... [INFO] [stdout] 172 | Reverse(x, y) => { [INFO] [stdout] 173 ~ let temp = s.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping elements of `s` manually [INFO] [stdout] --> src/day21.rs:133:13 [INFO] [stdout] | [INFO] [stdout] 133 | / let z = s[x]; [INFO] [stdout] 134 | | s[x] = s[y]; [INFO] [stdout] 135 | | s[y] = z; [INFO] [stdout] | |_____________________^ help: try: `s.swap(x, y);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day17.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | / if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] 111 | | false [INFO] [stdout] 112 | | } else { [INFO] [stdout] 113 | | true [INFO] [stdout] 114 | | } [INFO] [stdout] | |_________________^ help: you can reduce it to: `!(('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8)` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:110:46 [INFO] [stdout] | [INFO] [stdout] 110 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'9'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day17.rs:110:66 [INFO] [stdout] | [INFO] [stdout] 110 | if ('0' as u8 <= *b && *b <= '9' as u8) || *b == 'a' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day18.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | / (l && c && !r) || [INFO] [stdout] 5 | | (!l && c && r) || [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4 - (l && c && !r) || [INFO] [stdout] 5 - (!l && c && r) || [INFO] [stdout] 4 + !(!c || l && r || !l && !r) || [INFO] [stdout] | [INFO] [stdout] 4 - (l && c && !r) || [INFO] [stdout] 5 - (!l && c && r) || [INFO] [stdout] 4 + (r || l) && (!r || !l) && c || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day18.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | / [false].iter() [INFO] [stdout] 12 | | .chain(prev_row.iter()) [INFO] [stdout] 13 | | .chain([false].iter()) [INFO] [stdout] 14 | | .map(|b_ref| *b_ref) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 11 ~ [false].iter() [INFO] [stdout] 12 + .chain(prev_row.iter()) [INFO] [stdout] 13 + .chain([false].iter()).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day18.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | |b| if *b == '^' as u8 { true } else { false } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `*b == '^' as u8` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day18.rs:25:22 [INFO] [stdout] | [INFO] [stdout] 25 | |b| if *b == '^' as u8 { true } else { false } [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'^'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day21.rs:197:26 [INFO] [stdout] | [INFO] [stdout] 197 | let mut s: Vec = "fbgdceah".as_bytes().into_iter().map(|b| *b).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `"fbgdceah".as_bytes().into_iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day21.rs:197:48 [INFO] [stdout] | [INFO] [stdout] 197 | let mut s: Vec = "fbgdceah".as_bytes().into_iter().map(|b| *b).collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day18.rs:38:13 [INFO] [stdout] | [INFO] [stdout] 38 | |b| if *b == '^' as u8 { true } else { false } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `*b == '^' as u8` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day18.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | |b| if *b == '^' as u8 { true } else { false } [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'^'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:198:50 [INFO] [stdout] | [INFO] [stdout] 198 | let lines: Vec<_> = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day19.rs:4:15 [INFO] [stdout] | [INFO] [stdout] 4 | } else if total % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace with: `total.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/day19.rs:7:71 [INFO] [stdout] | [INFO] [stdout] 7 | get_winner(lower_bound + 2u32.pow(index + 1u32), upper_bound, (total + 1)/2 - 1, index + 1) [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `total.div_ceil(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/day19.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | fn get_winner(lower_bound: u32, upper_bound: u32, total: u32, index: u32) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_upper_bound` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/day19.rs:5:33 [INFO] [stdout] | [INFO] [stdout] 5 | get_winner(lower_bound, upper_bound - 2u32.pow(index), total/2, index + 1) [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 6 | } else { [INFO] [stdout] 7 | get_winner(lower_bound + 2u32.pow(index + 1u32), upper_bound, (total + 1)/2 - 1, index + 1) [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day20.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | ip_ranges.sort_unstable_by(|r1, r2| r1.0.cmp(&r2.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 9 - ip_ranges.sort_unstable_by(|r1, r2| r1.0.cmp(&r2.0)); [INFO] [stdout] 9 + ip_ranges.sort_unstable_by_key(|r1| r1.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day20.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | ip_ranges.sort_unstable_by(|r1, r2| r1.0.cmp(&r2.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 29 - ip_ranges.sort_unstable_by(|r1, r2| r1.0.cmp(&r2.0)); [INFO] [stdout] 29 + ip_ranges.sort_unstable_by_key(|r1| r1.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day22.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | queue.make_contiguous().sort_unstable_by(|a, b| (dist_to(&a.p, &goal) + a.dist).cmp(&(dist_to(&b.p, &goal) + b.dist))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 126 - queue.make_contiguous().sort_unstable_by(|a, b| (dist_to(&a.p, &goal) + a.dist).cmp(&(dist_to(&b.p, &goal) + b.dist))); [INFO] [stdout] 126 + queue.make_contiguous().sort_unstable_by_key(|a| dist_to(&a.p, &goal) + a.dist); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:60:23 [INFO] [stdout] | [INFO] [stdout] 60 | fn apply_operation(s: &mut Vec, operation: Operation) { [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] 60 ~ fn apply_operation(s: &mut [u8], operation: Operation) { [INFO] [stdout] 61 | use Operation::*; [INFO] [stdout] ... [INFO] [stdout] 75 | RotateSteps(direction, amount) => { [INFO] [stdout] 76 ~ let temp = s.to_owned(); [INFO] [stdout] 77 | let len = s.len(); [INFO] [stdout] ... [INFO] [stdout] 89 | let amount = 1 + i + if i >= 4 { 1 } else { 0 }; [INFO] [stdout] 90 ~ let temp = s.to_owned(); [INFO] [stdout] 91 | let len = s.len(); [INFO] [stdout] ... [INFO] [stdout] 96 | Reverse(x, y) => { [INFO] [stdout] 97 ~ let temp = s.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day22.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | |line| parse_line(line) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping elements of `s` manually [INFO] [stdout] --> src/day21.rs:65:13 [INFO] [stdout] | [INFO] [stdout] 65 | / let z = s[x]; [INFO] [stdout] 66 | | s[x] = s[y]; [INFO] [stdout] 67 | | s[y] = z; [INFO] [stdout] | |_____________________^ help: try: `s.swap(x, y);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day22.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | |line| parse_line(line) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day21.rs:121:26 [INFO] [stdout] | [INFO] [stdout] 121 | let mut s: Vec = "abcdefgh".as_bytes().into_iter().map(|b| *b).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `"abcdefgh".as_bytes().into_iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day21.rs:121:48 [INFO] [stdout] | [INFO] [stdout] 121 | let mut s: Vec = "abcdefgh".as_bytes().into_iter().map(|b| *b).collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:122:30 [INFO] [stdout] | [INFO] [stdout] 122 | source.split("\r\n").map(|line| parse_line(line)).for_each( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:128:27 [INFO] [stdout] | [INFO] [stdout] 128 | fn apply_operation_rev(s: &mut Vec, operation: Operation) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 128 ~ fn apply_operation_rev(s: &mut [u8], operation: Operation) { [INFO] [stdout] 129 | use Operation::*; [INFO] [stdout] ... [INFO] [stdout] 143 | RotateSteps(direction, amount) => { [INFO] [stdout] 144 ~ let temp = s.to_owned(); [INFO] [stdout] 145 | let len = s.len(); [INFO] [stdout] ... [INFO] [stdout] 165 | }; [INFO] [stdout] 166 ~ let temp = s.to_owned(); [INFO] [stdout] 167 | let len = s.len(); [INFO] [stdout] ... [INFO] [stdout] 172 | Reverse(x, y) => { [INFO] [stdout] 173 ~ let temp = s.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping elements of `s` manually [INFO] [stdout] --> src/day21.rs:133:13 [INFO] [stdout] | [INFO] [stdout] 133 | / let z = s[x]; [INFO] [stdout] 134 | | s[x] = s[y]; [INFO] [stdout] 135 | | s[y] = z; [INFO] [stdout] | |_____________________^ help: try: `s.swap(x, y);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day21.rs:197:26 [INFO] [stdout] | [INFO] [stdout] 197 | let mut s: Vec = "fbgdceah".as_bytes().into_iter().map(|b| *b).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `"fbgdceah".as_bytes().into_iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day21.rs:197:48 [INFO] [stdout] | [INFO] [stdout] 197 | let mut s: Vec = "fbgdceah".as_bytes().into_iter().map(|b| *b).collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:198:50 [INFO] [stdout] | [INFO] [stdout] 198 | let lines: Vec<_> = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day23.rs:117:22 [INFO] [stdout] | [INFO] [stdout] 117 | Increment => match current_instruction.arguments { [INFO] [stdout] | ______________________^ [INFO] [stdout] 118 | | One(Register(reg)) => state.registers[reg] += 1, [INFO] [stdout] 119 | | _ => () [INFO] [stdout] 120 | | }, [INFO] [stdout] | |_________^ help: try: `if let One(Register(reg)) = current_instruction.arguments { state.registers[reg] += 1 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/day23.rs:121:22 [INFO] [stdout] | [INFO] [stdout] 121 | Decrement => match current_instruction.arguments { [INFO] [stdout] | ______________________^ [INFO] [stdout] 122 | | One(Register(reg)) => state.registers[reg] -= 1, [INFO] [stdout] 123 | | _ => () [INFO] [stdout] 124 | | }, [INFO] [stdout] | |_________^ help: try: `if let One(Register(reg)) = current_instruction.arguments { state.registers[reg] -= 1 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/day23.rs:140:19 [INFO] [stdout] | [INFO] [stdout] 140 | Toggle => match current_instruction.arguments { [INFO] [stdout] | ___________________^ [INFO] [stdout] 141 | | One(Register(reg)) => { [INFO] [stdout] 142 | | let i = state.ip + state.registers[reg]; [INFO] [stdout] 143 | | if 0 <= i && (i as usize) < state.program.len() { [INFO] [stdout] ... | [INFO] [stdout] 164 | | _ => () [INFO] [stdout] 165 | | } [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] 140 ~ Toggle => if let One(Register(reg)) = current_instruction.arguments { [INFO] [stdout] 141 + let i = state.ip + state.registers[reg]; [INFO] [stdout] 142 + if 0 <= i && (i as usize) < state.program.len() { [INFO] [stdout] 143 + let previous_instruction = state.program[i as usize]; [INFO] [stdout] 144 + let new_instruction = match previous_instruction.arguments { [INFO] [stdout] 145 + One(arg) => Instruction { [INFO] [stdout] 146 + op: match previous_instruction.op { [INFO] [stdout] 147 + Increment => Decrement, [INFO] [stdout] 148 + _ => Increment [INFO] [stdout] 149 + }, [INFO] [stdout] 150 + arguments: One(arg) [INFO] [stdout] 151 + }, [INFO] [stdout] 152 + Two(arg1, arg2) => Instruction { [INFO] [stdout] 153 + op: match previous_instruction.op { [INFO] [stdout] 154 + Jump => Copy, [INFO] [stdout] 155 + _ => Jump [INFO] [stdout] 156 + }, [INFO] [stdout] 157 + arguments: Two(arg1, arg2) [INFO] [stdout] 158 + } [INFO] [stdout] 159 + }; [INFO] [stdout] 160 + state.program[i as usize] = new_instruction; [INFO] [stdout] 161 + } [INFO] [stdout] 162 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day23.rs:172:53 [INFO] [stdout] | [INFO] [stdout] 172 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day23.rs:184:53 [INFO] [stdout] | [INFO] [stdout] 184 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day22.rs:126:9 [INFO] [stdout] | [INFO] [stdout] 126 | queue.make_contiguous().sort_unstable_by(|a, b| (dist_to(&a.p, &goal) + a.dist).cmp(&(dist_to(&b.p, &goal) + b.dist))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 126 - queue.make_contiguous().sort_unstable_by(|a, b| (dist_to(&a.p, &goal) + a.dist).cmp(&(dist_to(&b.p, &goal) + b.dist))); [INFO] [stdout] 126 + queue.make_contiguous().sort_unstable_by_key(|a| dist_to(&a.p, &goal) + a.dist); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day22.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | |line| parse_line(line) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day24.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | queue.make_contiguous().sort_unstable_by(|a, b| (dist_to(&a.p, &goal) + a.dist).cmp(&(dist_to(&b.p, &goal) + b.dist))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 67 - queue.make_contiguous().sort_unstable_by(|a, b| (dist_to(&a.p, &goal) + a.dist).cmp(&(dist_to(&b.p, &goal) + b.dist))); [INFO] [stdout] 67 + queue.make_contiguous().sort_unstable_by_key(|a| dist_to(&a.p, &goal) + a.dist); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day22.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | |line| parse_line(line) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day24.rs:73:42 [INFO] [stdout] | [INFO] [stdout] 73 | line.as_bytes().iter().map(|b| *b != '#' as u8).collect() [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'#'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [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/day24.rs:81:18 [INFO] [stdout] | [INFO] [stdout] 81 | |(i, b)| match (*b as char).to_digit(10) { [INFO] [stdout] | __________________^ [INFO] [stdout] 82 | | Some(n) => pts.push((n as usize, point(i as i32, current_row as i32))), [INFO] [stdout] 83 | | None => () [INFO] [stdout] 84 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(n) = (*b as char).to_digit(10) { pts.push((n as usize, point(i as i32, current_row as i32))) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/day24.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | node.push(0); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `node.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:119:19 [INFO] [stdout] | [INFO] [stdout] 119 | graph[pair[0].0 as usize][pair[1].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ pair[0].0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:119:39 [INFO] [stdout] | [INFO] [stdout] 119 | graph[pair[0].0 as usize][pair[1].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `pair[1].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:120:19 [INFO] [stdout] | [INFO] [stdout] 120 | graph[pair[1].0 as usize][pair[0].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ pair[1].0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:120:39 [INFO] [stdout] | [INFO] [stdout] 120 | graph[pair[1].0 as usize][pair[0].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `pair[0].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/day24.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | node.push(0); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `node.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:153:19 [INFO] [stdout] | [INFO] [stdout] 153 | graph[pair[0].0 as usize][pair[1].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ pair[0].0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:153:39 [INFO] [stdout] | [INFO] [stdout] 153 | graph[pair[0].0 as usize][pair[1].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `pair[1].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day23.rs:117:22 [INFO] [stdout] | [INFO] [stdout] 117 | Increment => match current_instruction.arguments { [INFO] [stdout] | ______________________^ [INFO] [stdout] 118 | | One(Register(reg)) => state.registers[reg] += 1, [INFO] [stdout] 119 | | _ => () [INFO] [stdout] 120 | | }, [INFO] [stdout] | |_________^ help: try: `if let One(Register(reg)) = current_instruction.arguments { state.registers[reg] += 1 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:154:19 [INFO] [stdout] | [INFO] [stdout] 154 | graph[pair[1].0 as usize][pair[0].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ pair[1].0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day23.rs:121:22 [INFO] [stdout] | [INFO] [stdout] 121 | Decrement => match current_instruction.arguments { [INFO] [stdout] | ______________________^ [INFO] [stdout] 122 | | One(Register(reg)) => state.registers[reg] -= 1, [INFO] [stdout] 123 | | _ => () [INFO] [stdout] 124 | | }, [INFO] [stdout] | |_________^ help: try: `if let One(Register(reg)) = current_instruction.arguments { state.registers[reg] -= 1 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:154:39 [INFO] [stdout] | [INFO] [stdout] 154 | graph[pair[1].0 as usize][pair[0].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `pair[0].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day23.rs:140:19 [INFO] [stdout] | [INFO] [stdout] 140 | Toggle => match current_instruction.arguments { [INFO] [stdout] | ___________________^ [INFO] [stdout] 141 | | One(Register(reg)) => { [INFO] [stdout] 142 | | let i = state.ip + state.registers[reg]; [INFO] [stdout] 143 | | if 0 <= i && (i as usize) < state.program.len() { [INFO] [stdout] ... | [INFO] [stdout] 164 | | _ => () [INFO] [stdout] 165 | | } [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] 140 ~ Toggle => if let One(Register(reg)) = current_instruction.arguments { [INFO] [stdout] 141 + let i = state.ip + state.registers[reg]; [INFO] [stdout] 142 + if 0 <= i && (i as usize) < state.program.len() { [INFO] [stdout] 143 + let previous_instruction = state.program[i as usize]; [INFO] [stdout] 144 + let new_instruction = match previous_instruction.arguments { [INFO] [stdout] 145 + One(arg) => Instruction { [INFO] [stdout] 146 + op: match previous_instruction.op { [INFO] [stdout] 147 + Increment => Decrement, [INFO] [stdout] 148 + _ => Increment [INFO] [stdout] 149 + }, [INFO] [stdout] 150 + arguments: One(arg) [INFO] [stdout] 151 + }, [INFO] [stdout] 152 + Two(arg1, arg2) => Instruction { [INFO] [stdout] 153 + op: match previous_instruction.op { [INFO] [stdout] 154 + Jump => Copy, [INFO] [stdout] 155 + _ => Jump [INFO] [stdout] 156 + }, [INFO] [stdout] 157 + arguments: Two(arg1, arg2) [INFO] [stdout] 158 + } [INFO] [stdout] 159 + }; [INFO] [stdout] 160 + state.program[i as usize] = new_instruction; [INFO] [stdout] 161 + } [INFO] [stdout] 162 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day23.rs:172:53 [INFO] [stdout] | [INFO] [stdout] 172 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day23.rs:184:53 [INFO] [stdout] | [INFO] [stdout] 184 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/day24.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | queue.make_contiguous().sort_unstable_by(|a, b| (dist_to(&a.p, &goal) + a.dist).cmp(&(dist_to(&b.p, &goal) + b.dist))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 67 - queue.make_contiguous().sort_unstable_by(|a, b| (dist_to(&a.p, &goal) + a.dist).cmp(&(dist_to(&b.p, &goal) + b.dist))); [INFO] [stdout] 67 + queue.make_contiguous().sort_unstable_by_key(|a| dist_to(&a.p, &goal) + a.dist); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day24.rs:73:42 [INFO] [stdout] | [INFO] [stdout] 73 | line.as_bytes().iter().map(|b| *b != '#' as u8).collect() [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'#'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [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/day24.rs:81:18 [INFO] [stdout] | [INFO] [stdout] 81 | |(i, b)| match (*b as char).to_digit(10) { [INFO] [stdout] | __________________^ [INFO] [stdout] 82 | | Some(n) => pts.push((n as usize, point(i as i32, current_row as i32))), [INFO] [stdout] 83 | | None => () [INFO] [stdout] 84 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(n) = (*b as char).to_digit(10) { pts.push((n as usize, point(i as i32, current_row as i32))) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/day24.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | node.push(0); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `node.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` 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/day25.rs:129:22 [INFO] [stdout] | [INFO] [stdout] 129 | Increment => match current_instruction.arguments { [INFO] [stdout] | ______________________^ [INFO] [stdout] 130 | | One(Register(reg)) => state.registers[reg] += 1, [INFO] [stdout] 131 | | _ => () [INFO] [stdout] 132 | | }, [INFO] [stdout] | |_________^ help: try: `if let One(Register(reg)) = current_instruction.arguments { state.registers[reg] += 1 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/day25.rs:133:22 [INFO] [stdout] | [INFO] [stdout] 133 | Decrement => match current_instruction.arguments { [INFO] [stdout] | ______________________^ [INFO] [stdout] 134 | | One(Register(reg)) => state.registers[reg] -= 1, [INFO] [stdout] 135 | | _ => () [INFO] [stdout] 136 | | }, [INFO] [stdout] | |_________^ help: try: `if let One(Register(reg)) = current_instruction.arguments { state.registers[reg] -= 1 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:119:19 [INFO] [stdout] | [INFO] [stdout] 119 | graph[pair[0].0 as usize][pair[1].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ pair[0].0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:119:39 [INFO] [stdout] | [INFO] [stdout] 119 | graph[pair[0].0 as usize][pair[1].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `pair[1].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day25.rs:152:19 [INFO] [stdout] | [INFO] [stdout] 152 | Toggle => match current_instruction.arguments { [INFO] [stdout] | ___________________^ [INFO] [stdout] 153 | | One(Register(reg)) => { [INFO] [stdout] 154 | | let i = state.ip + state.registers[reg]; [INFO] [stdout] 155 | | if 0 <= i && (i as usize) < state.program.len() { [INFO] [stdout] ... | [INFO] [stdout] 176 | | _ => () [INFO] [stdout] 177 | | }, [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] 152 ~ Toggle => if let One(Register(reg)) = current_instruction.arguments { [INFO] [stdout] 153 + let i = state.ip + state.registers[reg]; [INFO] [stdout] 154 + if 0 <= i && (i as usize) < state.program.len() { [INFO] [stdout] 155 + let previous_instruction = state.program[i as usize]; [INFO] [stdout] 156 + let new_instruction = match previous_instruction.arguments { [INFO] [stdout] 157 + One(arg) => Instruction { [INFO] [stdout] 158 + op: match previous_instruction.op { [INFO] [stdout] 159 + Increment => Decrement, [INFO] [stdout] 160 + _ => Increment [INFO] [stdout] 161 + }, [INFO] [stdout] 162 + arguments: One(arg) [INFO] [stdout] 163 + }, [INFO] [stdout] 164 + Two(arg1, arg2) => Instruction { [INFO] [stdout] 165 + op: match previous_instruction.op { [INFO] [stdout] 166 + Jump => Copy, [INFO] [stdout] 167 + _ => Jump [INFO] [stdout] 168 + }, [INFO] [stdout] 169 + arguments: Two(arg1, arg2) [INFO] [stdout] 170 + } [INFO] [stdout] 171 + }; [INFO] [stdout] 172 + state.program[i as usize] = new_instruction; [INFO] [stdout] 173 + } [INFO] [stdout] 174 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:120:19 [INFO] [stdout] | [INFO] [stdout] 120 | graph[pair[1].0 as usize][pair[0].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ pair[1].0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:120:39 [INFO] [stdout] | [INFO] [stdout] 120 | graph[pair[1].0 as usize][pair[0].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `pair[0].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day25.rs:189:53 [INFO] [stdout] | [INFO] [stdout] 189 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/day24.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | node.push(0); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `node.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:153:19 [INFO] [stdout] | [INFO] [stdout] 153 | graph[pair[0].0 as usize][pair[1].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ pair[0].0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:153:39 [INFO] [stdout] | [INFO] [stdout] 153 | graph[pair[0].0 as usize][pair[1].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `pair[1].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:154:19 [INFO] [stdout] | [INFO] [stdout] 154 | graph[pair[1].0 as usize][pair[0].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ pair[1].0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day25.rs:203:13 [INFO] [stdout] | [INFO] [stdout] 203 | / match output { [INFO] [stdout] 204 | | Some(v) => if v == output_should_be { [INFO] [stdout] 205 | | if v == 1 && past_one_states.contains(&program_state) { [INFO] [stdout] 206 | | return i [INFO] [stdout] ... | [INFO] [stdout] 214 | | None => () [INFO] [stdout] 215 | | } [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] 203 ~ if let Some(v) = output { if v == output_should_be { [INFO] [stdout] 204 + if v == 1 && past_one_states.contains(&program_state) { [INFO] [stdout] 205 + return i [INFO] [stdout] 206 + } else if v == 1 { [INFO] [stdout] 207 + past_one_states.push(program_state.clone()) [INFO] [stdout] 208 + } [INFO] [stdout] 209 + output_should_be = (output_should_be + 1) % 2; // 0 -> 1, 1 -> 0 [INFO] [stdout] 210 + } else { [INFO] [stdout] 211 + break [INFO] [stdout] 212 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day24.rs:154:39 [INFO] [stdout] | [INFO] [stdout] 154 | graph[pair[1].0 as usize][pair[0].0 as usize] = dist; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `pair[0].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day25.rs:129:22 [INFO] [stdout] | [INFO] [stdout] 129 | Increment => match current_instruction.arguments { [INFO] [stdout] | ______________________^ [INFO] [stdout] 130 | | One(Register(reg)) => state.registers[reg] += 1, [INFO] [stdout] 131 | | _ => () [INFO] [stdout] 132 | | }, [INFO] [stdout] | |_________^ help: try: `if let One(Register(reg)) = current_instruction.arguments { state.registers[reg] += 1 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/day25.rs:133:22 [INFO] [stdout] | [INFO] [stdout] 133 | Decrement => match current_instruction.arguments { [INFO] [stdout] | ______________________^ [INFO] [stdout] 134 | | One(Register(reg)) => state.registers[reg] -= 1, [INFO] [stdout] 135 | | _ => () [INFO] [stdout] 136 | | }, [INFO] [stdout] | |_________^ help: try: `if let One(Register(reg)) = current_instruction.arguments { state.registers[reg] -= 1 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/day25.rs:152:19 [INFO] [stdout] | [INFO] [stdout] 152 | Toggle => match current_instruction.arguments { [INFO] [stdout] | ___________________^ [INFO] [stdout] 153 | | One(Register(reg)) => { [INFO] [stdout] 154 | | let i = state.ip + state.registers[reg]; [INFO] [stdout] 155 | | if 0 <= i && (i as usize) < state.program.len() { [INFO] [stdout] ... | [INFO] [stdout] 176 | | _ => () [INFO] [stdout] 177 | | }, [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] 152 ~ Toggle => if let One(Register(reg)) = current_instruction.arguments { [INFO] [stdout] 153 + let i = state.ip + state.registers[reg]; [INFO] [stdout] 154 + if 0 <= i && (i as usize) < state.program.len() { [INFO] [stdout] 155 + let previous_instruction = state.program[i as usize]; [INFO] [stdout] 156 + let new_instruction = match previous_instruction.arguments { [INFO] [stdout] 157 + One(arg) => Instruction { [INFO] [stdout] 158 + op: match previous_instruction.op { [INFO] [stdout] 159 + Increment => Decrement, [INFO] [stdout] 160 + _ => Increment [INFO] [stdout] 161 + }, [INFO] [stdout] 162 + arguments: One(arg) [INFO] [stdout] 163 + }, [INFO] [stdout] 164 + Two(arg1, arg2) => Instruction { [INFO] [stdout] 165 + op: match previous_instruction.op { [INFO] [stdout] 166 + Jump => Copy, [INFO] [stdout] 167 + _ => Jump [INFO] [stdout] 168 + }, [INFO] [stdout] 169 + arguments: Two(arg1, arg2) [INFO] [stdout] 170 + } [INFO] [stdout] 171 + }; [INFO] [stdout] 172 + state.program[i as usize] = new_instruction; [INFO] [stdout] 173 + } [INFO] [stdout] 174 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day25.rs:189:53 [INFO] [stdout] | [INFO] [stdout] 189 | let program: Program = source.split("\r\n").map(|line| parse_line(line)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day25.rs:203:13 [INFO] [stdout] | [INFO] [stdout] 203 | / match output { [INFO] [stdout] 204 | | Some(v) => if v == output_should_be { [INFO] [stdout] 205 | | if v == 1 && past_one_states.contains(&program_state) { [INFO] [stdout] 206 | | return i [INFO] [stdout] ... | [INFO] [stdout] 214 | | None => () [INFO] [stdout] 215 | | } [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] 203 ~ if let Some(v) = output { if v == output_should_be { [INFO] [stdout] 204 + if v == 1 && past_one_states.contains(&program_state) { [INFO] [stdout] 205 + return i [INFO] [stdout] 206 + } else if v == 1 { [INFO] [stdout] 207 + past_one_states.push(program_state.clone()) [INFO] [stdout] 208 + } [INFO] [stdout] 209 + output_should_be = (output_should_be + 1) % 2; // 0 -> 1, 1 -> 0 [INFO] [stdout] 210 + } else { [INFO] [stdout] 211 + break [INFO] [stdout] 212 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.83s [INFO] running `Command { std: "docker" "inspect" "9e9bede530670effb50a837e13c756be384d980016b3407e50df9ef869ef9335", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9e9bede530670effb50a837e13c756be384d980016b3407e50df9ef869ef9335", kill_on_drop: false }` [INFO] [stdout] 9e9bede530670effb50a837e13c756be384d980016b3407e50df9ef869ef9335