[INFO] cloning repository https://github.com/NotNotLuka/advent-of-code2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/NotNotLuka/advent-of-code2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNotNotLuka%2Fadvent-of-code2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNotNotLuka%2Fadvent-of-code2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] a8c2891b3d375fd0d26966c2f57f0991b59da3da [INFO] linting NotNotLuka/advent-of-code2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FNotNotLuka%2Fadvent-of-code2024" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/NotNotLuka/advent-of-code2024 [INFO] finished tweaking git repo https://github.com/NotNotLuka/advent-of-code2024 [INFO] tweaked toml for git repo https://github.com/NotNotLuka/advent-of-code2024 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/NotNotLuka/advent-of-code2024 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/NotNotLuka/advent-of-code2024 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-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 72d9cf27fa2da22b6d3534b22125a666692eaab6001f46e008d120841f8c0dba [INFO] running `Command { std: "docker" "start" "-a" "72d9cf27fa2da22b6d3534b22125a666692eaab6001f46e008d120841f8c0dba", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "72d9cf27fa2da22b6d3534b22125a666692eaab6001f46e008d120841f8c0dba", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "72d9cf27fa2da22b6d3534b22125a666692eaab6001f46e008d120841f8c0dba", kill_on_drop: false }` [INFO] [stdout] 72d9cf27fa2da22b6d3534b22125a666692eaab6001f46e008d120841f8c0dba [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 11ae4dddba9b272cea3f215cc3a4b515fda5e55d02119f4ea483ab00571fb3c4 [INFO] running `Command { std: "docker" "start" "-a" "11ae4dddba9b272cea3f215cc3a4b515fda5e55d02119f4ea483ab00571fb3c4", kill_on_drop: false }` [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking aoc v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/days/day16.rs:72:33 [INFO] [stdout] | [INFO] [stdout] 72 | let frst = Node{x: x, y: y, dir: 0}; [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] = 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/days/day16.rs:72:39 [INFO] [stdout] | [INFO] [stdout] 72 | let frst = Node{x: x, y: y, dir: 0}; [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/days/day16.rs:73:32 [INFO] [stdout] | [INFO] [stdout] 73 | let snd = Node{x: x, y: y, dir: 1}; [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/days/day16.rs:73:38 [INFO] [stdout] | [INFO] [stdout] 73 | let snd = Node{x: x, y: y, dir: 1}; [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/days/day16.rs:74:34 [INFO] [stdout] | [INFO] [stdout] 74 | let third = Node{x: x, y: y, dir: 2}; [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/days/day16.rs:74:40 [INFO] [stdout] | [INFO] [stdout] 74 | let third = Node{x: x, y: y, dir: 2}; [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/days/day16.rs:75:35 [INFO] [stdout] | [INFO] [stdout] 75 | let fourth = Node{x: x, y: y, dir: 3}; [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/days/day16.rs:75:41 [INFO] [stdout] | [INFO] [stdout] 75 | let fourth = Node{x: x, y: y, dir: 3}; [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/days/day16.rs:81:91 [INFO] [stdout] | [INFO] [stdout] 81 | all_moves.entry(snd.clone()).or_insert(Vec::new()).push((Node{x: x+1, y: y, dir: 1}, 1)); [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: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/days/day16.rs:83:20 [INFO] [stdout] | [INFO] [stdout] 83 | if 0 <= x - 1 && mapped[y as usize][(x - 1) as usize] == '.'{ [INFO] [stdout] | ^^^^^^^^^^ help: change it to: `0 < x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/days/day16.rs:84:94 [INFO] [stdout] | [INFO] [stdout] 84 | all_moves.entry(fourth.clone()).or_insert(Vec::new()).push((Node{x: x-1, y: y, dir: 3}, 1)); [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/days/day16.rs:88:84 [INFO] [stdout] | [INFO] [stdout] 88 | all_moves.entry(frst.clone()).or_insert(Vec::new()).push((Node{x: x, y: y + 1, dir: 0}, 1)); [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: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/days/day16.rs:90:20 [INFO] [stdout] | [INFO] [stdout] 90 | if 0 <= y - 1 && mapped[(y - 1) as usize][x as usize] == '.'{ [INFO] [stdout] | ^^^^^^^^^^ help: change it to: `0 < y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/days/day16.rs:91:85 [INFO] [stdout] | [INFO] [stdout] 91 | all_moves.entry(third.clone()).or_insert(Vec::new()).push((Node{x: x, y: y - 1, dir: 2}, 1)); [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/days/day16.rs:107:58 [INFO] [stdout] | [INFO] [stdout] 107 | let x = og_scores.get(&Node {x: end.0, y: end.1, dir: dir}).unwrap(); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `dir` [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/days/day16.rs:119:49 [INFO] [stdout] | [INFO] [stdout] 119 | let tmp_node = Node{x: end.0, y: end.1, dir: dir}; [INFO] [stdout] | ^^^^^^^^ help: replace it with: `dir` [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/days/day16.rs:72:33 [INFO] [stdout] | [INFO] [stdout] 72 | let frst = Node{x: x, y: y, dir: 0}; [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] = 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/days/day16.rs:72:39 [INFO] [stdout] | [INFO] [stdout] 72 | let frst = Node{x: x, y: y, dir: 0}; [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/days/day16.rs:73:32 [INFO] [stdout] | [INFO] [stdout] 73 | let snd = Node{x: x, y: y, dir: 1}; [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/days/day16.rs:73:38 [INFO] [stdout] | [INFO] [stdout] 73 | let snd = Node{x: x, y: y, dir: 1}; [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/days/day16.rs:74:34 [INFO] [stdout] | [INFO] [stdout] 74 | let third = Node{x: x, y: y, dir: 2}; [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/days/day16.rs:74:40 [INFO] [stdout] | [INFO] [stdout] 74 | let third = Node{x: x, y: y, dir: 2}; [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/days/day16.rs:75:35 [INFO] [stdout] | [INFO] [stdout] 75 | let fourth = Node{x: x, y: y, dir: 3}; [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/days/day16.rs:75:41 [INFO] [stdout] | [INFO] [stdout] 75 | let fourth = Node{x: x, y: y, dir: 3}; [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/days/day16.rs:81:91 [INFO] [stdout] | [INFO] [stdout] 81 | all_moves.entry(snd.clone()).or_insert(Vec::new()).push((Node{x: x+1, y: y, dir: 1}, 1)); [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: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/days/day16.rs:83:20 [INFO] [stdout] | [INFO] [stdout] 83 | if 0 <= x - 1 && mapped[y as usize][(x - 1) as usize] == '.'{ [INFO] [stdout] | ^^^^^^^^^^ help: change it to: `0 < x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/days/day16.rs:84:94 [INFO] [stdout] | [INFO] [stdout] 84 | all_moves.entry(fourth.clone()).or_insert(Vec::new()).push((Node{x: x-1, y: y, dir: 3}, 1)); [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/days/day16.rs:88:84 [INFO] [stdout] | [INFO] [stdout] 88 | all_moves.entry(frst.clone()).or_insert(Vec::new()).push((Node{x: x, y: y + 1, dir: 0}, 1)); [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: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/days/day16.rs:90:20 [INFO] [stdout] | [INFO] [stdout] 90 | if 0 <= y - 1 && mapped[(y - 1) as usize][x as usize] == '.'{ [INFO] [stdout] | ^^^^^^^^^^ help: change it to: `0 < y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/days/day16.rs:91:85 [INFO] [stdout] | [INFO] [stdout] 91 | all_moves.entry(third.clone()).or_insert(Vec::new()).push((Node{x: x, y: y - 1, dir: 2}, 1)); [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/days/day16.rs:107:58 [INFO] [stdout] | [INFO] [stdout] 107 | let x = og_scores.get(&Node {x: end.0, y: end.1, dir: dir}).unwrap(); [INFO] [stdout] | ^^^^^^^^ help: replace it with: `dir` [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/days/day16.rs:119:49 [INFO] [stdout] | [INFO] [stdout] 119 | let tmp_node = Node{x: end.0, y: end.1, dir: dir}; [INFO] [stdout] | ^^^^^^^^ help: replace it with: `dir` [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: this looks like you are trying to use `.. -= ..`, but you really are doing `.. = (- ..)` [INFO] [stdout] --> src/days/day21.rs:84:26 [INFO] [stdout] | [INFO] [stdout] 84 | '^' => {i=0;j=-1;}, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, use either `-=` or `= -` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_assignment_formatting [INFO] [stdout] = note: `#[warn(clippy::suspicious_assignment_formatting)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are trying to use `.. -= ..`, but you really are doing `.. = (- ..)` [INFO] [stdout] --> src/days/day21.rs:84:26 [INFO] [stdout] | [INFO] [stdout] 84 | '^' => {i=0;j=-1;}, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, use either `-=` or `= -` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_assignment_formatting [INFO] [stdout] = note: `#[warn(clippy::suspicious_assignment_formatting)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are trying to use `.. -= ..`, but you really are doing `.. = (- ..)` [INFO] [stdout] --> src/days/day21.rs:87:22 [INFO] [stdout] | [INFO] [stdout] 87 | '<' => {i=-1;j=0}, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, use either `-=` or `= -` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_assignment_formatting [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are trying to use `.. -= ..`, but you really are doing `.. = (- ..)` [INFO] [stdout] --> src/days/day21.rs:87:22 [INFO] [stdout] | [INFO] [stdout] 87 | '<' => {i=-1;j=0}, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, use either `-=` or `= -` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_assignment_formatting [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/days/day22.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | let a = cur ^ (cur * 64) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `cur ^ ((cur * 64) % 16777216)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] = note: `#[warn(clippy::precedence)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/days/day22.rs:9:13 [INFO] [stdout] | [INFO] [stdout] 9 | let b = a ^ (a / 32) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `a ^ ((a / 32) % 16777216)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/days/day22.rs:10:13 [INFO] [stdout] | [INFO] [stdout] 10 | let c = b ^ (b * 2048) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `b ^ ((b * 2048) % 16777216)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/days/day22.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | let a = cur ^ (cur * 64) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `cur ^ ((cur * 64) % 16777216)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] = note: `#[warn(clippy::precedence)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/days/day22.rs:9:13 [INFO] [stdout] | [INFO] [stdout] 9 | let b = a ^ (a / 32) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `a ^ ((a / 32) % 16777216)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/days/day22.rs:10:13 [INFO] [stdout] | [INFO] [stdout] 10 | let c = b ^ (b * 2048) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `b ^ ((b * 2048) % 16777216)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [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/days/day1.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / match n_appearences.get(&n) { [INFO] [stdout] 45 | | Some(×) => {answer2 += n * times;}, [INFO] [stdout] 46 | | None => (), [INFO] [stdout] 47 | | [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(×) = n_appearences.get(&n) {answer2 += n * times;}` [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] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `ind` is only used to index `levels` [INFO] [stdout] --> src/days/day2.rs:16:20 [INFO] [stdout] | [INFO] [stdout] 16 | for ind in 1..levels.len() { [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] 16 - for ind in 1..levels.len() { [INFO] [stdout] 16 + for in levels.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day2.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | return true; [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] 49 - return true; [INFO] [stdout] 49 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `ind` is only used to index `levels` [INFO] [stdout] --> src/days/day2.rs:38:16 [INFO] [stdout] | [INFO] [stdout] 38 | for ind in 1..levels.len() { [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] 38 - for ind in 1..levels.len() { [INFO] [stdout] 38 + for in levels.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `offs.get(0)` [INFO] [stdout] --> src/days/day3.rs:58:18 [INFO] [stdout] | [INFO] [stdout] 58 | ind > offs.get(0).unwrap() && ind > ons.get(0).unwrap(){ [INFO] [stdout] | ^^^^^^^^^^^ help: try: `offs.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `ons.get(0)` [INFO] [stdout] --> src/days/day3.rs:58:48 [INFO] [stdout] | [INFO] [stdout] 58 | ind > offs.get(0).unwrap() && ind > ons.get(0).unwrap(){ [INFO] [stdout] | ^^^^^^^^^^ help: try: `ons.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 if-then-else expression assigns a bool literal [INFO] [stdout] --> src/days/day3.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | / if offs.get(0).unwrap() < ons.get(0).unwrap() {on = true;} [INFO] [stdout] 60 | | else {on = false;} [INFO] [stdout] | |______________________________^ help: you can reduce it to: `on = offs.get(0).unwrap() < ons.get(0).unwrap();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `offs.get(0)` [INFO] [stdout] --> src/days/day3.rs:59:16 [INFO] [stdout] | [INFO] [stdout] 59 | if offs.get(0).unwrap() < ons.get(0).unwrap() {on = true;} [INFO] [stdout] | ^^^^^^^^^^^ help: try: `offs.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 `ons.get(0)` [INFO] [stdout] --> src/days/day3.rs:59:39 [INFO] [stdout] | [INFO] [stdout] 59 | if offs.get(0).unwrap() < ons.get(0).unwrap() {on = true;} [INFO] [stdout] | ^^^^^^^^^^ help: try: `ons.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 `offs.get(0)` [INFO] [stdout] --> src/days/day3.rs:64:20 [INFO] [stdout] | [INFO] [stdout] 64 | ind > offs.get(0).unwrap(){ [INFO] [stdout] | ^^^^^^^^^^^ help: try: `offs.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 `ons.get(0)` [INFO] [stdout] --> src/days/day3.rs:68:20 [INFO] [stdout] | [INFO] [stdout] 68 | ind > ons.get(0).unwrap(){ [INFO] [stdout] | ^^^^^^^^^^ help: try: `ons.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: unneeded `return` statement [INFO] [stdout] --> src/days/day4.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | return n; [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 n; [INFO] [stdout] 23 + n [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day4.rs:5:16 [INFO] [stdout] | [INFO] [stdout] 5 | fn count(grid: &Vec>, options: Vec>>, code_chars: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - fn count(grid: &Vec>, options: Vec>>, code_chars: Vec) -> i32 { [INFO] [stdout] 5 + fn count(grid: &[Vec], options: Vec>>, code_chars: Vec) -> i32 { [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/days/day1.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / match n_appearences.get(&n) { [INFO] [stdout] 45 | | Some(×) => {answer2 += n * times;}, [INFO] [stdout] 46 | | None => (), [INFO] [stdout] 47 | | [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(×) = n_appearences.get(&n) {answer2 += n * times;}` [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] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/days/day4.rs:41:47 [INFO] [stdout] | [INFO] [stdout] 41 | options.push((0..code.len()).map(|i| vec![0 as i32, -(i as i32)]).collect()); [INFO] [stdout] | ^^^^^^^^ help: try: `0_i32` [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: the loop variable `ind` is only used to index `levels` [INFO] [stdout] --> src/days/day2.rs:16:20 [INFO] [stdout] | [INFO] [stdout] 16 | for ind in 1..levels.len() { [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] 16 - for ind in 1..levels.len() { [INFO] [stdout] 16 + for in levels.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/days/day4.rs:42:47 [INFO] [stdout] | [INFO] [stdout] 42 | options.push((0..code.len()).map(|i| vec![0 as i32, i as i32]).collect()); [INFO] [stdout] | ^^^^^^^^ help: try: `0_i32` [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: unneeded `return` statement [INFO] [stdout] --> src/days/day2.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | return true; [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] 49 - return true; [INFO] [stdout] 49 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `ind` is only used to index `levels` [INFO] [stdout] --> src/days/day2.rs:38:16 [INFO] [stdout] | [INFO] [stdout] 38 | for ind in 1..levels.len() { [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] 38 - for ind in 1..levels.len() { [INFO] [stdout] 38 + for in levels.iter().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/days/day4.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | / let mut options: Vec>> = Vec::new(); [INFO] [stdout] 40 | | [INFO] [stdout] 41 | | options.push((0..code.len()).map(|i| vec![0 as i32, -(i as i32)]).collect()); [INFO] [stdout] 42 | | options.push((0..code.len()).map(|i| vec![0 as i32, i as i32]).collect()); [INFO] [stdout] ... | [INFO] [stdout] 47 | | options.push((0..code.len()).map(|i| vec![i as i32, -(i as i32)]).collect()); [INFO] [stdout] 48 | | options.push((0..code.len()).map(|i| vec![-(i as i32), i as i32]).collect()); [INFO] [stdout] | |_________________________________________________________________________________^ help: consider using the `vec![]` macro: `let options: Vec>> = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day5.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | return legal; [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 legal; [INFO] [stdout] 21 + legal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day5.rs:7:27 [INFO] [stdout] | [INFO] [stdout] 7 | fn check_if_valid(update: &Vec, rules: &HashMap>) -> bool { [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] 7 - fn check_if_valid(update: &Vec, rules: &HashMap>) -> bool { [INFO] [stdout] 7 + fn check_if_valid(update: &[i32], rules: &HashMap>) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day5.rs:16:37 [INFO] [stdout] | [INFO] [stdout] 16 | if !&rules.contains_key(&x){continue;} [INFO] [stdout] | ^^ help: change this to: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day5.rs:17:35 [INFO] [stdout] | [INFO] [stdout] 17 | for no_nums in &rules[&x]{ [INFO] [stdout] | ^^ help: change this to: `x` [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/days/day5.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | return update.clone(); [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] 42 - return update.clone(); [INFO] [stdout] 42 + update.clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day5.rs:25:20 [INFO] [stdout] | [INFO] [stdout] 25 | fn get_new(update: &Vec, rules: &HashMap>) -> Vec { [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] 25 ~ fn get_new(update: &[i32], rules: &HashMap>) -> Vec { [INFO] [stdout] 26 | let reversed: Vec = update.iter().rev().cloned().collect(); [INFO] [stdout] ... [INFO] [stdout] 33 | if rules[&candidate].contains(&y){ [INFO] [stdout] 34 ~ let mut new = update.to_owned(); [INFO] [stdout] 35 | new.remove(new.len() - x - 1); [INFO] [stdout] ... [INFO] [stdout] 41 | } [INFO] [stdout] 42 ~ return update.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `offs.get(0)` [INFO] [stdout] --> src/days/day3.rs:58:18 [INFO] [stdout] | [INFO] [stdout] 58 | ind > offs.get(0).unwrap() && ind > ons.get(0).unwrap(){ [INFO] [stdout] | ^^^^^^^^^^^ help: try: `offs.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `ons.get(0)` [INFO] [stdout] --> src/days/day3.rs:58:48 [INFO] [stdout] | [INFO] [stdout] 58 | ind > offs.get(0).unwrap() && ind > ons.get(0).unwrap(){ [INFO] [stdout] | ^^^^^^^^^^ help: try: `ons.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/days/day5.rs:37:42 [INFO] [stdout] | [INFO] [stdout] 37 | return get_new(&new, &rules); [INFO] [stdout] | ^^^^^^ help: change this to: `rules` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/days/day3.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | / if offs.get(0).unwrap() < ons.get(0).unwrap() {on = true;} [INFO] [stdout] 60 | | else {on = false;} [INFO] [stdout] | |______________________________^ help: you can reduce it to: `on = offs.get(0).unwrap() < ons.get(0).unwrap();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `offs.get(0)` [INFO] [stdout] --> src/days/day3.rs:59:16 [INFO] [stdout] | [INFO] [stdout] 59 | if offs.get(0).unwrap() < ons.get(0).unwrap() {on = true;} [INFO] [stdout] | ^^^^^^^^^^^ help: try: `offs.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 `ons.get(0)` [INFO] [stdout] --> src/days/day3.rs:59:39 [INFO] [stdout] | [INFO] [stdout] 59 | if offs.get(0).unwrap() < ons.get(0).unwrap() {on = true;} [INFO] [stdout] | ^^^^^^^^^^ help: try: `ons.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 `offs.get(0)` [INFO] [stdout] --> src/days/day3.rs:64:20 [INFO] [stdout] | [INFO] [stdout] 64 | ind > offs.get(0).unwrap(){ [INFO] [stdout] | ^^^^^^^^^^^ help: try: `offs.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 `ons.get(0)` [INFO] [stdout] --> src/days/day3.rs:68:20 [INFO] [stdout] | [INFO] [stdout] 68 | ind > ons.get(0).unwrap(){ [INFO] [stdout] | ^^^^^^^^^^ help: try: `ons.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: unneeded `return` statement [INFO] [stdout] --> src/days/day4.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | return n; [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 n; [INFO] [stdout] 23 + n [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day4.rs:5:16 [INFO] [stdout] | [INFO] [stdout] 5 | fn count(grid: &Vec>, options: Vec>>, code_chars: Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - fn count(grid: &Vec>, options: Vec>>, code_chars: Vec) -> i32 { [INFO] [stdout] 5 + fn count(grid: &[Vec], options: Vec>>, code_chars: Vec) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day6.rs:5:63 [INFO] [stdout] | [INFO] [stdout] 5 | fn check_for_loop(start: (i32, i32), dir: (i32, i32), mapped: &Vec>) -> bool { [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] 5 - fn check_for_loop(start: (i32, i32), dir: (i32, i32), mapped: &Vec>) -> bool { [INFO] [stdout] 5 + fn check_for_loop(start: (i32, i32), dir: (i32, i32), mapped: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/days/day6.rs:10:24 [INFO] [stdout] | [INFO] [stdout] 10 | let new_pos = ((pos.0 as i32) + dir.0, (pos.1 as i32) + dir.1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.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 (`i32` -> `i32`) [INFO] [stdout] --> src/days/day6.rs:10:48 [INFO] [stdout] | [INFO] [stdout] 10 | let new_pos = ((pos.0 as i32) + dir.0, (pos.1 as i32) + dir.1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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: literal with an empty format string [INFO] [stdout] --> src/days/day6.rs:22:38 [INFO] [stdout] | [INFO] [stdout] 22 | _ => eprintln!("{}", "Unknown direction"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] = note: `#[warn(clippy::print_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 - _ => eprintln!("{}", "Unknown direction"), [INFO] [stdout] 22 + _ => eprintln!("Unknown direction"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/days/day4.rs:41:47 [INFO] [stdout] | [INFO] [stdout] 41 | options.push((0..code.len()).map(|i| vec![0 as i32, -(i as i32)]).collect()); [INFO] [stdout] | ^^^^^^^^ help: try: `0_i32` [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 integer literal to `i32` is unnecessary [INFO] [stdout] --> src/days/day4.rs:42:47 [INFO] [stdout] | [INFO] [stdout] 42 | options.push((0..code.len()).map(|i| vec![0 as i32, i as i32]).collect()); [INFO] [stdout] | ^^^^^^^^ help: try: `0_i32` [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/days/day6.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | / match line.chars().position(|c| c == '^') { [INFO] [stdout] 43 | | Some(index) => start = (index as i32, ind as i32), [INFO] [stdout] 44 | | None => (), [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(index) = line.chars().position(|c| c == '^') { start = (index as i32, ind 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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/days/day6.rs:52:24 [INFO] [stdout] | [INFO] [stdout] 52 | let new_pos = ((pos.0 as i32) + dir.0, (pos.1 as i32) + dir.1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.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 (`i32` -> `i32`) [INFO] [stdout] --> src/days/day6.rs:52:48 [INFO] [stdout] | [INFO] [stdout] 52 | let new_pos = ((pos.0 as i32) + dir.0, (pos.1 as i32) + dir.1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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: calls to `push` immediately after creation [INFO] [stdout] --> src/days/day4.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | / let mut options: Vec>> = Vec::new(); [INFO] [stdout] 40 | | [INFO] [stdout] 41 | | options.push((0..code.len()).map(|i| vec![0 as i32, -(i as i32)]).collect()); [INFO] [stdout] 42 | | options.push((0..code.len()).map(|i| vec![0 as i32, i as i32]).collect()); [INFO] [stdout] ... | [INFO] [stdout] 47 | | options.push((0..code.len()).map(|i| vec![i as i32, -(i as i32)]).collect()); [INFO] [stdout] 48 | | options.push((0..code.len()).map(|i| vec![-(i as i32), i as i32]).collect()); [INFO] [stdout] | |_________________________________________________________________________________^ help: consider using the `vec![]` macro: `let options: Vec>> = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/days/day6.rs:62:38 [INFO] [stdout] | [INFO] [stdout] 62 | _ => eprintln!("{}", "Unknown direction"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 62 - _ => eprintln!("{}", "Unknown direction"), [INFO] [stdout] 62 + _ => eprintln!("Unknown direction"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day7.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | return part1 || solve_eq(&combine, y, Some(first)); [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] 28 - return part1 || solve_eq(&combine, y, Some(first)); [INFO] [stdout] 28 + part1 || solve_eq(&combine, y, Some(first)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day5.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | return legal; [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 legal; [INFO] [stdout] 21 + legal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day7.rs:9:17 [INFO] [stdout] | [INFO] [stdout] 9 | fn solve_eq(xs: &Vec, y: i64, first: Option) -> bool{ [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] 9 - fn solve_eq(xs: &Vec, y: i64, first: Option) -> bool{ [INFO] [stdout] 9 + fn solve_eq(xs: &[i64], y: i64, first: Option) -> bool{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day5.rs:7:27 [INFO] [stdout] | [INFO] [stdout] 7 | fn check_if_valid(update: &Vec, rules: &HashMap>) -> bool { [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] 7 - fn check_if_valid(update: &Vec, rules: &HashMap>) -> bool { [INFO] [stdout] 7 + fn check_if_valid(update: &[i32], rules: &HashMap>) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day7.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | mul[0] = cur * mul[0]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `mul[0] *= cur` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` 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/days/day5.rs:16:37 [INFO] [stdout] | [INFO] [stdout] 16 | if !&rules.contains_key(&x){continue;} [INFO] [stdout] | ^^ help: change this to: `x` [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: manual implementation of an assign operation [INFO] [stdout] --> src/days/day7.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | plus[0] = cur + plus[0]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `plus[0] += cur` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day5.rs:17:35 [INFO] [stdout] | [INFO] [stdout] 17 | for no_nums in &rules[&x]{ [INFO] [stdout] | ^^ help: change this to: `x` [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/days/day5.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | return update.clone(); [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] 42 - return update.clone(); [INFO] [stdout] 42 + update.clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day5.rs:25:20 [INFO] [stdout] | [INFO] [stdout] 25 | fn get_new(update: &Vec, rules: &HashMap>) -> Vec { [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] 25 ~ fn get_new(update: &[i32], rules: &HashMap>) -> Vec { [INFO] [stdout] 26 | let reversed: Vec = update.iter().rev().cloned().collect(); [INFO] [stdout] ... [INFO] [stdout] 33 | if rules[&candidate].contains(&y){ [INFO] [stdout] 34 ~ let mut new = update.to_owned(); [INFO] [stdout] 35 | new.remove(new.len() - x - 1); [INFO] [stdout] ... [INFO] [stdout] 41 | } [INFO] [stdout] 42 ~ return update.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day5.rs:37:42 [INFO] [stdout] | [INFO] [stdout] 37 | return get_new(&new, &rules); [INFO] [stdout] | ^^^^^^ help: change this to: `rules` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days/day8.rs:59:29 [INFO] [stdout] | [INFO] [stdout] 59 | if (dy1 == 0 && dy2 == 0) || [INFO] [stdout] | _____________________________^ [INFO] [stdout] 60 | | (dx1 == 0 && dy1 == 0) || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 59 - if (dy1 == 0 && dy2 == 0) || [INFO] [stdout] 60 - (dx1 == 0 && dy1 == 0) || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] 59 + if !(dy1 != 0 || dy2 != 0 && dx1 != 0) || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] | [INFO] [stdout] 59 - if (dy1 == 0 && dy2 == 0) || [INFO] [stdout] 60 - (dx1 == 0 && dy1 == 0) || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] 59 + if (dx1 == 0 || dy2 == 0) && dy1 == 0 || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/days/day8.rs:21:26 [INFO] [stdout] | [INFO] [stdout] 21 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day6.rs:5:63 [INFO] [stdout] | [INFO] [stdout] 5 | fn check_for_loop(start: (i32, i32), dir: (i32, i32), mapped: &Vec>) -> bool { [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] 5 - fn check_for_loop(start: (i32, i32), dir: (i32, i32), mapped: &Vec>) -> bool { [INFO] [stdout] 5 + fn check_for_loop(start: (i32, i32), dir: (i32, i32), mapped: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day8.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | let mut distances: Vec>> = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/days/day6.rs:10:24 [INFO] [stdout] | [INFO] [stdout] 10 | let new_pos = ((pos.0 as i32) + dir.0, (pos.1 as i32) + dir.1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.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 (`i32` -> `i32`) [INFO] [stdout] --> src/days/day6.rs:10:48 [INFO] [stdout] | [INFO] [stdout] 10 | let new_pos = ((pos.0 as i32) + dir.0, (pos.1 as i32) + dir.1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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: literal with an empty format string [INFO] [stdout] --> src/days/day6.rs:22:38 [INFO] [stdout] | [INFO] [stdout] 22 | _ => eprintln!("{}", "Unknown direction"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] = note: `#[warn(clippy::print_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 - _ => eprintln!("{}", "Unknown direction"), [INFO] [stdout] 22 + _ => eprintln!("Unknown direction"), [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/days/day6.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | / match line.chars().position(|c| c == '^') { [INFO] [stdout] 43 | | Some(index) => start = (index as i32, ind as i32), [INFO] [stdout] 44 | | None => (), [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(index) = line.chars().position(|c| c == '^') { start = (index as i32, ind 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: unneeded `return` statement [INFO] [stdout] --> src/days/day9.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | 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] 9 - return false; [INFO] [stdout] 9 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/days/day6.rs:52:24 [INFO] [stdout] | [INFO] [stdout] 52 | let new_pos = ((pos.0 as i32) + dir.0, (pos.1 as i32) + dir.1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.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 (`i32` -> `i32`) [INFO] [stdout] --> src/days/day6.rs:52:48 [INFO] [stdout] | [INFO] [stdout] 52 | let new_pos = ((pos.0 as i32) + dir.0, (pos.1 as i32) + dir.1); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day9.rs:4:24 [INFO] [stdout] | [INFO] [stdout] 4 | fn empty_space(memory: &Vec<(i64, i64)>) -> bool{ [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] 4 - fn empty_space(memory: &Vec<(i64, i64)>) -> bool{ [INFO] [stdout] 4 + fn empty_space(memory: &[(i64, i64)]) -> bool{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `memory` [INFO] [stdout] --> src/days/day9.rs:5:14 [INFO] [stdout] | [INFO] [stdout] 5 | for i in 0..(memory.len() - 1){ [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] 5 - for i in 0..(memory.len() - 1){ [INFO] [stdout] 5 + for in memory.iter().take((memory.len() - 1)){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day9.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | return checksum; [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 checksum; [INFO] [stdout] 23 + checksum [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/days/day6.rs:62:38 [INFO] [stdout] | [INFO] [stdout] 62 | _ => eprintln!("{}", "Unknown direction"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 62 - _ => eprintln!("{}", "Unknown direction"), [INFO] [stdout] 62 + _ => eprintln!("Unknown direction"), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day9.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | return check_sum(&memory); [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] 53 - return check_sum(&memory); [INFO] [stdout] 53 + check_sum(&memory) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/days/day9.rs:34:24 [INFO] [stdout] | [INFO] [stdout] 34 | memory[ind as usize] = (x - last_x, -1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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/days/day9.rs:36:31 [INFO] [stdout] | [INFO] [stdout] 36 | memory.insert(ind as usize, (last_x, last_mem)); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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/days/day9.rs:39:31 [INFO] [stdout] | [INFO] [stdout] 39 | memory.remove(ind as usize); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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/days/day9.rs:40:31 [INFO] [stdout] | [INFO] [stdout] 40 | memory.insert(ind as usize, (x, last_mem)); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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: unneeded `return` statement [INFO] [stdout] --> src/days/day9.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | return check_sum(&memory); [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] 82 - return check_sum(&memory); [INFO] [stdout] 82 + check_sum(&memory) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day7.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | return part1 || solve_eq(&combine, y, Some(first)); [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] 28 - return part1 || solve_eq(&combine, y, Some(first)); [INFO] [stdout] 28 + part1 || solve_eq(&combine, y, Some(first)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day7.rs:9:17 [INFO] [stdout] | [INFO] [stdout] 9 | fn solve_eq(xs: &Vec, y: i64, first: Option) -> bool{ [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] 9 - fn solve_eq(xs: &Vec, y: i64, first: Option) -> bool{ [INFO] [stdout] 9 + fn solve_eq(xs: &[i64], y: i64, first: Option) -> bool{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day7.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | mul[0] = cur * mul[0]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `mul[0] *= cur` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day7.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | plus[0] = cur + plus[0]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `plus[0] += cur` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/days/day9.rs:70:28 [INFO] [stdout] | [INFO] [stdout] 70 | memory[ind as usize] = (x - last_x, -1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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/days/day9.rs:74:31 [INFO] [stdout] | [INFO] [stdout] 74 | memory.insert(ind as usize, (last_x, last_mem)); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day9.rs:93:21 [INFO] [stdout] | [INFO] [stdout] 93 | .filter(|c| c.is_digit(10)) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days/day8.rs:59:29 [INFO] [stdout] | [INFO] [stdout] 59 | if (dy1 == 0 && dy2 == 0) || [INFO] [stdout] | _____________________________^ [INFO] [stdout] 60 | | (dx1 == 0 && dy1 == 0) || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] | |__________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 59 - if (dy1 == 0 && dy2 == 0) || [INFO] [stdout] 60 - (dx1 == 0 && dy1 == 0) || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] 59 + if !(dy1 != 0 || dy2 != 0 && dx1 != 0) || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] | [INFO] [stdout] 59 - if (dy1 == 0 && dy2 == 0) || [INFO] [stdout] 60 - (dx1 == 0 && dy1 == 0) || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] 59 + if (dx1 == 0 || dy2 == 0) && dy1 == 0 || (dx2 == 0 && dy2 == 00) || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day10.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | return format!("{}-{}", nxt.0, nxt.1); [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] 7 - return format!("{}-{}", nxt.0, nxt.1); [INFO] [stdout] 7 + format!("{}-{}", nxt.0, nxt.1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/days/day8.rs:21:26 [INFO] [stdout] | [INFO] [stdout] 21 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day10.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | return (n, m); [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] 57 - return (n, m); [INFO] [stdout] 57 + (n, m) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day10.rs:10:19 [INFO] [stdout] | [INFO] [stdout] 10 | fn part_1(mapped: &Vec>) -> (i32, i32){ [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 10 - fn part_1(mapped: &Vec>) -> (i32, i32){ [INFO] [stdout] 10 + fn part_1(mapped: &[Vec]) -> (i32, i32){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day8.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | let mut distances: Vec>> = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day10.rs:23:11 [INFO] [stdout] | [INFO] [stdout] 23 | while to_do.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_do.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/days/day10.rs:38:53 [INFO] [stdout] | [INFO] [stdout] 38 | all_nines1.entry(begin.clone()).or_insert_with(HashSet::new).insert(end); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day9.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | 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] 9 - return false; [INFO] [stdout] 9 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day9.rs:4:24 [INFO] [stdout] | [INFO] [stdout] 4 | fn empty_space(memory: &Vec<(i64, i64)>) -> bool{ [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] 4 - fn empty_space(memory: &Vec<(i64, i64)>) -> bool{ [INFO] [stdout] 4 + fn empty_space(memory: &[(i64, i64)]) -> bool{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `memory` [INFO] [stdout] --> src/days/day9.rs:5:14 [INFO] [stdout] | [INFO] [stdout] 5 | for i in 0..(memory.len() - 1){ [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] 5 - for i in 0..(memory.len() - 1){ [INFO] [stdout] 5 + for in memory.iter().take((memory.len() - 1)){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day11.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | return new_stones; [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] 26 - return new_stones; [INFO] [stdout] 26 + new_stones [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day9.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | return checksum; [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 checksum; [INFO] [stdout] 23 + checksum [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/days/day11.rs:16:27 [INFO] [stdout] | [INFO] [stdout] 16 | let mid = (pwr + 1) / 2; [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `pwr.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: unneeded `return` statement [INFO] [stdout] --> src/days/day9.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | return check_sum(&memory); [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] 53 - return check_sum(&memory); [INFO] [stdout] 53 + check_sum(&memory) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/days/day9.rs:34:24 [INFO] [stdout] | [INFO] [stdout] 34 | memory[ind as usize] = (x - last_x, -1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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/days/day9.rs:36:31 [INFO] [stdout] | [INFO] [stdout] 36 | memory.insert(ind as usize, (last_x, last_mem)); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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/days/day9.rs:39:31 [INFO] [stdout] | [INFO] [stdout] 39 | memory.remove(ind as usize); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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/days/day9.rs:40:31 [INFO] [stdout] | [INFO] [stdout] 40 | memory.insert(ind as usize, (x, last_mem)); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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 want to iterate on a map's values [INFO] [stdout] --> src/days/day11.rs:47:29 [INFO] [stdout] | [INFO] [stdout] 47 | for (_, val) in &hash_stones{ [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 47 - for (_, val) in &hash_stones{ [INFO] [stdout] 47 + for val in hash_stones.values(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day9.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | return check_sum(&memory); [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] 82 - return check_sum(&memory); [INFO] [stdout] 82 + check_sum(&memory) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day12.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | return perimeter; [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] 19 - return perimeter; [INFO] [stdout] 19 + perimeter [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day12.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 77 | return sides; [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] 77 - return sides; [INFO] [stdout] 77 + sides [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/days/day9.rs:70:28 [INFO] [stdout] | [INFO] [stdout] 70 | memory[ind as usize] = (x - last_x, -1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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/days/day9.rs:74:31 [INFO] [stdout] | [INFO] [stdout] 74 | memory.insert(ind as usize, (last_x, last_mem)); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ind` [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: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day9.rs:93:21 [INFO] [stdout] | [INFO] [stdout] 93 | .filter(|c| c.is_digit(10)) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `c.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day12.rs:37:55 [INFO] [stdout] | [INFO] [stdout] 37 | (-1, 0) => {x_sides_left.entry(x).or_insert(Vec::new()).push((x, y))}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day12.rs:38:55 [INFO] [stdout] | [INFO] [stdout] 38 | (1, 0) => {x_sides_right.entry(x).or_insert(Vec::new()).push((x, y))}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day12.rs:39:54 [INFO] [stdout] | [INFO] [stdout] 39 | (0, 1) => {y_sides_down.entry(y).or_insert(Vec::new()).push((x, y))}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day12.rs:40:53 [INFO] [stdout] | [INFO] [stdout] 40 | (0, -1) => {y_sides_up.entry(y).or_insert(Vec::new()).push((x, y))} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day10.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | return format!("{}-{}", nxt.0, nxt.1); [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] 7 - return format!("{}-{}", nxt.0, nxt.1); [INFO] [stdout] 7 + format!("{}-{}", nxt.0, nxt.1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day10.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | return (n, m); [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] 57 - return (n, m); [INFO] [stdout] 57 + (n, m) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day10.rs:10:19 [INFO] [stdout] | [INFO] [stdout] 10 | fn part_1(mapped: &Vec>) -> (i32, i32){ [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 10 - fn part_1(mapped: &Vec>) -> (i32, i32){ [INFO] [stdout] 10 + fn part_1(mapped: &[Vec]) -> (i32, i32){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day10.rs:23:11 [INFO] [stdout] | [INFO] [stdout] 23 | while to_do.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_do.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day12.rs:122:5 [INFO] [stdout] | [INFO] [stdout] 122 | return (n1, n2); [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] 122 - return (n1, n2); [INFO] [stdout] 122 + (n1, n2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/days/day12.rs:86:46 [INFO] [stdout] | [INFO] [stdout] 86 | let mut been_to: Vec> = mapped.into_iter().map(|x| x.into_iter().map(|_| false).collect()).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: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/days/day12.rs:86:68 [INFO] [stdout] | [INFO] [stdout] 86 | let mut been_to: Vec> = mapped.into_iter().map(|x| x.into_iter().map(|_| false).collect()).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: length comparison to zero [INFO] [stdout] --> src/days/day12.rs:96:15 [INFO] [stdout] | [INFO] [stdout] 96 | while next_move.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next_move.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/days/day10.rs:38:53 [INFO] [stdout] | [INFO] [stdout] 38 | all_nines1.entry(begin.clone()).or_insert_with(HashSet::new).insert(end); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day11.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | return new_stones; [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] 26 - return new_stones; [INFO] [stdout] 26 + new_stones [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/days/day11.rs:16:27 [INFO] [stdout] | [INFO] [stdout] 16 | let mid = (pwr + 1) / 2; [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `pwr.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: unneeded `return` statement [INFO] [stdout] --> src/days/day13.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return (x, y); [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] 10 - return (x, y); [INFO] [stdout] 10 + (x, y) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day13.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | return tokens; [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] 28 - return tokens; [INFO] [stdout] 28 + tokens [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/days/day11.rs:47:29 [INFO] [stdout] | [INFO] [stdout] 47 | for (_, val) in &hash_stones{ [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 47 - for (_, val) in &hash_stones{ [INFO] [stdout] 47 + for val in hash_stones.values(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day12.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | return perimeter; [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] 19 - return perimeter; [INFO] [stdout] 19 + perimeter [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:14:26 [INFO] [stdout] | [INFO] [stdout] 14 | fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [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] 14 - fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] 14 + fn get_tokens(a_buttons: &[(i64, i64)], b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:14:55 [INFO] [stdout] | [INFO] [stdout] 14 | fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [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] 14 - fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] 14 + fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &[(i64, i64)], prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:14:81 [INFO] [stdout] | [INFO] [stdout] 14 | fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [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] 14 - fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] 14 + fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &[(i64, i64)]) -> i64{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day13.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 46 | if line.len() == 0{n_line = 0;continue;} [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day12.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 77 | return sides; [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] 77 - return sides; [INFO] [stdout] 77 + sides [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day12.rs:37:55 [INFO] [stdout] | [INFO] [stdout] 37 | (-1, 0) => {x_sides_left.entry(x).or_insert(Vec::new()).push((x, y))}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day12.rs:38:55 [INFO] [stdout] | [INFO] [stdout] 38 | (1, 0) => {x_sides_right.entry(x).or_insert(Vec::new()).push((x, y))}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day12.rs:39:54 [INFO] [stdout] | [INFO] [stdout] 39 | (0, 1) => {y_sides_down.entry(y).or_insert(Vec::new()).push((x, y))}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day14.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | return ((x, y), (vx, vy)); [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] 13 - return ((x, y), (vx, vy)); [INFO] [stdout] 13 + ((x, y), (vx, vy)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day12.rs:40:53 [INFO] [stdout] | [INFO] [stdout] 40 | (0, -1) => {y_sides_up.entry(y).or_insert(Vec::new()).push((x, y))} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day14.rs:37:22 [INFO] [stdout] | [INFO] [stdout] 37 | if x_pos < 0{x_pos = width + x_pos;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x_pos += width` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day14.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | if y_pos < 0{y_pos = height + y_pos;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `y_pos += height` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day14.rs:59:26 [INFO] [stdout] | [INFO] [stdout] 59 | if x_pos < 0{x_pos = width + x_pos;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x_pos += width` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day14.rs:60:26 [INFO] [stdout] | [INFO] [stdout] 60 | if y_pos < 0{y_pos = height + y_pos;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `y_pos += height` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day12.rs:122:5 [INFO] [stdout] | [INFO] [stdout] 122 | return (n1, n2); [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] 122 - return (n1, n2); [INFO] [stdout] 122 + (n1, n2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/days/day12.rs:86:46 [INFO] [stdout] | [INFO] [stdout] 86 | let mut been_to: Vec> = mapped.into_iter().map(|x| x.into_iter().map(|_| false).collect()).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: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/days/day12.rs:86:68 [INFO] [stdout] | [INFO] [stdout] 86 | let mut been_to: Vec> = mapped.into_iter().map(|x| x.into_iter().map(|_| false).collect()).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: length comparison to zero [INFO] [stdout] --> src/days/day12.rs:96:15 [INFO] [stdout] | [INFO] [stdout] 96 | while next_move.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next_move.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day15.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | return 'O'; // irrelevant [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 17 - return 'O'; // irrelevant [INFO] [stdout] 17 + 'O'// irrelevant [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day15.rs:4:53 [INFO] [stdout] | [INFO] [stdout] 4 | fn check_ahead(positions: &Vec<(i64, i64)>, mapped: &Vec>) -> char{ [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] 4 - fn check_ahead(positions: &Vec<(i64, i64)>, mapped: &Vec>) -> char{ [INFO] [stdout] 4 + fn check_ahead(positions: &Vec<(i64, i64)>, mapped: &[Vec]) -> char{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day13.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return (x, y); [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] 10 - return (x, y); [INFO] [stdout] 10 + (x, y) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day15.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | return new_pos; [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] 92 - return new_pos; [INFO] [stdout] 92 + new_pos [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day13.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | return tokens; [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] 28 - return tokens; [INFO] [stdout] 28 + tokens [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:14:26 [INFO] [stdout] | [INFO] [stdout] 14 | fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [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] 14 - fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] 14 + fn get_tokens(a_buttons: &[(i64, i64)], b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days/day15.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | let dir: (i64, i64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `dir` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 23 ~ [INFO] [stdout] 24 ~ let dir: (i64, i64) = match direction { [INFO] [stdout] 25 ~ '^' => {(0, -1)} [INFO] [stdout] 26 ~ 'v' => {(0, 1)} [INFO] [stdout] 27 ~ '>' => {(1, 0)} [INFO] [stdout] 28 ~ '<' => {(-1, 0)} [INFO] [stdout] 29 | _ => {panic!("Unknown value");} [INFO] [stdout] 30 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:14:55 [INFO] [stdout] | [INFO] [stdout] 14 | fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [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] 14 - fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] 14 + fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &[(i64, i64)], prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:14:81 [INFO] [stdout] | [INFO] [stdout] 14 | fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [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] 14 - fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &Vec<(i64, i64)>) -> i64{ [INFO] [stdout] 14 + fn get_tokens(a_buttons: &Vec<(i64, i64)>, b_buttons: &Vec<(i64, i64)>, prizes: &[(i64, i64)]) -> i64{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day13.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 46 | if line.len() == 0{n_line = 0;continue;} [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day15.rs:83:30 [INFO] [stdout] | [INFO] [stdout] 83 | if moved_to.contains(&coord){continue;} [INFO] [stdout] | ^^^^^^ help: change this to: `coord` [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/days/day14.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | return ((x, y), (vx, vy)); [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] 13 - return ((x, y), (vx, vy)); [INFO] [stdout] 13 + ((x, y), (vx, vy)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day15.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | return new_pos; [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] 117 - return new_pos; [INFO] [stdout] 117 + new_pos [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/days/day15.rs:95:62 [INFO] [stdout] | [INFO] [stdout] 95 | fn make_move(start_pos: (i64, i64), direction: char, mapped: &mut Vec>) -> (i64, i64){ [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] 95 - fn make_move(start_pos: (i64, i64), direction: char, mapped: &mut Vec>) -> (i64, i64){ [INFO] [stdout] 95 + fn make_move(start_pos: (i64, i64), direction: char, mapped: &mut [Vec]) -> (i64, i64){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days/day15.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | let dir: (i64, i64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `dir` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 96 ~ [INFO] [stdout] 97 ~ let dir: (i64, i64) = match direction { [INFO] [stdout] 98 ~ '^' => {(0, -1)} [INFO] [stdout] 99 ~ 'v' => {(0, 1)} [INFO] [stdout] 100 ~ '>' => {(1, 0)} [INFO] [stdout] 101 ~ '<' => {(-1, 0)} [INFO] [stdout] 102 | _ => {panic!("Unknown value");} [INFO] [stdout] 103 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day14.rs:37:22 [INFO] [stdout] | [INFO] [stdout] 37 | if x_pos < 0{x_pos = width + x_pos;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x_pos += width` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day14.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | if y_pos < 0{y_pos = height + y_pos;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `y_pos += height` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day15.rs:130:12 [INFO] [stdout] | [INFO] [stdout] 130 | if line.trim().len() == 0{empty = true; continue;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `mapped` [INFO] [stdout] --> src/days/day15.rs:142:18 [INFO] [stdout] | [INFO] [stdout] 142 | for x in 0..mapped[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 142 - for x in 0..mapped[0].len(){ [INFO] [stdout] 142 + for (x, ) in mapped.iter().enumerate().take(mapped[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day14.rs:59:26 [INFO] [stdout] | [INFO] [stdout] 59 | if x_pos < 0{x_pos = width + x_pos;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `x_pos += width` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day14.rs:60:26 [INFO] [stdout] | [INFO] [stdout] 60 | if y_pos < 0{y_pos = height + y_pos;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `y_pos += height` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `part_1_map` [INFO] [stdout] --> src/days/day15.rs:157:18 [INFO] [stdout] | [INFO] [stdout] 157 | for x in 0..part_1_map[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 157 - for x in 0..part_1_map[0].len(){ [INFO] [stdout] 157 + for (x, ) in part_1_map.iter().enumerate().take(part_1_map[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `mapped` [INFO] [stdout] --> src/days/day15.rs:169:18 [INFO] [stdout] | [INFO] [stdout] 169 | for x in 0..mapped[0].len(){ [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] 169 - for x in 0..mapped[0].len(){ [INFO] [stdout] 169 + for in mapped.iter().take(mapped[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day15.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | return 'O'; // irrelevant [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 17 - return 'O'; // irrelevant [INFO] [stdout] 17 + 'O'// irrelevant [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `part_2_map` [INFO] [stdout] --> src/days/day15.rs:189:18 [INFO] [stdout] | [INFO] [stdout] 189 | for x in 0..part_2_map[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 189 - for x in 0..part_2_map[0].len(){ [INFO] [stdout] 189 + for (x, ) in part_2_map.iter().enumerate().take(part_2_map[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day15.rs:4:53 [INFO] [stdout] | [INFO] [stdout] 4 | fn check_ahead(positions: &Vec<(i64, i64)>, mapped: &Vec>) -> char{ [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] 4 - fn check_ahead(positions: &Vec<(i64, i64)>, mapped: &Vec>) -> char{ [INFO] [stdout] 4 + fn check_ahead(positions: &Vec<(i64, i64)>, mapped: &[Vec]) -> char{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `part_2_map` [INFO] [stdout] --> src/days/day15.rs:205:18 [INFO] [stdout] | [INFO] [stdout] 205 | for x in 0..part_2_map[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 205 - for x in 0..part_2_map[0].len(){ [INFO] [stdout] 205 + for (x, ) in part_2_map.iter().enumerate().take(part_2_map[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day15.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | return new_pos; [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] 92 - return new_pos; [INFO] [stdout] 92 + new_pos [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days/day15.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | let dir: (i64, i64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `dir` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 23 ~ [INFO] [stdout] 24 ~ let dir: (i64, i64) = match direction { [INFO] [stdout] 25 ~ '^' => {(0, -1)} [INFO] [stdout] 26 ~ 'v' => {(0, 1)} [INFO] [stdout] 27 ~ '>' => {(1, 0)} [INFO] [stdout] 28 ~ '<' => {(-1, 0)} [INFO] [stdout] 29 | _ => {panic!("Unknown value");} [INFO] [stdout] 30 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day16.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | return scores; [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] 34 - return scores; [INFO] [stdout] 34 + scores [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day15.rs:83:30 [INFO] [stdout] | [INFO] [stdout] 83 | if moved_to.contains(&coord){continue;} [INFO] [stdout] | ^^^^^^ help: change this to: `coord` [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: the loop variable `x` is used to index `mapped` [INFO] [stdout] --> src/days/day16.rs:53:18 [INFO] [stdout] | [INFO] [stdout] 53 | for x in 0..mapped[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 53 - for x in 0..mapped[0].len(){ [INFO] [stdout] 53 + for (x, ) in mapped.iter().enumerate().take(mapped[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day15.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | return new_pos; [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] 117 - return new_pos; [INFO] [stdout] 117 + new_pos [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/days/day15.rs:95:62 [INFO] [stdout] | [INFO] [stdout] 95 | fn make_move(start_pos: (i64, i64), direction: char, mapped: &mut Vec>) -> (i64, i64){ [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] 95 - fn make_move(start_pos: (i64, i64), direction: char, mapped: &mut Vec>) -> (i64, i64){ [INFO] [stdout] 95 + fn make_move(start_pos: (i64, i64), direction: char, mapped: &mut [Vec]) -> (i64, i64){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days/day15.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | let dir: (i64, i64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `dir` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 96 ~ [INFO] [stdout] 97 ~ let dir: (i64, i64) = match direction { [INFO] [stdout] 98 ~ '^' => {(0, -1)} [INFO] [stdout] 99 ~ 'v' => {(0, 1)} [INFO] [stdout] 100 ~ '>' => {(1, 0)} [INFO] [stdout] 101 ~ '<' => {(-1, 0)} [INFO] [stdout] 102 | _ => {panic!("Unknown value");} [INFO] [stdout] 103 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:76:47 [INFO] [stdout] | [INFO] [stdout] 76 | all_moves.entry(frst.clone()).or_insert(Vec::new()).extend(vec![(snd.clone(), 1000), (fourth.clone(), 1000)]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:77:46 [INFO] [stdout] | [INFO] [stdout] 77 | all_moves.entry(snd.clone()).or_insert(Vec::new()).extend(vec![(frst.clone(), 1000), (third.clone(), 1000)]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:78:48 [INFO] [stdout] | [INFO] [stdout] 78 | all_moves.entry(third.clone()).or_insert(Vec::new()).extend(vec![(snd.clone(), 1000), (fourth.clone(), 1000)]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:79:49 [INFO] [stdout] | [INFO] [stdout] 79 | all_moves.entry(fourth.clone()).or_insert(Vec::new()).extend(vec![(frst.clone(), 1000), (third.clone(), 1000)]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day15.rs:130:12 [INFO] [stdout] | [INFO] [stdout] 130 | if line.trim().len() == 0{empty = true; continue;} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:81:50 [INFO] [stdout] | [INFO] [stdout] 81 | all_moves.entry(snd.clone()).or_insert(Vec::new()).push((Node{x: x+1, y: y, dir: 1}, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:84:53 [INFO] [stdout] | [INFO] [stdout] 84 | all_moves.entry(fourth.clone()).or_insert(Vec::new()).push((Node{x: x-1, y: y, dir: 3}, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `mapped` [INFO] [stdout] --> src/days/day15.rs:142:18 [INFO] [stdout] | [INFO] [stdout] 142 | for x in 0..mapped[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 142 - for x in 0..mapped[0].len(){ [INFO] [stdout] 142 + for (x, ) in mapped.iter().enumerate().take(mapped[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:88:51 [INFO] [stdout] | [INFO] [stdout] 88 | all_moves.entry(frst.clone()).or_insert(Vec::new()).push((Node{x: x, y: y + 1, dir: 0}, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:91:52 [INFO] [stdout] | [INFO] [stdout] 91 | all_moves.entry(third.clone()).or_insert(Vec::new()).push((Node{x: x, y: y - 1, dir: 2}, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `part_1_map` [INFO] [stdout] --> src/days/day15.rs:157:18 [INFO] [stdout] | [INFO] [stdout] 157 | for x in 0..part_1_map[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 157 - for x in 0..part_1_map[0].len(){ [INFO] [stdout] 157 + for (x, ) in part_1_map.iter().enumerate().take(part_1_map[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `mapped` [INFO] [stdout] --> src/days/day15.rs:169:18 [INFO] [stdout] | [INFO] [stdout] 169 | for x in 0..mapped[0].len(){ [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] 169 - for x in 0..mapped[0].len(){ [INFO] [stdout] 169 + for in mapped.iter().take(mapped[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/days/day16.rs:126:22 [INFO] [stdout] | [INFO] [stdout] 126 | for (node, _) in &scores{ [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 126 - for (node, _) in &scores{ [INFO] [stdout] 126 + for node in scores.keys(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day16.rs:127:39 [INFO] [stdout] | [INFO] [stdout] 127 | let a_to_node = og_scores.get(&node).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `node` [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: the loop variable `dir` is only used to index `end_scores` [INFO] [stdout] --> src/days/day16.rs:129:20 [INFO] [stdout] | [INFO] [stdout] 129 | for dir in 0..4{ [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] 129 - for dir in 0..4{ [INFO] [stdout] 129 + for in end_scores.iter().take(4){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `part_2_map` [INFO] [stdout] --> src/days/day15.rs:189:18 [INFO] [stdout] | [INFO] [stdout] 189 | for x in 0..part_2_map[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 189 - for x in 0..part_2_map[0].len(){ [INFO] [stdout] 189 + for (x, ) in part_2_map.iter().enumerate().take(part_2_map[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day17.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | return output; [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] 14 - return output; [INFO] [stdout] 14 + output [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `part_2_map` [INFO] [stdout] --> src/days/day15.rs:205:18 [INFO] [stdout] | [INFO] [stdout] 205 | for x in 0..part_2_map[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 205 - for x in 0..part_2_map[0].len(){ [INFO] [stdout] 205 + for (x, ) in part_2_map.iter().enumerate().take(part_2_map[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day17.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | a = a >> 3; [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `a >>= 3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day16.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | return scores; [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] 34 - return scores; [INFO] [stdout] 34 + scores [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day18.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | return -1; [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] 27 - return -1; [INFO] [stdout] 27 + -1 [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/days/day18.rs:5:26 [INFO] [stdout] | [INFO] [stdout] 5 | fn search_shortest(grid: &mut Vec>) -> i64{ [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] 5 - fn search_shortest(grid: &mut Vec>) -> i64{ [INFO] [stdout] 5 + fn search_shortest(grid: &mut [Vec]) -> i64{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day18.rs:9:11 [INFO] [stdout] | [INFO] [stdout] 9 | while go_to.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!go_to.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `mapped` [INFO] [stdout] --> src/days/day16.rs:53:18 [INFO] [stdout] | [INFO] [stdout] 53 | for x in 0..mapped[0].len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 53 - for x in 0..mapped[0].len(){ [INFO] [stdout] 53 + for (x, ) in mapped.iter().enumerate().take(mapped[0].len()){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:76:47 [INFO] [stdout] | [INFO] [stdout] 76 | all_moves.entry(frst.clone()).or_insert(Vec::new()).extend(vec![(snd.clone(), 1000), (fourth.clone(), 1000)]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day19.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | return n; [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] 16 - return n; [INFO] [stdout] 16 + n [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:77:46 [INFO] [stdout] | [INFO] [stdout] 77 | all_moves.entry(snd.clone()).or_insert(Vec::new()).extend(vec![(frst.clone(), 1000), (third.clone(), 1000)]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:78:48 [INFO] [stdout] | [INFO] [stdout] 78 | all_moves.entry(third.clone()).or_insert(Vec::new()).extend(vec![(snd.clone(), 1000), (fourth.clone(), 1000)]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:79:49 [INFO] [stdout] | [INFO] [stdout] 79 | all_moves.entry(fourth.clone()).or_insert(Vec::new()).extend(vec![(frst.clone(), 1000), (third.clone(), 1000)]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:81:50 [INFO] [stdout] | [INFO] [stdout] 81 | all_moves.entry(snd.clone()).or_insert(Vec::new()).push((Node{x: x+1, y: y, dir: 1}, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:84:53 [INFO] [stdout] | [INFO] [stdout] 84 | all_moves.entry(fourth.clone()).or_insert(Vec::new()).push((Node{x: x-1, y: y, dir: 3}, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:88:51 [INFO] [stdout] | [INFO] [stdout] 88 | all_moves.entry(frst.clone()).or_insert(Vec::new()).push((Node{x: x, y: y + 1, dir: 0}, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day16.rs:91:52 [INFO] [stdout] | [INFO] [stdout] 91 | all_moves.entry(third.clone()).or_insert(Vec::new()).push((Node{x: x, y: y - 1, dir: 2}, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day20.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | return visited; [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] 27 - return visited; [INFO] [stdout] 27 + visited [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/days/day20.rs:8:45 [INFO] [stdout] | [INFO] [stdout] 8 | fn search_shortest(start: (i64, i64), grid: &mut Vec>) -> Vec<(i64, i64)>{ [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] 8 - fn search_shortest(start: (i64, i64), grid: &mut Vec>) -> Vec<(i64, i64)>{ [INFO] [stdout] 8 + fn search_shortest(start: (i64, i64), grid: &mut [Vec]) -> Vec<(i64, i64)>{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/days/day16.rs:126:22 [INFO] [stdout] | [INFO] [stdout] 126 | for (node, _) in &scores{ [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 126 - for (node, _) in &scores{ [INFO] [stdout] 126 + for node in scores.keys(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day16.rs:127:39 [INFO] [stdout] | [INFO] [stdout] 127 | let a_to_node = og_scores.get(&node).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `node` [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: the loop variable `dir` is only used to index `end_scores` [INFO] [stdout] --> src/days/day16.rs:129:20 [INFO] [stdout] | [INFO] [stdout] 129 | for dir in 0..4{ [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] 129 - for dir in 0..4{ [INFO] [stdout] 129 + for in end_scores.iter().take(4){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day20.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | return how_many; [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] 61 - return how_many; [INFO] [stdout] 61 + how_many [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day20.rs:33:24 [INFO] [stdout] | [INFO] [stdout] 33 | let mut shortcuts: HashMap<((i64, i64), (i64, i64)), i64> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day17.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | return output; [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] 14 - return output; [INFO] [stdout] 14 + output [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days/day17.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | a = a >> 3; [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `a >>= 3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/days/day20.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | let x = x as usize; let y = y as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `x` [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/days/day20.rs:37:41 [INFO] [stdout] | [INFO] [stdout] 37 | let x = x as usize; let y = y as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [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/days/day20.rs:39:45 [INFO] [stdout] | [INFO] [stdout] 39 | let to_start = from_start.get(&(x as usize, y as usize)).unwrap(); [INFO] [stdout] | ^^^^^^^^^^ help: try: `x` [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/days/day20.rs:39:57 [INFO] [stdout] | [INFO] [stdout] 39 | let to_start = from_start.get(&(x as usize, y as usize)).unwrap(); [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day20.rs:65:94 [INFO] [stdout] | [INFO] [stdout] 65 | ...hMap<(usize, usize), i64>, all_moves: &HashMap<(usize, usize), Vec<((usize, usize), i64)>>) -> HashMap<(usize, usize), i64>{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day20.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | return scores; [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 scores; [INFO] [stdout] 81 + scores [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/days/day20.rs:67:37 [INFO] [stdout] | [INFO] [stdout] 67 | priority_queue.push(Reverse((0, start_node.clone()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `start_node` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/days/day20.rs:75:35 [INFO] [stdout] | [INFO] [stdout] 75 | scores.insert(move_to.clone(), score + add_score); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*move_to` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/days/day20.rs:76:69 [INFO] [stdout] | [INFO] [stdout] 76 | priority_queue.push(Reverse((score + add_score, move_to.clone()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*move_to` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day18.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | return -1; [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] 27 - return -1; [INFO] [stdout] 27 + -1 [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/days/day18.rs:5:26 [INFO] [stdout] | [INFO] [stdout] 5 | fn search_shortest(grid: &mut Vec>) -> i64{ [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] 5 - fn search_shortest(grid: &mut Vec>) -> i64{ [INFO] [stdout] 5 + fn search_shortest(grid: &mut [Vec]) -> i64{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day18.rs:9:11 [INFO] [stdout] | [INFO] [stdout] 9 | while go_to.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!go_to.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/days/day20.rs:103:34 [INFO] [stdout] | [INFO] [stdout] 103 | 'S' => {start = (x as usize, y as usize);}, [INFO] [stdout] | ^^^^^^^^^^ help: try: `x` [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/days/day20.rs:103:46 [INFO] [stdout] | [INFO] [stdout] 103 | 'S' => {start = (x as usize, y as usize);}, [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [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/days/day20.rs:104:32 [INFO] [stdout] | [INFO] [stdout] 104 | 'E' => {end = (x as usize, y as usize);} [INFO] [stdout] | ^^^^^^^^^^ help: try: `x` [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/days/day20.rs:104:44 [INFO] [stdout] | [INFO] [stdout] 104 | 'E' => {end = (x as usize, y as usize);} [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day20.rs:111:24 [INFO] [stdout] | [INFO] [stdout] 111 | let mut all_moves: HashMap<(usize, usize), Vec<((usize, usize), i64)>> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day19.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | return n; [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] 16 - return n; [INFO] [stdout] 16 + n [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/days/day20.rs:126:22 [INFO] [stdout] | [INFO] [stdout] 126 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day20.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | return visited; [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] 27 - return visited; [INFO] [stdout] 27 + visited [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m_neigh` is only used to index `neigh` [INFO] [stdout] --> src/days/day20.rs:146:28 [INFO] [stdout] | [INFO] [stdout] 146 | for m_neigh in 0..neigh.len(){ [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] 146 - for m_neigh in 0..neigh.len(){ [INFO] [stdout] 146 + for in &neigh{ [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/days/day20.rs:8:45 [INFO] [stdout] | [INFO] [stdout] 8 | fn search_shortest(start: (i64, i64), grid: &mut Vec>) -> Vec<(i64, i64)>{ [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] 8 - fn search_shortest(start: (i64, i64), grid: &mut Vec>) -> Vec<(i64, i64)>{ [INFO] [stdout] 8 + fn search_shortest(start: (i64, i64), grid: &mut [Vec]) -> Vec<(i64, i64)>{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day20.rs:170:34 [INFO] [stdout] | [INFO] [stdout] 170 | let value = how_many.get(&key).unwrap(); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day20.rs:182:34 [INFO] [stdout] | [INFO] [stdout] 182 | let value = answer_2.get(&key).unwrap(); [INFO] [stdout] | ^^^^ help: change this to: `key` [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/days/day21.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | return out; [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 out; [INFO] [stdout] 21 + out [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day20.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | return how_many; [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] 61 - return how_many; [INFO] [stdout] 61 + how_many [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | return connections; [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] 51 - return connections; [INFO] [stdout] 51 + connections [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day20.rs:33:24 [INFO] [stdout] | [INFO] [stdout] 33 | let mut shortcuts: HashMap<((i64, i64), (i64, i64)), i64> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day21.rs:25:73 [INFO] [stdout] | [INFO] [stdout] 25 | fn find_paths(pos: (i64, i64), names: &HashMap<(i64, i64), char>, grid: &mut Vec>) -> HashMap>{ [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] 25 - fn find_paths(pos: (i64, i64), names: &HashMap<(i64, i64), char>, grid: &mut Vec>) -> HashMap>{ [INFO] [stdout] 25 + fn find_paths(pos: (i64, i64), names: &HashMap<(i64, i64), char>, grid: &mut [Vec]) -> HashMap>{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/days/day20.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | let x = x as usize; let y = y as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `x` [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/days/day20.rs:37:41 [INFO] [stdout] | [INFO] [stdout] 37 | let x = x as usize; let y = y as usize; [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [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/days/day20.rs:39:45 [INFO] [stdout] | [INFO] [stdout] 39 | let to_start = from_start.get(&(x as usize, y as usize)).unwrap(); [INFO] [stdout] | ^^^^^^^^^^ help: try: `x` [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/days/day20.rs:39:57 [INFO] [stdout] | [INFO] [stdout] 39 | let to_start = from_start.get(&(x as usize, y as usize)).unwrap(); [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day21.rs:31:20 [INFO] [stdout] | [INFO] [stdout] 31 | let mut go_to: Vec<((i64, i64), Vec<(i64, i64)>)> = vec![(pos, Vec::new())]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day21.rs:32:11 [INFO] [stdout] | [INFO] [stdout] 32 | while go_to.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!go_to.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day20.rs:65:94 [INFO] [stdout] | [INFO] [stdout] 65 | ...hMap<(usize, usize), i64>, all_moves: &HashMap<(usize, usize), Vec<((usize, usize), i64)>>) -> HashMap<(usize, usize), i64>{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day21.rs:33:28 [INFO] [stdout] | [INFO] [stdout] 33 | let mut new_go_to: Vec<((i64, i64), Vec<(i64, i64)>)> = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day20.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | return scores; [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 scores; [INFO] [stdout] 81 + scores [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/days/day20.rs:67:37 [INFO] [stdout] | [INFO] [stdout] 67 | priority_queue.push(Reverse((0, start_node.clone()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `start_node` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/days/day20.rs:75:35 [INFO] [stdout] | [INFO] [stdout] 75 | scores.insert(move_to.clone(), score + add_score); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*move_to` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/days/day20.rs:76:69 [INFO] [stdout] | [INFO] [stdout] 76 | priority_queue.push(Reverse((score + add_score, move_to.clone()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*move_to` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 63 | return all_paths; [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] 63 - return all_paths; [INFO] [stdout] 63 + all_paths [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day21.rs:54:60 [INFO] [stdout] | [INFO] [stdout] 54 | fn define_digits(digits: &HashMap<(i64, i64), char>, grid: &Vec>) -> HashMap>>{ [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] 54 ~ fn define_digits(digits: &HashMap<(i64, i64), char>, grid: &[Vec]) -> HashMap>>{ [INFO] [stdout] 55 | [INFO] [stdout] ... [INFO] [stdout] 58 | for (pos, digit) in digits{ [INFO] [stdout] 59 ~ let paths: HashMap> = find_paths(*pos, &digits, &mut grid.to_owned()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day21.rs:59:64 [INFO] [stdout] | [INFO] [stdout] 59 | let paths: HashMap> = find_paths(*pos, &digits, &mut grid.clone()); [INFO] [stdout] | ^^^^^^^ help: change this to: `digits` [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/days/day21.rs:75:5 [INFO] [stdout] | [INFO] [stdout] 75 | return all_paths; [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] 75 - return all_paths; [INFO] [stdout] 75 + all_paths [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day21.rs:67:55 [INFO] [stdout] | [INFO] [stdout] 67 | fn define_pad(pads: &HashMap<(i64, i64), char>, grid: &Vec>) -> HashMap>>{ [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] 67 ~ fn define_pad(pads: &HashMap<(i64, i64), char>, grid: &[Vec]) -> HashMap>>{ [INFO] [stdout] 68 | [INFO] [stdout] 69 | let mut all_paths: HashMap>> = HashMap::new(); [INFO] [stdout] 70 | for (pos, pad) in pads{ [INFO] [stdout] 71 ~ let paths: HashMap> = find_paths(*pos, &pads, &mut grid.to_owned()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day21.rs:71:64 [INFO] [stdout] | [INFO] [stdout] 71 | let paths: HashMap> = find_paths(*pos, &pads, &mut grid.clone()); [INFO] [stdout] | ^^^^^ help: change this to: `pads` [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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/days/day20.rs:103:34 [INFO] [stdout] | [INFO] [stdout] 103 | 'S' => {start = (x as usize, y as usize);}, [INFO] [stdout] | ^^^^^^^^^^ help: try: `x` [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/days/day20.rs:103:46 [INFO] [stdout] | [INFO] [stdout] 103 | 'S' => {start = (x as usize, y as usize);}, [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [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/days/day20.rs:104:32 [INFO] [stdout] | [INFO] [stdout] 104 | 'E' => {end = (x as usize, y as usize);} [INFO] [stdout] | ^^^^^^^^^^ help: try: `x` [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/days/day20.rs:104:44 [INFO] [stdout] | [INFO] [stdout] 104 | 'E' => {end = (x as usize, y as usize);} [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day20.rs:111:24 [INFO] [stdout] | [INFO] [stdout] 111 | let mut all_moves: HashMap<(usize, usize), Vec<((usize, usize), i64)>> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:99:5 [INFO] [stdout] | [INFO] [stdout] 99 | return true; [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] 99 - return true; [INFO] [stdout] 99 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day21.rs:79:58 [INFO] [stdout] | [INFO] [stdout] 79 | fn verify_perm(start: (i64, i64), perm: Vec, grid: &Vec>) -> bool { [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] 79 - fn verify_perm(start: (i64, i64), perm: Vec, grid: &Vec>) -> bool { [INFO] [stdout] 79 + fn verify_perm(start: (i64, i64), perm: Vec, grid: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:112:5 [INFO] [stdout] | [INFO] [stdout] 112 | return new_code; [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] 112 - return new_code; [INFO] [stdout] 112 + new_code [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:146:5 [INFO] [stdout] | [INFO] [stdout] 146 | return sorted; [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] 146 - return sorted; [INFO] [stdout] 146 + sorted [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/days/day20.rs:126:22 [INFO] [stdout] | [INFO] [stdout] 126 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day21.rs:129:55 [INFO] [stdout] | [INFO] [stdout] 129 | let valid = verify_perm(*inverted.get(&key1).unwrap(), perm.clone(), &grid); [INFO] [stdout] | ^^^^^ help: change this to: `key1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day21.rs:129:86 [INFO] [stdout] | [INFO] [stdout] 129 | let valid = verify_perm(*inverted.get(&key1).unwrap(), perm.clone(), &grid); [INFO] [stdout] | ^^^^^ help: change this to: `grid` [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: the loop variable `m_neigh` is only used to index `neigh` [INFO] [stdout] --> src/days/day20.rs:146:28 [INFO] [stdout] | [INFO] [stdout] 146 | for m_neigh in 0..neigh.len(){ [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] 146 - for m_neigh in 0..neigh.len(){ [INFO] [stdout] 146 + for in &neigh{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:182:5 [INFO] [stdout] | [INFO] [stdout] 182 | return shortest; [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] 182 - return shortest; [INFO] [stdout] 182 + shortest [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i64` which implements the `Copy` trait [INFO] [stdout] --> src/days/day21.rs:156:16 [INFO] [stdout] | [INFO] [stdout] 156 | return value.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days/day21.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | let lookup: &HashMap>>>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `lookup` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 158 ~ [INFO] [stdout] 159 ~ let lookup: &HashMap>>> = if depth == start_depth{ [INFO] [stdout] 160 ~ keypad [INFO] [stdout] 161 | } [INFO] [stdout] 162 ~ else{remote}; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/days/day21.rs:165:29 [INFO] [stdout] | [INFO] [stdout] 165 | let minimal = moves.into_iter().min_by_key(|v| v.len()).unwrap(); [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day20.rs:170:34 [INFO] [stdout] | [INFO] [stdout] 170 | let value = how_many.get(&key).unwrap(); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day20.rs:182:34 [INFO] [stdout] | [INFO] [stdout] 182 | let value = answer_2.get(&key).unwrap(); [INFO] [stdout] | ^^^^ help: change this to: `key` [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/days/day21.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | return out; [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 out; [INFO] [stdout] 21 + out [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | return connections; [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] 51 - return connections; [INFO] [stdout] 51 + connections [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/days/day21.rs:25:73 [INFO] [stdout] | [INFO] [stdout] 25 | fn find_paths(pos: (i64, i64), names: &HashMap<(i64, i64), char>, grid: &mut Vec>) -> HashMap>{ [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] 25 - fn find_paths(pos: (i64, i64), names: &HashMap<(i64, i64), char>, grid: &mut Vec>) -> HashMap>{ [INFO] [stdout] 25 + fn find_paths(pos: (i64, i64), names: &HashMap<(i64, i64), char>, grid: &mut [Vec]) -> HashMap>{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day21.rs:31:20 [INFO] [stdout] | [INFO] [stdout] 31 | let mut go_to: Vec<((i64, i64), Vec<(i64, i64)>)> = vec![(pos, Vec::new())]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day21.rs:32:11 [INFO] [stdout] | [INFO] [stdout] 32 | while go_to.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!go_to.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day21.rs:33:28 [INFO] [stdout] | [INFO] [stdout] 33 | let mut new_go_to: Vec<((i64, i64), Vec<(i64, i64)>)> = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 63 | return all_paths; [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] 63 - return all_paths; [INFO] [stdout] 63 + all_paths [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day22.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | return c; [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] 11 - return c; [INFO] [stdout] 11 + c [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `secrets` [INFO] [stdout] --> src/days/day22.rs:27:14 [INFO] [stdout] | [INFO] [stdout] 27 | for i in 0..secrets.len(){ [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] 27 - for i in 0..secrets.len(){ [INFO] [stdout] 27 + for in &secrets{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day21.rs:54:60 [INFO] [stdout] | [INFO] [stdout] 54 | fn define_digits(digits: &HashMap<(i64, i64), char>, grid: &Vec>) -> HashMap>>{ [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] 54 ~ fn define_digits(digits: &HashMap<(i64, i64), char>, grid: &[Vec]) -> HashMap>>{ [INFO] [stdout] 55 | [INFO] [stdout] ... [INFO] [stdout] 58 | for (pos, digit) in digits{ [INFO] [stdout] 59 ~ let paths: HashMap> = find_paths(*pos, &digits, &mut grid.to_owned()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day21.rs:59:64 [INFO] [stdout] | [INFO] [stdout] 59 | let paths: HashMap> = find_paths(*pos, &digits, &mut grid.clone()); [INFO] [stdout] | ^^^^^^^ help: change this to: `digits` [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/days/day21.rs:75:5 [INFO] [stdout] | [INFO] [stdout] 75 | return all_paths; [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] 75 - return all_paths; [INFO] [stdout] 75 + all_paths [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/days/day22.rs:45:18 [INFO] [stdout] | [INFO] [stdout] 45 | for x in seq[1..].to_vec(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `seq[1..].iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day21.rs:67:55 [INFO] [stdout] | [INFO] [stdout] 67 | fn define_pad(pads: &HashMap<(i64, i64), char>, grid: &Vec>) -> HashMap>>{ [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] 67 ~ fn define_pad(pads: &HashMap<(i64, i64), char>, grid: &[Vec]) -> HashMap>>{ [INFO] [stdout] 68 | [INFO] [stdout] 69 | let mut all_paths: HashMap>> = HashMap::new(); [INFO] [stdout] 70 | for (pos, pad) in pads{ [INFO] [stdout] 71 ~ let paths: HashMap> = find_paths(*pos, &pads, &mut grid.to_owned()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day21.rs:71:64 [INFO] [stdout] | [INFO] [stdout] 71 | let paths: HashMap> = find_paths(*pos, &pads, &mut grid.clone()); [INFO] [stdout] | ^^^^^ help: change this to: `pads` [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/days/day21.rs:99:5 [INFO] [stdout] | [INFO] [stdout] 99 | return true; [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] 99 - return true; [INFO] [stdout] 99 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day21.rs:79:58 [INFO] [stdout] | [INFO] [stdout] 79 | fn verify_perm(start: (i64, i64), perm: Vec, grid: &Vec>) -> bool { [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] 79 - fn verify_perm(start: (i64, i64), perm: Vec, grid: &Vec>) -> bool { [INFO] [stdout] 79 + fn verify_perm(start: (i64, i64), perm: Vec, grid: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/days/day22.rs:68:23 [INFO] [stdout] | [INFO] [stdout] 68 | for (_, banan) in &banana{ [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 68 - for (_, banan) in &banana{ [INFO] [stdout] 68 + for banan in banana.values(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day23.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | return out; [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] 24 - return out; [INFO] [stdout] 24 + out [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:112:5 [INFO] [stdout] | [INFO] [stdout] 112 | return new_code; [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] 112 - return new_code; [INFO] [stdout] 112 + new_code [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:146:5 [INFO] [stdout] | [INFO] [stdout] 146 | return sorted; [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] 146 - return sorted; [INFO] [stdout] 146 + sorted [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day23.rs:41:38 [INFO] [stdout] | [INFO] [stdout] 41 | connections.entry(a.clone()).or_insert(HashSet::new()).insert(b.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day21.rs:129:55 [INFO] [stdout] | [INFO] [stdout] 129 | let valid = verify_perm(*inverted.get(&key1).unwrap(), perm.clone(), &grid); [INFO] [stdout] | ^^^^^ help: change this to: `key1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day21.rs:129:86 [INFO] [stdout] | [INFO] [stdout] 129 | let valid = verify_perm(*inverted.get(&key1).unwrap(), perm.clone(), &grid); [INFO] [stdout] | ^^^^^ help: change this to: `grid` [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: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day23.rs:42:38 [INFO] [stdout] | [INFO] [stdout] 42 | connections.entry(b.clone()).or_insert(HashSet::new()).insert(a.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day21.rs:182:5 [INFO] [stdout] | [INFO] [stdout] 182 | return shortest; [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] 182 - return shortest; [INFO] [stdout] 182 + shortest [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day23.rs:73:34 [INFO] [stdout] | [INFO] [stdout] 73 | if options.len() == 1 && new_options.len() == 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `new_options.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i64` which implements the `Copy` trait [INFO] [stdout] --> src/days/day21.rs:156:16 [INFO] [stdout] | [INFO] [stdout] 156 | return value.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days/day21.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | let lookup: &HashMap>>>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `lookup` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 158 ~ [INFO] [stdout] 159 ~ let lookup: &HashMap>>> = if depth == start_depth{ [INFO] [stdout] 160 ~ keypad [INFO] [stdout] 161 | } [INFO] [stdout] 162 ~ else{remote}; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/days/day23.rs:77:22 [INFO] [stdout] | [INFO] [stdout] 77 | for x in element[1..].to_vec(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] help: remove any references to the binding [INFO] [stdout] | [INFO] [stdout] 77 - for x in element[1..].to_vec(){ [INFO] [stdout] 77 + for x in element[1..]{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/days/day21.rs:165:29 [INFO] [stdout] | [INFO] [stdout] 165 | let minimal = moves.into_iter().min_by_key(|v| v.len()).unwrap(); [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: empty string literal in `println!` [INFO] [stdout] --> src/days/day23.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` branch is empty [INFO] [stdout] --> src/days/day23.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | / if options.len() != 0{ [INFO] [stdout] 86 | | [INFO] [stdout] 87 | | } [INFO] [stdout] | |_________^ help: you can remove it: `options.len() != 0;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_ifs [INFO] [stdout] = note: `#[warn(clippy::needless_ifs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day23.rs:85:12 [INFO] [stdout] | [INFO] [stdout] 85 | if options.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!options.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | return binary_vec; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 15 - return binary_vec; [INFO] [stdout] 15 + binary_vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | return all_paths; [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 all_paths; [INFO] [stdout] 48 + all_paths [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day24.rs:31:15 [INFO] [stdout] | [INFO] [stdout] 31 | while prev.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!prev.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return "".to_string(); [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 "".to_string(); [INFO] [stdout] 67 + "".to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day22.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | return c; [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] 11 - return c; [INFO] [stdout] 11 + c [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | return all_paths; [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] 87 - return all_paths; [INFO] [stdout] 87 + all_paths [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `secrets` [INFO] [stdout] --> src/days/day22.rs:27:14 [INFO] [stdout] | [INFO] [stdout] 27 | for i in 0..secrets.len(){ [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] 27 - for i in 0..secrets.len(){ [INFO] [stdout] 27 + for in &secrets{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | return number; [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] 105 - return number; [INFO] [stdout] 105 + number [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/days/day24.rs:93:21 [INFO] [stdout] | [INFO] [stdout] 93 | for (key, _) in output{ [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 93 - for (key, _) in output{ [INFO] [stdout] 93 + for key in output.keys(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `z_values` [INFO] [stdout] --> src/days/day24.rs:100:14 [INFO] [stdout] | [INFO] [stdout] 100 | for i in 0..z_values.len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 100 - for i in 0..z_values.len(){ [INFO] [stdout] 100 + for (i, ) in z_values.iter().enumerate(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:132:5 [INFO] [stdout] | [INFO] [stdout] 132 | return output; [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] 132 - return output; [INFO] [stdout] 132 + output [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/days/day22.rs:45:18 [INFO] [stdout] | [INFO] [stdout] 45 | for x in seq[1..].to_vec(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `seq[1..].iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day24.rs:109:11 [INFO] [stdout] | [INFO] [stdout] 109 | while instructions.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!instructions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days/day24.rs:114:21 [INFO] [stdout] | [INFO] [stdout] 114 | let out_val: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `out_val` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 114 ~ [INFO] [stdout] 115 | [INFO] [stdout] 116 ~ let out_val: bool = match instruct.as_str() { [INFO] [stdout] 117 ~ "AND" => {*val1 && *val2}, [INFO] [stdout] 118 ~ "OR" => {*val1 || *val2}, [INFO] [stdout] 119 ~ "XOR" => {*val1 ^ *val2}, [INFO] [stdout] 120 | _ => panic!("Unknown instruction"), [INFO] [stdout] 121 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/days/day24.rs:136:89 [INFO] [stdout] | [INFO] [stdout] 136 | fn part_2(num: u64, x: u64, y: u64, connections: &Vec<(String, String, String, String)>) -> (){ [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/days/day22.rs:68:23 [INFO] [stdout] | [INFO] [stdout] 68 | for (_, banan) in &banana{ [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 68 - for (_, banan) in &banana{ [INFO] [stdout] 68 + for banan in banana.values(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day23.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | return out; [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] 24 - return out; [INFO] [stdout] 24 + out [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day23.rs:41:38 [INFO] [stdout] | [INFO] [stdout] 41 | connections.entry(a.clone()).or_insert(HashSet::new()).insert(b.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/days/day23.rs:42:38 [INFO] [stdout] | [INFO] [stdout] 42 | connections.entry(b.clone()).or_insert(HashSet::new()).insert(a.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/days/day24.rs:202:14 [INFO] [stdout] | [INFO] [stdout] 202 | for x in answer[1..].to_vec(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] help: remove any references to the binding [INFO] [stdout] | [INFO] [stdout] 202 - for x in answer[1..].to_vec(){ [INFO] [stdout] 202 + for x in answer[1..]{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/days/day24.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day23.rs:73:34 [INFO] [stdout] | [INFO] [stdout] 73 | if options.len() == 1 && new_options.len() == 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `new_options.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/days/day23.rs:77:22 [INFO] [stdout] | [INFO] [stdout] 77 | for x in element[1..].to_vec(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] help: remove any references to the binding [INFO] [stdout] | [INFO] [stdout] 77 - for x in element[1..].to_vec(){ [INFO] [stdout] 77 + for x in element[1..]{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/days/day23.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `.map(...).all(identity)` [INFO] [stdout] --> src/days/day25.rs:19:43 [INFO] [stdout] | [INFO] [stdout] 19 | if tmp[0].clone().into_iter().map(|x| x == '#').all(|x| x){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity [INFO] [stdout] = note: `#[warn(clippy::map_all_any_identity)]` on by default [INFO] [stdout] help: use `.all(...)` instead [INFO] [stdout] | [INFO] [stdout] 19 - if tmp[0].clone().into_iter().map(|x| x == '#').all(|x| x){ [INFO] [stdout] 19 + if tmp[0].clone().into_iter().all(|x| x == '#'){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` branch is empty [INFO] [stdout] --> src/days/day23.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | / if options.len() != 0{ [INFO] [stdout] 86 | | [INFO] [stdout] 87 | | } [INFO] [stdout] | |_________^ help: you can remove it: `options.len() != 0;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_ifs [INFO] [stdout] = note: `#[warn(clippy::needless_ifs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day23.rs:85:12 [INFO] [stdout] | [INFO] [stdout] 85 | if options.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!options.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `lock` [INFO] [stdout] --> src/days/day25.rs:48:18 [INFO] [stdout] | [INFO] [stdout] 48 | for j in 0..lock.len(){ [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] 48 - for j in 0..lock.len(){ [INFO] [stdout] 48 + for in &lock{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | return binary_vec; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 15 - return binary_vec; [INFO] [stdout] 15 + binary_vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | return all_paths; [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 all_paths; [INFO] [stdout] 48 + all_paths [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day24.rs:31:15 [INFO] [stdout] | [INFO] [stdout] 31 | while prev.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!prev.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/days/day25.rs:76:35 [INFO] [stdout] | [INFO] [stdout] 76 | println!("Part 2 answer: {}", "🎅"); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 76 - println!("Part 2 answer: {}", "🎅"); [INFO] [stdout] 76 + println!("Part 2 answer: 🎅"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return "".to_string(); [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 "".to_string(); [INFO] [stdout] 67 + "".to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/main.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | let fun: fn() -> Result<(), io::Error>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `fun` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 15 ~ [INFO] [stdout] 16 ~ let fun: fn() -> Result<(), io::Error> = match args[1].as_str() { [INFO] [stdout] 17 ~ "1" => {days::day1::day_1}, [INFO] [stdout] 18 ~ "2" => {days::day2::day_2}, [INFO] [stdout] 19 ~ "3" => {days::day3::day_3}, [INFO] [stdout] 20 ~ "4" => {days::day4::day_4}, [INFO] [stdout] 21 ~ "5" => {days::day5::day_5}, [INFO] [stdout] 22 ~ "6" => {days::day6::day_6}, [INFO] [stdout] 23 ~ "7" => {days::day7::day_7}, [INFO] [stdout] 24 ~ "8" => {days::day8::day_8}, [INFO] [stdout] 25 ~ "9" => {days::day9::day_9}, [INFO] [stdout] 26 ~ "10" => {days::day10::day_10}, [INFO] [stdout] 27 ~ "11" => {days::day11::day_11}, [INFO] [stdout] 28 ~ "12" => {days::day12::day_12}, [INFO] [stdout] 29 ~ "13" => {days::day13::day_13}, [INFO] [stdout] 30 ~ "14" => {days::day14::day_14}, [INFO] [stdout] 31 ~ "15" => {days::day15::day_15}, [INFO] [stdout] 32 ~ "16" => {days::day16::day_16}, [INFO] [stdout] 33 ~ "17" => {days::day17::day_17}, [INFO] [stdout] 34 ~ "18" => {days::day18::day_18}, [INFO] [stdout] 35 ~ "19" => {days::day19::day_19}, [INFO] [stdout] 36 ~ "20" => {days::day20::day_20}, [INFO] [stdout] 37 ~ "21" => {days::day21::day_21}, [INFO] [stdout] 38 ~ "22" => {days::day22::day_22}, [INFO] [stdout] 39 ~ "23" => {days::day23::day_23}, [INFO] [stdout] 40 ~ "24" => {days::day24::day_24}, [INFO] [stdout] 41 ~ "25" => {days::day25::day_25}, [INFO] [stdout] 42 | _ => { [INFO] [stdout] ... [INFO] [stdout] 45 | } [INFO] [stdout] 46 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | return all_paths; [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] 87 - return all_paths; [INFO] [stdout] 87 + all_paths [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day11.rs:45:12 [INFO] [stdout] | [INFO] [stdout] 45 | if vec![24, 74].contains(&i){ [INFO] [stdout] | ^^^^^^^^^^^^ help: you can use an array directly: `[24, 74]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day24.rs:197:22 [INFO] [stdout] | [INFO] [stdout] 197 | let mut answer = vec!["dhm", "gfm", "qjd", "z32", "cdj", "z08", "mrb", "z16"]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `["dhm", "gfm", "qjd", "z32", "cdj", "z08", "mrb", "z16"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | return number; [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] 105 - return number; [INFO] [stdout] 105 + number [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/days/day24.rs:93:21 [INFO] [stdout] | [INFO] [stdout] 93 | for (key, _) in output{ [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 93 - for (key, _) in output{ [INFO] [stdout] 93 + for key in output.keys(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `z_values` [INFO] [stdout] --> src/days/day24.rs:100:14 [INFO] [stdout] | [INFO] [stdout] 100 | for i in 0..z_values.len(){ [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 100 - for i in 0..z_values.len(){ [INFO] [stdout] 100 + for (i, ) in z_values.iter().enumerate(){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/days/day24.rs:132:5 [INFO] [stdout] | [INFO] [stdout] 132 | return output; [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] 132 - return output; [INFO] [stdout] 132 + output [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day24.rs:109:11 [INFO] [stdout] | [INFO] [stdout] 109 | while instructions.len() != 0{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!instructions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days/day24.rs:114:21 [INFO] [stdout] | [INFO] [stdout] 114 | let out_val: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `out_val` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 114 ~ [INFO] [stdout] 115 | [INFO] [stdout] 116 ~ let out_val: bool = match instruct.as_str() { [INFO] [stdout] 117 ~ "AND" => {*val1 && *val2}, [INFO] [stdout] 118 ~ "OR" => {*val1 || *val2}, [INFO] [stdout] 119 ~ "XOR" => {*val1 ^ *val2}, [INFO] [stdout] 120 | _ => panic!("Unknown instruction"), [INFO] [stdout] 121 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/days/day24.rs:136:89 [INFO] [stdout] | [INFO] [stdout] 136 | fn part_2(num: u64, x: u64, y: u64, connections: &Vec<(String, String, String, String)>) -> (){ [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_vec` [INFO] [stdout] --> src/days/day24.rs:202:14 [INFO] [stdout] | [INFO] [stdout] 202 | for x in answer[1..].to_vec(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] help: remove any references to the binding [INFO] [stdout] | [INFO] [stdout] 202 - for x in answer[1..].to_vec(){ [INFO] [stdout] 202 + for x in answer[1..]{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/days/day24.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `.map(...).all(identity)` [INFO] [stdout] --> src/days/day25.rs:19:43 [INFO] [stdout] | [INFO] [stdout] 19 | if tmp[0].clone().into_iter().map(|x| x == '#').all(|x| x){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity [INFO] [stdout] = note: `#[warn(clippy::map_all_any_identity)]` on by default [INFO] [stdout] help: use `.all(...)` instead [INFO] [stdout] | [INFO] [stdout] 19 - if tmp[0].clone().into_iter().map(|x| x == '#').all(|x| x){ [INFO] [stdout] 19 + if tmp[0].clone().into_iter().all(|x| x == '#'){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `lock` [INFO] [stdout] --> src/days/day25.rs:48:18 [INFO] [stdout] | [INFO] [stdout] 48 | for j in 0..lock.len(){ [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] 48 - for j in 0..lock.len(){ [INFO] [stdout] 48 + for in &lock{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/days/day25.rs:76:35 [INFO] [stdout] | [INFO] [stdout] 76 | println!("Part 2 answer: {}", "🎅"); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 76 - println!("Part 2 answer: {}", "🎅"); [INFO] [stdout] 76 + println!("Part 2 answer: 🎅"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/main.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | let fun: fn() -> Result<(), io::Error>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `fun` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 15 ~ [INFO] [stdout] 16 ~ let fun: fn() -> Result<(), io::Error> = match args[1].as_str() { [INFO] [stdout] 17 ~ "1" => {days::day1::day_1}, [INFO] [stdout] 18 ~ "2" => {days::day2::day_2}, [INFO] [stdout] 19 ~ "3" => {days::day3::day_3}, [INFO] [stdout] 20 ~ "4" => {days::day4::day_4}, [INFO] [stdout] 21 ~ "5" => {days::day5::day_5}, [INFO] [stdout] 22 ~ "6" => {days::day6::day_6}, [INFO] [stdout] 23 ~ "7" => {days::day7::day_7}, [INFO] [stdout] 24 ~ "8" => {days::day8::day_8}, [INFO] [stdout] 25 ~ "9" => {days::day9::day_9}, [INFO] [stdout] 26 ~ "10" => {days::day10::day_10}, [INFO] [stdout] 27 ~ "11" => {days::day11::day_11}, [INFO] [stdout] 28 ~ "12" => {days::day12::day_12}, [INFO] [stdout] 29 ~ "13" => {days::day13::day_13}, [INFO] [stdout] 30 ~ "14" => {days::day14::day_14}, [INFO] [stdout] 31 ~ "15" => {days::day15::day_15}, [INFO] [stdout] 32 ~ "16" => {days::day16::day_16}, [INFO] [stdout] 33 ~ "17" => {days::day17::day_17}, [INFO] [stdout] 34 ~ "18" => {days::day18::day_18}, [INFO] [stdout] 35 ~ "19" => {days::day19::day_19}, [INFO] [stdout] 36 ~ "20" => {days::day20::day_20}, [INFO] [stdout] 37 ~ "21" => {days::day21::day_21}, [INFO] [stdout] 38 ~ "22" => {days::day22::day_22}, [INFO] [stdout] 39 ~ "23" => {days::day23::day_23}, [INFO] [stdout] 40 ~ "24" => {days::day24::day_24}, [INFO] [stdout] 41 ~ "25" => {days::day25::day_25}, [INFO] [stdout] 42 | _ => { [INFO] [stdout] ... [INFO] [stdout] 45 | } [INFO] [stdout] 46 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day11.rs:45:12 [INFO] [stdout] | [INFO] [stdout] 45 | if vec![24, 74].contains(&i){ [INFO] [stdout] | ^^^^^^^^^^^^ help: you can use an array directly: `[24, 74]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day24.rs:197:22 [INFO] [stdout] | [INFO] [stdout] 197 | let mut answer = vec!["dhm", "gfm", "qjd", "z32", "cdj", "z08", "mrb", "z16"]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `["dhm", "gfm", "qjd", "z32", "cdj", "z08", "mrb", "z16"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.14s [INFO] running `Command { std: "docker" "inspect" "11ae4dddba9b272cea3f215cc3a4b515fda5e55d02119f4ea483ab00571fb3c4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "11ae4dddba9b272cea3f215cc3a4b515fda5e55d02119f4ea483ab00571fb3c4", kill_on_drop: false }` [INFO] [stdout] 11ae4dddba9b272cea3f215cc3a4b515fda5e55d02119f4ea483ab00571fb3c4