[INFO] cloning repository https://github.com/D-Alexis/advent_of_code_2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/D-Alexis/advent_of_code_2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FD-Alexis%2Fadvent_of_code_2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FD-Alexis%2Fadvent_of_code_2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 95b038c04d799e2bd6f2c5fef58fd47db4e6c0db [INFO] linting D-Alexis/advent_of_code_2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FD-Alexis%2Fadvent_of_code_2024" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/D-Alexis/advent_of_code_2024 [INFO] finished tweaking git repo https://github.com/D-Alexis/advent_of_code_2024 [INFO] tweaked toml for git repo https://github.com/D-Alexis/advent_of_code_2024 written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/D-Alexis/advent_of_code_2024 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/D-Alexis/advent_of_code_2024 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-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] c2515ece8dbce9ee47d9b3b6c55a84f9118d98e5eef2f8813a82dfbe78e7e54a [INFO] running `Command { std: "docker" "start" "-a" "c2515ece8dbce9ee47d9b3b6c55a84f9118d98e5eef2f8813a82dfbe78e7e54a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "c2515ece8dbce9ee47d9b3b6c55a84f9118d98e5eef2f8813a82dfbe78e7e54a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c2515ece8dbce9ee47d9b3b6c55a84f9118d98e5eef2f8813a82dfbe78e7e54a", kill_on_drop: false }` [INFO] [stdout] c2515ece8dbce9ee47d9b3b6c55a84f9118d98e5eef2f8813a82dfbe78e7e54a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] a655cfd69c55d98dc3432557abe9871e509d9c7ec30683da4c8ecec907ae8457 [INFO] running `Command { std: "docker" "start" "-a" "a655cfd69c55d98dc3432557abe9871e509d9c7ec30683da4c8ecec907ae8457", kill_on_drop: false }` [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking regex-syntax v0.8.5 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking advent-of-code-2024 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/lib/lib.rs:8:32 [INFO] [stdout] | [INFO] [stdout] 8 | pub fn print_matrice(input: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 8 - pub fn print_matrice(input: &Vec>) [INFO] [stdout] 8 + pub fn print_matrice(input: &[Vec]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/lib/lib.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | 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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/lib/lib.rs:8:32 [INFO] [stdout] | [INFO] [stdout] 8 | pub fn print_matrice(input: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 8 - pub fn print_matrice(input: &Vec>) [INFO] [stdout] 8 + pub fn print_matrice(input: &[Vec]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/lib/lib.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | 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: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/bin/day14/a.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/bin/day14/b.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day15/a.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut map_moves = parse_input(input); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day15/b.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let mut map_moves = parse_input(input); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day2/main.rs:42:20 [INFO] [stdout] | [INFO] [stdout] 42 | fn is_safe(report: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 42 - fn is_safe(report: &Vec) -> bool { [INFO] [stdout] 42 + fn is_safe(report: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/day2/main.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | if !(diff >= 1 && diff <= 3) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=3).contains(&diff)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/day15/main.rs:15:10 [INFO] [stdout] | [INFO] [stdout] 15 | fn part1(input: &str) { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `solve` is never used [INFO] [stdout] --> src/bin/day15/a.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn solve(input: &str) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `find_next_empty` is never used [INFO] [stdout] --> src/bin/day15/a.rs:44:4 [INFO] [stdout] | [INFO] [stdout] 44 | fn find_next_empty(pos: (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_input` is never used [INFO] [stdout] --> src/bin/day15/a.rs:55:4 [INFO] [stdout] | [INFO] [stdout] 55 | fn parse_input(input: &str) -> MapMove { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MapMove` is never constructed [INFO] [stdout] --> src/bin/day15/a.rs:94:8 [INFO] [stdout] | [INFO] [stdout] 94 | struct MapMove { [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/bin/day15/a.rs:44:66 [INFO] [stdout] | [INFO] [stdout] 44 | fn find_next_empty(pos: (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [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] 44 - fn find_next_empty(pos: (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [INFO] [stdout] 44 + fn find_next_empty(pos: (usize, usize), moves: &(i32, i32), map: &[Vec]) -> Option<(usize, usize)> { [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/bin/day5/main.rs:63:59 [INFO] [stdout] | [INFO] [stdout] 63 | fn check_if_valid(rules: &HashMap>, update: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 63 - fn check_if_valid(rules: &HashMap>, update: &Vec) -> bool { [INFO] [stdout] 63 + fn check_if_valid(rules: &HashMap>, update: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/day15/a.rs:76:10 [INFO] [stdout] | [INFO] [stdout] 76 | .map(|line| { [INFO] [stdout] | __________^ [INFO] [stdout] 77 | | line.chars() [INFO] [stdout] 78 | | .map(|charr| match charr { [INFO] [stdout] 79 | | '<' => (0, -1), [INFO] [stdout] ... | [INFO] [stdout] 86 | | }) [INFO] [stdout] 87 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 76 ~ .flat_map(|line| { [INFO] [stdout] 77 + line.chars() [INFO] [stdout] 78 + .map(|charr| match charr { [INFO] [stdout] 79 + '<' => (0, -1), [INFO] [stdout] 80 + '^' => (-1, 0), [INFO] [stdout] 81 + '>' => (0, 1), [INFO] [stdout] 82 + 'v' => (1, 0), [INFO] [stdout] 83 + _ => panic!("not a move"), [INFO] [stdout] 84 + }) [INFO] [stdout] 85 + .collect::>() [INFO] [stdout] 86 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day15/b.rs:41:59 [INFO] [stdout] | [INFO] [stdout] 41 | if let Some(next_empty) = find_next_empty(pos, moves, &map) { [INFO] [stdout] | ^^^^ help: change this to: `map` [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 looks like you are swapping `map[next.0 as usize][next.1 as usize]` and `char_to_move` manually [INFO] [stdout] --> src/bin/day15/b.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | / let tmp = map[next.0 as usize][next.1 as usize]; [INFO] [stdout] 51 | | map[next.0 as usize][next.1 as usize] = char_to_move; [INFO] [stdout] 52 | | char_to_move = tmp; [INFO] [stdout] | |_______________________________^ help: try: `std::mem::swap(&mut map[next.0 as usize][next.1 as usize], &mut char_to_move);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day15/b.rs:53:21 [INFO] [stdout] | [INFO] [stdout] 53 | next = (next.0 as i32 + moves.0, next.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day15/b.rs:53:46 [INFO] [stdout] | [INFO] [stdout] 53 | next = (next.0 as i32 + moves.0, next.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day15/b.rs:62:71 [INFO] [stdout] | [INFO] [stdout] 62 | fn find_next_empty(pos: &mut (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [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] 62 - fn find_next_empty(pos: &mut (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [INFO] [stdout] 62 + fn find_next_empty(pos: &mut (usize, usize), moves: &(i32, i32), map: &[Vec]) -> Option<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/bin/day15/b.rs:79:9 [INFO] [stdout] | [INFO] [stdout] 79 | vec_box.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 79 - vec_box.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] 79 + vec_box.sort_by_key(|a| a.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day15/b.rs:84:25 [INFO] [stdout] | [INFO] [stdout] 84 | let next = (ele.0 as i32 + moves.0, ele.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ele.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/bin/day15/b.rs:84:49 [INFO] [stdout] | [INFO] [stdout] 84 | let next = (ele.0 as i32 + moves.0, ele.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ele.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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day15/b.rs:90:13 [INFO] [stdout] | [INFO] [stdout] 90 | map[pos.0 as usize][pos.1 as usize] = '.'; [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day15/b.rs:90:29 [INFO] [stdout] | [INFO] [stdout] 90 | map[pos.0 as usize][pos.1 as usize] = '.'; [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: length comparison to zero [INFO] [stdout] --> src/bin/day15/b.rs:110:11 [INFO] [stdout] | [INFO] [stdout] 110 | while boxes_to_check.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!boxes_to_check.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day15/b.rs:112:17 [INFO] [stdout] | [INFO] [stdout] 112 | next = (boxx.0 as i32 + moves.0, boxx.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `boxx.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/bin/day15/b.rs:112:42 [INFO] [stdout] | [INFO] [stdout] 112 | next = (boxx.0 as i32 + moves.0, boxx.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `boxx.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 `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15/b.rs:124:17 [INFO] [stdout] | [INFO] [stdout] 124 | fn check_a(map: &mut Vec>, next: (i32, i32), boxes_to_check: &mut VecDeque<(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] 124 - fn check_a(map: &mut Vec>, next: (i32, i32), boxes_to_check: &mut VecDeque<(i32, i32)>) { [INFO] [stdout] 124 + fn check_a(map: &mut [Vec], next: (i32, i32), boxes_to_check: &mut VecDeque<(i32, i32)>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/day15/b.rs:161:10 [INFO] [stdout] | [INFO] [stdout] 161 | .map(|line| { [INFO] [stdout] | __________^ [INFO] [stdout] 162 | | line.chars() [INFO] [stdout] 163 | | .map(|charr| match charr { [INFO] [stdout] 164 | | '<' => (0, -1), [INFO] [stdout] ... | [INFO] [stdout] 171 | | }) [INFO] [stdout] 172 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 161 ~ .flat_map(|line| { [INFO] [stdout] 162 + line.chars() [INFO] [stdout] 163 + .map(|charr| match charr { [INFO] [stdout] 164 + '<' => (0, -1), [INFO] [stdout] 165 + '^' => (-1, 0), [INFO] [stdout] 166 + '>' => (0, 1), [INFO] [stdout] 167 + 'v' => (1, 0), [INFO] [stdout] 168 + _ => panic!("not a move"), [INFO] [stdout] 169 + }) [INFO] [stdout] 170 + .collect::>() [INFO] [stdout] 171 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/bin/day14/a.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/bin/day14/b.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashSet` [INFO] [stdout] --> src/bin/day10/b.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use std::collections::HashSet; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) 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/bin/day7/main.rs:40:35 [INFO] [stdout] | [INFO] [stdout] 40 | fn is_valid(target: u64, numbers: &Vec, operations: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 40 - fn is_valid(target: u64, numbers: &Vec, operations: &Vec) -> bool { [INFO] [stdout] 40 + fn is_valid(target: u64, numbers: &[u64], operations: &Vec) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day7/main.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | return is_valid; [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] 65 - return is_valid; [INFO] [stdout] 65 + is_valid [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day7/main.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | return target == acc; [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 target == acc; [INFO] [stdout] 67 + target == acc [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/bin/day8/a.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use advent_util; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/bin/day8/b.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use advent_util; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5/main.rs:63:59 [INFO] [stdout] | [INFO] [stdout] 63 | fn check_if_valid(rules: &HashMap>, update: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 63 - fn check_if_valid(rules: &HashMap>, update: &Vec) -> bool { [INFO] [stdout] 63 + fn check_if_valid(rules: &HashMap>, update: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `direction` is never read [INFO] [stdout] --> src/bin/day18/a.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 55 | struct ToProcess { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 59 | direction: (i32, i32), [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ToProcess` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `direction` is never read [INFO] [stdout] --> src/bin/day18/b.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 63 | struct ToProcess { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 67 | direction: (i32, i32), [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ToProcess` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/bin/day14/a.rs:15:42 [INFO] [stdout] | [INFO] [stdout] 15 | println!("{:?}", quandrant_nb.iter().fold(1, |acc, robots| acc * robots)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [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/bin/day14/a.rs:17:66 [INFO] [stdout] | [INFO] [stdout] 17 | fn compute_position(robot: &((i32, i32), (i32, i32)), pos_to_nb: &mut 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 17 - fn compute_position(robot: &((i32, i32), (i32, i32)), pos_to_nb: &mut Vec) { [INFO] [stdout] 17 + fn compute_position(robot: &((i32, i32), (i32, i32)), pos_to_nb: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/bin/day18/a.rs:9:12 [INFO] [stdout] | [INFO] [stdout] 9 | i: 0 as i32, [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day2/main.rs:42:20 [INFO] [stdout] | [INFO] [stdout] 42 | fn is_safe(report: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 42 - fn is_safe(report: &Vec) -> bool { [INFO] [stdout] 42 + fn is_safe(report: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/day2/main.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | if !(diff >= 1 && diff <= 3) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=3).contains(&diff)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/bin/day18/a.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | j: 0 as i32, [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: length comparison to zero [INFO] [stdout] --> src/bin/day18/a.rs:14:11 [INFO] [stdout] | [INFO] [stdout] 14 | while heap.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!heap.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day18/a.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day18/a.rs:30:32 [INFO] [stdout] | [INFO] [stdout] 30 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day10/a.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | / if !explored_pos.contains(&new_pos) { [INFO] [stdout] 29 | | if is_in_bound(new_pos, map.len() as i32) { [INFO] [stdout] 30 | | let val = map[new_pos.0 as usize][new_pos.1 as usize]; [INFO] [stdout] 31 | | if val - map[position.0 as usize][position.1 as usize] == 1 { [INFO] [stdout] ... | [INFO] [stdout] 39 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 28 ~ if !explored_pos.contains(&new_pos) [INFO] [stdout] 29 ~ && is_in_bound(new_pos, map.len() as i32) { [INFO] [stdout] 30 | let val = map[new_pos.0 as usize][new_pos.1 as usize]; [INFO] [stdout] ... [INFO] [stdout] 37 | } [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/bin/day18/b.rs:20:12 [INFO] [stdout] | [INFO] [stdout] 20 | i: 0 as i32, [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: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/bin/day18/b.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 21 | j: 0 as i32, [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: length comparison to zero [INFO] [stdout] --> src/bin/day18/b.rs:25:11 [INFO] [stdout] | [INFO] [stdout] 25 | while heap.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!heap.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 (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day18/b.rs:39:32 [INFO] [stdout] | [INFO] [stdout] 39 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day18/b.rs:40:32 [INFO] [stdout] | [INFO] [stdout] 40 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day7/main.rs:40:35 [INFO] [stdout] | [INFO] [stdout] 40 | fn is_valid(target: u64, numbers: &Vec, operations: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 40 - fn is_valid(target: u64, numbers: &Vec, operations: &Vec) -> bool { [INFO] [stdout] 40 + fn is_valid(target: u64, numbers: &[u64], operations: &Vec) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day7/main.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | return is_valid; [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] 65 - return is_valid; [INFO] [stdout] 65 + is_valid [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day7/main.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | return target == acc; [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 target == acc; [INFO] [stdout] 67 + target == acc [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/bin/day14/b.rs:25:74 [INFO] [stdout] | [INFO] [stdout] 25 | fn compute_position(robot: &((i32, i32), (i32, i32)), n: i32, pos_to_nb: &mut 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 compute_position(robot: &((i32, i32), (i32, i32)), n: i32, pos_to_nb: &mut Vec) { [INFO] [stdout] 25 + fn compute_position(robot: &((i32, i32), (i32, i32)), n: i32, pos_to_nb: &mut [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/bin/day8/a.rs:14:28 [INFO] [stdout] | [INFO] [stdout] 14 | fn count_antinode(antenas: &Vec<(i32, i32)>, positions: &mut HashSet<(i32, i32)>, max: 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] 14 - fn count_antinode(antenas: &Vec<(i32, i32)>, positions: &mut HashSet<(i32, i32)>, max: i32) { [INFO] [stdout] 14 + fn count_antinode(antenas: &[(i32, i32)], positions: &mut HashSet<(i32, i32)>, max: 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/bin/day8/b.rs:14:28 [INFO] [stdout] | [INFO] [stdout] 14 | fn count_antinode(antenas: &Vec<(i32, i32)>, positions: &mut HashSet<(i32, i32)>, max: 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] 14 - fn count_antinode(antenas: &Vec<(i32, i32)>, positions: &mut HashSet<(i32, i32)>, max: i32) { [INFO] [stdout] 14 + fn count_antinode(antenas: &[(i32, i32)], positions: &mut HashSet<(i32, i32)>, max: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day16/b.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let mut to_process: Vec<(i32, i32)> = Vec::with_capacity(4); [INFO] [stdout] | ----^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `to_process` [INFO] [stdout] --> src/bin/day16/b.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let mut to_process: Vec<(i32, i32)> = Vec::with_capacity(4); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_to_process` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/day16/main.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | fn part2(input: &str) { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `solve` is never used [INFO] [stdout] --> src/bin/day16/b.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn solve(input: &str) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `explore` is never used [INFO] [stdout] --> src/bin/day16/b.rs:15:4 [INFO] [stdout] | [INFO] [stdout] 15 | fn explore( [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `solve_p1` is never used [INFO] [stdout] --> src/bin/day16/b.rs:60:8 [INFO] [stdout] | [INFO] [stdout] 60 | pub fn solve_p1(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_input` is never used [INFO] [stdout] --> src/bin/day16/b.rs:116:4 [INFO] [stdout] | [INFO] [stdout] 116 | fn parse_input(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ToProcess` is never constructed [INFO] [stdout] --> src/bin/day16/b.rs:141:8 [INFO] [stdout] | [INFO] [stdout] 141 | struct ToProcess { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day16/a.rs:15:11 [INFO] [stdout] | [INFO] [stdout] 15 | while heap.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!heap.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/a.rs:31:32 [INFO] [stdout] | [INFO] [stdout] 31 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/a.rs:32:32 [INFO] [stdout] | [INFO] [stdout] 32 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/a.rs:45:32 [INFO] [stdout] | [INFO] [stdout] 45 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day16/a.rs:46:32 [INFO] [stdout] | [INFO] [stdout] 46 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day16/a.rs:55:26 [INFO] [stdout] | [INFO] [stdout] 55 | println!("{:?}", map[end.0 as usize][end.1 as usize]) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ end.0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day16/a.rs:55:42 [INFO] [stdout] | [INFO] [stdout] 55 | println!("{:?}", map[end.0 as usize][end.1 as usize]) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `end.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16/a.rs:58:32 [INFO] [stdout] | [INFO] [stdout] 58 | fn parse_input(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16/b.rs:17:10 [INFO] [stdout] | [INFO] [stdout] 17 | map: &mut Vec>, [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: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day16/b.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | if ((next_poids == node_poid + 1) && dir == map[next.0 as usize][next.1 as usize].2) [INFO] [stdout] | ____________^ [INFO] [stdout] 36 | | || ((next_poids == node_poid + 1001) && dir == map[next.0 as usize][next.1 as usize].2) { [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] 35 - if ((next_poids == node_poid + 1) && dir == map[next.0 as usize][next.1 as usize].2) [INFO] [stdout] 36 - || ((next_poids == node_poid + 1001) && dir == map[next.0 as usize][next.1 as usize].2) { [INFO] [stdout] 35 + if !(dir != map[next.0 as usize][next.1 as usize].2 || next_poids != node_poid + 1 && next_poids != node_poid + 1001) { [INFO] [stdout] | [INFO] [stdout] 35 - if ((next_poids == node_poid + 1) && dir == map[next.0 as usize][next.1 as usize].2) [INFO] [stdout] 36 - || ((next_poids == node_poid + 1001) && dir == map[next.0 as usize][next.1 as usize].2) { [INFO] [stdout] 35 + if ((next_poids == node_poid + 1001) || (next_poids == node_poid + 1)) && dir == map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day16/b.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | / if map[next.0 as usize][next.1 as usize].0 == 'E' { [INFO] [stdout] 28 | | if next_poids == node_poid + 1 || next_poids == node_poid + 1001 { [INFO] [stdout] 29 | | is_ok = true; [INFO] [stdout] 30 | | in_path.insert(next); [INFO] [stdout] ... | [INFO] [stdout] 33 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if map[next.0 as usize][next.1 as usize].0 == 'E' [INFO] [stdout] 28 ~ && (next_poids == node_poid + 1 || next_poids == node_poid + 1001) { [INFO] [stdout] 29 | is_ok = true; [INFO] [stdout] 30 | in_path.insert(next); [INFO] [stdout] 31 | continue; [INFO] [stdout] 32 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day16/b.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | / if next_poids + 1000 == node_poid + 1 { [INFO] [stdout] 41 | | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 42 | | if dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] 43 | | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] ... | [INFO] [stdout] 50 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 40 ~ if next_poids + 1000 == node_poid + 1 [INFO] [stdout] 41 ~ && map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 42 | if dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] ... [INFO] [stdout] 48 | [INFO] [stdout] 49 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day16/b.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | / if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 42 | | if dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] 43 | | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 44 | | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 41 ~ if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 [INFO] [stdout] 42 ~ && dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] 43 | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] ... [INFO] [stdout] 46 | [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day16/b.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | / if dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] 43 | | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 44 | | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] ... | [INFO] [stdout] 47 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 42 ~ if dir != map[next.0 as usize][next.1 as usize].2 [INFO] [stdout] 43 ~ && map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 44 | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/b.rs:54:25 [INFO] [stdout] | [INFO] [stdout] 54 | in_path.insert((actual.0 as i32, actual.1 as i32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `actual.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/bin/day16/b.rs:54:42 [INFO] [stdout] | [INFO] [stdout] 54 | in_path.insert((actual.0 as i32, actual.1 as i32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `actual.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: parameter is only used in recursion [INFO] [stdout] --> src/bin/day16/b.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | end: (usize, usize), [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_end` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/bin/day16/b.rs:38:50 [INFO] [stdout] | [INFO] [stdout] 38 | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 44 | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] | ^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16/b.rs:60:33 [INFO] [stdout] | [INFO] [stdout] 60 | pub fn solve_p1(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [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/bin/day16/b.rs:71:11 [INFO] [stdout] | [INFO] [stdout] 71 | while heap.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!heap.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 (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/b.rs:88:32 [INFO] [stdout] | [INFO] [stdout] 88 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day16/b.rs:89:32 [INFO] [stdout] | [INFO] [stdout] 89 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/b.rs:103:32 [INFO] [stdout] | [INFO] [stdout] 103 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day16/b.rs:104:32 [INFO] [stdout] | [INFO] [stdout] 104 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16/b.rs:116:32 [INFO] [stdout] | [INFO] [stdout] 116 | fn parse_input(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [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: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/bin/day14/a.rs:15:42 [INFO] [stdout] | [INFO] [stdout] 15 | println!("{:?}", quandrant_nb.iter().fold(1, |acc, robots| acc * robots)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [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/bin/day14/a.rs:17:66 [INFO] [stdout] | [INFO] [stdout] 17 | fn compute_position(robot: &((i32, i32), (i32, i32)), pos_to_nb: &mut 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 17 - fn compute_position(robot: &((i32, i32), (i32, i32)), pos_to_nb: &mut Vec) { [INFO] [stdout] 17 + fn compute_position(robot: &((i32, i32), (i32, i32)), pos_to_nb: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/day12/a.rs:43:24 [INFO] [stdout] | [INFO] [stdout] 43 | && map[position.0 as usize][position.1 as usize].1 == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!map[position.0 as usize][position.1 as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day12/a.rs:56:11 [INFO] [stdout] | [INFO] [stdout] 56 | while next.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next.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: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day12/b.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / if advent_util::is_in_bound(next_pos, map.len() as i32) { [INFO] [stdout] 45 | | if map[next_pos.0 as usize][next_pos.1 as usize].0 == map[position.0 as usize][position.1 as usize].0 { [INFO] [stdout] 46 | | if !visited.contains(&next_pos) [INFO] [stdout] 47 | | && !next.contains(&next_pos) [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if advent_util::is_in_bound(next_pos, map.len() as i32) [INFO] [stdout] 45 ~ && map[next_pos.0 as usize][next_pos.1 as usize].0 == map[position.0 as usize][position.1 as usize].0 { [INFO] [stdout] 46 | if !visited.contains(&next_pos) [INFO] [stdout] ... [INFO] [stdout] 51 | } [INFO] [stdout] 52 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day12/b.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | / if map[next_pos.0 as usize][next_pos.1 as usize].0 == map[position.0 as usize][position.1 as usize].0 { [INFO] [stdout] 46 | | if !visited.contains(&next_pos) [INFO] [stdout] 47 | | && !next.contains(&next_pos) [INFO] [stdout] 48 | | && map[position.0 as usize][position.1 as usize].1 == false [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 45 ~ if map[next_pos.0 as usize][next_pos.1 as usize].0 == map[position.0 as usize][position.1 as usize].0 [INFO] [stdout] 46 ~ && !visited.contains(&next_pos) [INFO] [stdout] 47 | && !next.contains(&next_pos) [INFO] [stdout] ... [INFO] [stdout] 50 | next.push(next_pos); [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/day12/b.rs:48:24 [INFO] [stdout] | [INFO] [stdout] 48 | && map[position.0 as usize][position.1 as usize].1 == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!map[position.0 as usize][position.1 as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day12/b.rs:59:11 [INFO] [stdout] | [INFO] [stdout] 59 | while next.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next.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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day12/b.rs:64:43 [INFO] [stdout] | [INFO] [stdout] 64 | fn check_angle(position: (i32, i32), map: &mut 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] 64 - fn check_angle(position: (i32, i32), map: &mut Vec>) -> i32 { [INFO] [stdout] 64 + fn check_angle(position: (i32, i32), map: &mut [Vec<(char, bool)>]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/day12/b.rs:91:49 [INFO] [stdout] | [INFO] [stdout] 91 | } else if !is_first_in && !is_second_in { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 92 | | res += 1; [INFO] [stdout] 93 | | } else if is_first_in && !is_second_in && val != map[first_point.0 as usize][first_point.1 as usize].0 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/day12/b.rs:93:112 [INFO] [stdout] | [INFO] [stdout] 93 | } else if is_first_in && !is_second_in && val != map[first_point.0 as usize][first_point.1 as usize].0 { [INFO] [stdout] | ________________________________________________________________________________________________________________^ [INFO] [stdout] 94 | | res += 1; [INFO] [stdout] 95 | | } else if !is_first_in && is_second_in && val != map[second_point.0 as usize][second_point.1 as usize].0 { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/day12/b.rs:93:112 [INFO] [stdout] | [INFO] [stdout] 93 | } else if is_first_in && !is_second_in && val != map[first_point.0 as usize][first_point.1 as usize].0 { [INFO] [stdout] | ________________________________________________________________________________________________________________^ [INFO] [stdout] 94 | | res += 1; [INFO] [stdout] 95 | | } else if !is_first_in && is_second_in && val != map[second_point.0 as usize][second_point.1 as usize].0 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/day12/b.rs:95:114 [INFO] [stdout] | [INFO] [stdout] 95 | } else if !is_first_in && is_second_in && val != map[second_point.0 as usize][second_point.1 as usize].0 { [INFO] [stdout] | __________________________________________________________________________________________________________________^ [INFO] [stdout] 96 | | res += 1; [INFO] [stdout] 97 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::BitXor` [INFO] [stdout] --> src/bin/day17/a.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::BitXor; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::BitXor` [INFO] [stdout] --> src/bin/day17/b.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::BitXor; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/day17/a.rs:85:56 [INFO] [stdout] | [INFO] [stdout] 85 | let registers = register.lines().enumerate().map(|(i, line)| { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day17/b.rs:4:10 [INFO] [stdout] | [INFO] [stdout] 4 | let (mut registers, mut target) = parse_input(input); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day17/b.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let mut instructions = target[..target.len()-2].to_vec(); [INFO] [stdout] | ----^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day17/b.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | let mut res = 0; [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `registers` [INFO] [stdout] --> src/bin/day17/b.rs:4:10 [INFO] [stdout] | [INFO] [stdout] 4 | let (mut registers, mut target) = parse_input(input); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_registers` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `all_found` [INFO] [stdout] --> src/bin/day17/b.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let all_found = false; [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_all_found` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `init_a` [INFO] [stdout] --> src/bin/day17/b.rs:67:87 [INFO] [stdout] | [INFO] [stdout] 67 | fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec, init_a : u64) -> Option { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_init_a` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/day17/b.rs:128:56 [INFO] [stdout] | [INFO] [stdout] 128 | let registers = register.lines().enumerate().map(|(i, line)| { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [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/bin/day14/b.rs:25:74 [INFO] [stdout] | [INFO] [stdout] 25 | fn compute_position(robot: &((i32, i32), (i32, i32)), n: i32, pos_to_nb: &mut 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 compute_position(robot: &((i32, i32), (i32, i32)), n: i32, pos_to_nb: &mut Vec) { [INFO] [stdout] 25 + fn compute_position(robot: &((i32, i32), (i32, i32)), n: i32, pos_to_nb: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day17/a.rs:11:16 [INFO] [stdout] | [INFO] [stdout] 11 | if output.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `output.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17/a.rs:22:76 [INFO] [stdout] | [INFO] [stdout] 22 | fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec) -> Option { [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] 22 - fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec) -> Option { [INFO] [stdout] 22 + fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &[u64]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::BitXor` [INFO] [stdout] --> src/bin/day17/a.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::BitXor; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::BitXor` [INFO] [stdout] --> src/bin/day17/b.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::BitXor; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17/a.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | registers[1] = registers[1] ^ operand; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `registers[1] ^= operand` [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: unused import: `std::collections::HashSet` [INFO] [stdout] --> src/bin/day10/b.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use std::collections::HashSet; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17/a.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | registers[1] = registers[1] ^ registers[2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `registers[1] ^= registers[2]` [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17/a.rs:69:40 [INFO] [stdout] | [INFO] [stdout] 69 | fn get_combo(operand: u64, registers : &mut Vec) -> u64 { [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] 69 - fn get_combo(operand: u64, registers : &mut Vec) -> u64 { [INFO] [stdout] 69 + fn get_combo(operand: u64, registers : &mut [u64]) -> u64 { [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/bin/day17/b.rs:20:19 [INFO] [stdout] | [INFO] [stdout] 20 | fn loopy(target : &Vec, mut res : u64, instructions: &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] 20 - fn loopy(target : &Vec, mut res : u64, instructions: &Vec) -> bool { [INFO] [stdout] 20 + fn loopy(target : &[u64], mut res : u64, instructions: &Vec) -> 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/bin/day17/b.rs:28:44 [INFO] [stdout] | [INFO] [stdout] 28 | let a = solve_a(init_a, *next, &instructions); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `instructions` [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/bin/day17/b.rs:32:57 [INFO] [stdout] | [INFO] [stdout] 32 | if loopy(&target[i+1..].to_vec(), res , &instructions) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `instructions` [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/bin/day17/b.rs:53:68 [INFO] [stdout] | [INFO] [stdout] 53 | if let Some(out) = exec_inst(&mut pointer, &mut registers, &instructions, init_a.clone()) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `instructions` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day17/b.rs:53:83 [INFO] [stdout] | [INFO] [stdout] 53 | if let Some(out) = exec_inst(&mut pointer, &mut registers, &instructions, init_a.clone()) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `init_a` [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: length comparison to zero [INFO] [stdout] --> src/bin/day17/b.rs:54:16 [INFO] [stdout] | [INFO] [stdout] 54 | if output.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `output.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17/b.rs:67:76 [INFO] [stdout] | [INFO] [stdout] 67 | fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec, init_a : u64) -> Option { [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 exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec, init_a : u64) -> Option { [INFO] [stdout] 67 + fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &[u64], init_a : u64) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17/b.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | registers[1] = registers[1] ^ operand; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `registers[1] ^= operand` [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/bin/day17/b.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | registers[1] = registers[1] ^ registers[2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `registers[1] ^= registers[2]` [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17/b.rs:112:40 [INFO] [stdout] | [INFO] [stdout] 112 | fn get_combo(operand: u64, registers : &mut Vec) -> u64 { [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] 112 - fn get_combo(operand: u64, registers : &mut Vec) -> u64 { [INFO] [stdout] 112 + fn get_combo(operand: u64, registers : &mut [u64]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `thread::current` [INFO] [stdout] --> src/bin/day6/main.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, thread::current, time::Instant}; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day13/a.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut data = parse_input(input); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/bin/day8/a.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use advent_util; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max` [INFO] [stdout] --> src/bin/day13/a.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let max = claw.price.0 / claw.button_b.0; [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_max` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/bin/day8/b.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use advent_util; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4/main.rs:45:53 [INFO] [stdout] | [INFO] [stdout] 45 | fn search_for_MAS((i, j): (i32, i32), char_matrice: &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] 45 - fn search_for_MAS((i, j): (i32, i32), char_matrice: &Vec>) -> i32 { [INFO] [stdout] 45 + fn search_for_MAS((i, j): (i32, i32), char_matrice: &[Vec]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/bin/day4/main.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | while let Some(next_char) = next_char_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for next_char in next_char_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/bin/day4/main.rs:62:21 [INFO] [stdout] | [INFO] [stdout] 62 | if is_ok && next_char_iter.next() == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `next_char_iter.next().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4/main.rs:68:47 [INFO] [stdout] | [INFO] [stdout] 68 | fn is_X_MAS((i, j): (i32, i32), char_matrice: &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] 68 - fn is_X_MAS((i, j): (i32, i32), char_matrice: &Vec>) -> bool { [INFO] [stdout] 68 + fn is_X_MAS((i, j): (i32, i32), char_matrice: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day13/b.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut data = parse_input(input); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max` [INFO] [stdout] --> src/bin/day13/b.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let max = claw.price.0 / claw.button_b.0; [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_max` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `search_for_MAS` should have a snake case name [INFO] [stdout] --> src/bin/day4/main.rs:45:4 [INFO] [stdout] | [INFO] [stdout] 45 | fn search_for_MAS((i, j): (i32, i32), char_matrice: &Vec>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: convert the identifier to snake case: `search_for_mas` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `is_X_MAS` should have a snake case name [INFO] [stdout] --> src/bin/day4/main.rs:68:4 [INFO] [stdout] | [INFO] [stdout] 68 | fn is_X_MAS((i, j): (i32, i32), char_matrice: &Vec>) -> bool { [INFO] [stdout] | ^^^^^^^^ help: convert the identifier to snake case: `is_x_mas` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/bin/day1/main.rs:40:40 [INFO] [stdout] | [INFO] [stdout] 40 | .map(|left_value| left_value * right_vec.get(left_value).or_else(|| Some(&0)).unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 40 - .map(|left_value| left_value * right_vec.get(left_value).or_else(|| Some(&0)).unwrap()) [INFO] [stdout] 40 + .map(|left_value| left_value * right_vec.get(left_value).or(Some(&0)).unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day16/b.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let mut to_process: Vec<(i32, i32)> = Vec::with_capacity(4); [INFO] [stdout] | ----^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `to_process` [INFO] [stdout] --> src/bin/day16/b.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let mut to_process: Vec<(i32, i32)> = Vec::with_capacity(4); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_to_process` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/day16/main.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | fn part2(input: &str) { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `solve` is never used [INFO] [stdout] --> src/bin/day16/b.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn solve(input: &str) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `explore` is never used [INFO] [stdout] --> src/bin/day16/b.rs:15:4 [INFO] [stdout] | [INFO] [stdout] 15 | fn explore( [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `solve_p1` is never used [INFO] [stdout] --> src/bin/day16/b.rs:60:8 [INFO] [stdout] | [INFO] [stdout] 60 | pub fn solve_p1(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_input` is never used [INFO] [stdout] --> src/bin/day16/b.rs:116:4 [INFO] [stdout] | [INFO] [stdout] 116 | fn parse_input(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ToProcess` is never constructed [INFO] [stdout] --> src/bin/day16/b.rs:141:8 [INFO] [stdout] | [INFO] [stdout] 141 | struct ToProcess { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day16/a.rs:15:11 [INFO] [stdout] | [INFO] [stdout] 15 | while heap.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!heap.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/a.rs:31:32 [INFO] [stdout] | [INFO] [stdout] 31 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/a.rs:32:32 [INFO] [stdout] | [INFO] [stdout] 32 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/a.rs:45:32 [INFO] [stdout] | [INFO] [stdout] 45 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day16/a.rs:46:32 [INFO] [stdout] | [INFO] [stdout] 46 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day16/a.rs:55:26 [INFO] [stdout] | [INFO] [stdout] 55 | println!("{:?}", map[end.0 as usize][end.1 as usize]) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ end.0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day16/a.rs:55:42 [INFO] [stdout] | [INFO] [stdout] 55 | println!("{:?}", map[end.0 as usize][end.1 as usize]) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `end.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16/a.rs:58:32 [INFO] [stdout] | [INFO] [stdout] 58 | fn parse_input(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16/b.rs:17:10 [INFO] [stdout] | [INFO] [stdout] 17 | map: &mut Vec>, [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: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day16/b.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | if ((next_poids == node_poid + 1) && dir == map[next.0 as usize][next.1 as usize].2) [INFO] [stdout] | ____________^ [INFO] [stdout] 36 | | || ((next_poids == node_poid + 1001) && dir == map[next.0 as usize][next.1 as usize].2) { [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] 35 - if ((next_poids == node_poid + 1) && dir == map[next.0 as usize][next.1 as usize].2) [INFO] [stdout] 36 - || ((next_poids == node_poid + 1001) && dir == map[next.0 as usize][next.1 as usize].2) { [INFO] [stdout] 35 + if !(dir != map[next.0 as usize][next.1 as usize].2 || next_poids != node_poid + 1 && next_poids != node_poid + 1001) { [INFO] [stdout] | [INFO] [stdout] 35 - if ((next_poids == node_poid + 1) && dir == map[next.0 as usize][next.1 as usize].2) [INFO] [stdout] 36 - || ((next_poids == node_poid + 1001) && dir == map[next.0 as usize][next.1 as usize].2) { [INFO] [stdout] 35 + if ((next_poids == node_poid + 1001) || (next_poids == node_poid + 1)) && dir == map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day16/b.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | / if map[next.0 as usize][next.1 as usize].0 == 'E' { [INFO] [stdout] 28 | | if next_poids == node_poid + 1 || next_poids == node_poid + 1001 { [INFO] [stdout] 29 | | is_ok = true; [INFO] [stdout] 30 | | in_path.insert(next); [INFO] [stdout] ... | [INFO] [stdout] 33 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if map[next.0 as usize][next.1 as usize].0 == 'E' [INFO] [stdout] 28 ~ && (next_poids == node_poid + 1 || next_poids == node_poid + 1001) { [INFO] [stdout] 29 | is_ok = true; [INFO] [stdout] 30 | in_path.insert(next); [INFO] [stdout] 31 | continue; [INFO] [stdout] 32 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day16/b.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | / if next_poids + 1000 == node_poid + 1 { [INFO] [stdout] 41 | | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 42 | | if dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] 43 | | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] ... | [INFO] [stdout] 50 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 40 ~ if next_poids + 1000 == node_poid + 1 [INFO] [stdout] 41 ~ && map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 42 | if dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] ... [INFO] [stdout] 48 | [INFO] [stdout] 49 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day16/b.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | / if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 42 | | if dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] 43 | | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 44 | | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 41 ~ if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 [INFO] [stdout] 42 ~ && dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] 43 | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] ... [INFO] [stdout] 46 | [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day16/b.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | / if dir != map[next.0 as usize][next.1 as usize].2 { [INFO] [stdout] 43 | | if map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 44 | | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] ... | [INFO] [stdout] 47 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 42 ~ if dir != map[next.0 as usize][next.1 as usize].2 [INFO] [stdout] 43 ~ && map[(next.0 + dir.0) as usize][(next.1 + dir.1) as usize].1 == node_poid + 2 { [INFO] [stdout] 44 | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/b.rs:54:25 [INFO] [stdout] | [INFO] [stdout] 54 | in_path.insert((actual.0 as i32, actual.1 as i32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `actual.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/bin/day16/b.rs:54:42 [INFO] [stdout] | [INFO] [stdout] 54 | in_path.insert((actual.0 as i32, actual.1 as i32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `actual.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: parameter is only used in recursion [INFO] [stdout] --> src/bin/day16/b.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | end: (usize, usize), [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_end` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/bin/day16/b.rs:38:50 [INFO] [stdout] | [INFO] [stdout] 38 | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 44 | is_ok |= explore(in_path, map, next, end); [INFO] [stdout] | ^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16/b.rs:60:33 [INFO] [stdout] | [INFO] [stdout] 60 | pub fn solve_p1(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [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/bin/day16/b.rs:71:11 [INFO] [stdout] | [INFO] [stdout] 71 | while heap.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!heap.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 (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/b.rs:88:32 [INFO] [stdout] | [INFO] [stdout] 88 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day16/b.rs:89:32 [INFO] [stdout] | [INFO] [stdout] 89 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day16/b.rs:103:32 [INFO] [stdout] | [INFO] [stdout] 103 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day16/b.rs:104:32 [INFO] [stdout] | [INFO] [stdout] 104 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16/b.rs:116:32 [INFO] [stdout] | [INFO] [stdout] 116 | fn parse_input(input: &str) -> (Vec>, (usize, usize), (usize, usize)) { [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: unused variable: `i` [INFO] [stdout] --> src/bin/day17/a.rs:85:56 [INFO] [stdout] | [INFO] [stdout] 85 | let registers = register.lines().enumerate().map(|(i, line)| { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day17/b.rs:4:10 [INFO] [stdout] | [INFO] [stdout] 4 | let (mut registers, mut target) = parse_input(input); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day10/a.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | / if !explored_pos.contains(&new_pos) { [INFO] [stdout] 29 | | if is_in_bound(new_pos, map.len() as i32) { [INFO] [stdout] 30 | | let val = map[new_pos.0 as usize][new_pos.1 as usize]; [INFO] [stdout] 31 | | if val - map[position.0 as usize][position.1 as usize] == 1 { [INFO] [stdout] ... | [INFO] [stdout] 39 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 28 ~ if !explored_pos.contains(&new_pos) [INFO] [stdout] 29 ~ && is_in_bound(new_pos, map.len() as i32) { [INFO] [stdout] 30 | let val = map[new_pos.0 as usize][new_pos.1 as usize]; [INFO] [stdout] ... [INFO] [stdout] 37 | } [INFO] [stdout] 38 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day17/b.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let mut instructions = target[..target.len()-2].to_vec(); [INFO] [stdout] | ----^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day17/b.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | let mut res = 0; [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `registers` [INFO] [stdout] --> src/bin/day17/b.rs:4:10 [INFO] [stdout] | [INFO] [stdout] 4 | let (mut registers, mut target) = parse_input(input); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_registers` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `all_found` [INFO] [stdout] --> src/bin/day17/b.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let all_found = false; [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_all_found` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `init_a` [INFO] [stdout] --> src/bin/day17/b.rs:67:87 [INFO] [stdout] | [INFO] [stdout] 67 | fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec, init_a : u64) -> Option { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_init_a` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/day17/b.rs:128:56 [INFO] [stdout] | [INFO] [stdout] 128 | let registers = register.lines().enumerate().map(|(i, line)| { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day17/a.rs:11:16 [INFO] [stdout] | [INFO] [stdout] 11 | if output.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `output.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17/a.rs:22:76 [INFO] [stdout] | [INFO] [stdout] 22 | fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec) -> Option { [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] 22 - fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec) -> Option { [INFO] [stdout] 22 + fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &[u64]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17/a.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | registers[1] = registers[1] ^ operand; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `registers[1] ^= operand` [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/bin/day17/a.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | registers[1] = registers[1] ^ registers[2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `registers[1] ^= registers[2]` [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17/a.rs:69:40 [INFO] [stdout] | [INFO] [stdout] 69 | fn get_combo(operand: u64, registers : &mut Vec) -> u64 { [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] 69 - fn get_combo(operand: u64, registers : &mut Vec) -> u64 { [INFO] [stdout] 69 + fn get_combo(operand: u64, registers : &mut [u64]) -> u64 { [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/bin/day17/b.rs:20:19 [INFO] [stdout] | [INFO] [stdout] 20 | fn loopy(target : &Vec, mut res : u64, instructions: &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] 20 - fn loopy(target : &Vec, mut res : u64, instructions: &Vec) -> bool { [INFO] [stdout] 20 + fn loopy(target : &[u64], mut res : u64, instructions: &Vec) -> 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/bin/day17/b.rs:28:44 [INFO] [stdout] | [INFO] [stdout] 28 | let a = solve_a(init_a, *next, &instructions); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `instructions` [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/bin/day17/b.rs:32:57 [INFO] [stdout] | [INFO] [stdout] 32 | if loopy(&target[i+1..].to_vec(), res , &instructions) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `instructions` [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/bin/day17/b.rs:53:68 [INFO] [stdout] | [INFO] [stdout] 53 | if let Some(out) = exec_inst(&mut pointer, &mut registers, &instructions, init_a.clone()) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `instructions` [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: using `clone` on type `u64` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day17/b.rs:53:83 [INFO] [stdout] | [INFO] [stdout] 53 | if let Some(out) = exec_inst(&mut pointer, &mut registers, &instructions, init_a.clone()) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `init_a` [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: length comparison to zero [INFO] [stdout] --> src/bin/day17/b.rs:54:16 [INFO] [stdout] | [INFO] [stdout] 54 | if output.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `output.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17/b.rs:67:76 [INFO] [stdout] | [INFO] [stdout] 67 | fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec, init_a : u64) -> Option { [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 exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &Vec, init_a : u64) -> Option { [INFO] [stdout] 67 + fn exec_inst(pointer: &mut usize, registers : &mut Vec, instructions: &[u64], init_a : u64) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17/b.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | registers[1] = registers[1] ^ operand; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `registers[1] ^= operand` [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: variable does not need to be mutable [INFO] [stdout] --> src/bin/day15/a.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut map_moves = parse_input(input); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17/b.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | registers[1] = registers[1] ^ registers[2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `registers[1] ^= registers[2]` [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17/b.rs:112:40 [INFO] [stdout] | [INFO] [stdout] 112 | fn get_combo(operand: u64, registers : &mut Vec) -> u64 { [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] 112 - fn get_combo(operand: u64, registers : &mut Vec) -> u64 { [INFO] [stdout] 112 + fn get_combo(operand: u64, registers : &mut [u64]) -> u64 { [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/bin/day4/main.rs:45:53 [INFO] [stdout] | [INFO] [stdout] 45 | fn search_for_MAS((i, j): (i32, i32), char_matrice: &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] 45 - fn search_for_MAS((i, j): (i32, i32), char_matrice: &Vec>) -> i32 { [INFO] [stdout] 45 + fn search_for_MAS((i, j): (i32, i32), char_matrice: &[Vec]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/bin/day4/main.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | while let Some(next_char) = next_char_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for next_char in next_char_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/bin/day4/main.rs:62:21 [INFO] [stdout] | [INFO] [stdout] 62 | if is_ok && next_char_iter.next() == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `next_char_iter.next().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4/main.rs:68:47 [INFO] [stdout] | [INFO] [stdout] 68 | fn is_X_MAS((i, j): (i32, i32), char_matrice: &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] 68 - fn is_X_MAS((i, j): (i32, i32), char_matrice: &Vec>) -> bool { [INFO] [stdout] 68 + fn is_X_MAS((i, j): (i32, i32), char_matrice: &[Vec]) -> 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/bin/day8/a.rs:14:28 [INFO] [stdout] | [INFO] [stdout] 14 | fn count_antinode(antenas: &Vec<(i32, i32)>, positions: &mut HashSet<(i32, i32)>, max: 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] 14 - fn count_antinode(antenas: &Vec<(i32, i32)>, positions: &mut HashSet<(i32, i32)>, max: i32) { [INFO] [stdout] 14 + fn count_antinode(antenas: &[(i32, i32)], positions: &mut HashSet<(i32, i32)>, max: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `search_for_MAS` should have a snake case name [INFO] [stdout] --> src/bin/day4/main.rs:45:4 [INFO] [stdout] | [INFO] [stdout] 45 | fn search_for_MAS((i, j): (i32, i32), char_matrice: &Vec>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: convert the identifier to snake case: `search_for_mas` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `is_X_MAS` should have a snake case name [INFO] [stdout] --> src/bin/day4/main.rs:68:4 [INFO] [stdout] | [INFO] [stdout] 68 | fn is_X_MAS((i, j): (i32, i32), char_matrice: &Vec>) -> bool { [INFO] [stdout] | ^^^^^^^^ help: convert the identifier to snake case: `is_x_mas` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day6/main.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | let mut sum = 0; [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day6/main.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | let mut current_pos = initial_position; [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day6/main.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | let mut next_move = moves_helper.next(); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `sum` [INFO] [stdout] --> src/bin/day6/main.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | let mut sum = 0; [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_sum` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `current_pos` [INFO] [stdout] --> src/bin/day6/main.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | let mut current_pos = initial_position; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_current_pos` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `next_move` [INFO] [stdout] --> src/bin/day6/main.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | let mut next_move = moves_helper.next(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_next_move` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day8/b.rs:14:28 [INFO] [stdout] | [INFO] [stdout] 14 | fn count_antinode(antenas: &Vec<(i32, i32)>, positions: &mut HashSet<(i32, i32)>, max: 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] 14 - fn count_antinode(antenas: &Vec<(i32, i32)>, positions: &mut HashSet<(i32, i32)>, max: i32) { [INFO] [stdout] 14 + fn count_antinode(antenas: &[(i32, i32)], positions: &mut HashSet<(i32, i32)>, max: 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/bin/day6/main.rs:62:15 [INFO] [stdout] | [INFO] [stdout] 62 | fn check(map: &Vec>, initial_position: (i32, i32)) -> 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 62 - fn check(map: &Vec>, initial_position: (i32, i32)) -> bool { [INFO] [stdout] 62 + fn check(map: &[Vec], initial_position: (i32, i32)) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day6/main.rs:154:21 [INFO] [stdout] | [INFO] [stdout] 154 | return char; [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] 154 - return char; [INFO] [stdout] 154 + char [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day15/b.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let mut map_moves = parse_input(input); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day9/b.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut all_numbers = parse_input(input); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day9/b.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let mut max_j = all_numbers.len() - 1; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/day12/a.rs:43:24 [INFO] [stdout] | [INFO] [stdout] 43 | && map[position.0 as usize][position.1 as usize].1 == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!map[position.0 as usize][position.1 as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max_j` [INFO] [stdout] --> src/bin/day9/b.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let mut max_j = all_numbers.len() - 1; [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_max_j` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day12/a.rs:56:11 [INFO] [stdout] | [INFO] [stdout] 56 | while next.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next.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: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day12/b.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / if advent_util::is_in_bound(next_pos, map.len() as i32) { [INFO] [stdout] 45 | | if map[next_pos.0 as usize][next_pos.1 as usize].0 == map[position.0 as usize][position.1 as usize].0 { [INFO] [stdout] 46 | | if !visited.contains(&next_pos) [INFO] [stdout] 47 | | && !next.contains(&next_pos) [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if advent_util::is_in_bound(next_pos, map.len() as i32) [INFO] [stdout] 45 ~ && map[next_pos.0 as usize][next_pos.1 as usize].0 == map[position.0 as usize][position.1 as usize].0 { [INFO] [stdout] 46 | if !visited.contains(&next_pos) [INFO] [stdout] ... [INFO] [stdout] 51 | } [INFO] [stdout] 52 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day9/b.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut all_numbers = parse_input(input); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/day12/b.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | / if map[next_pos.0 as usize][next_pos.1 as usize].0 == map[position.0 as usize][position.1 as usize].0 { [INFO] [stdout] 46 | | if !visited.contains(&next_pos) [INFO] [stdout] 47 | | && !next.contains(&next_pos) [INFO] [stdout] 48 | | && map[position.0 as usize][position.1 as usize].1 == false [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 45 ~ if map[next_pos.0 as usize][next_pos.1 as usize].0 == map[position.0 as usize][position.1 as usize].0 [INFO] [stdout] 46 ~ && !visited.contains(&next_pos) [INFO] [stdout] 47 | && !next.contains(&next_pos) [INFO] [stdout] ... [INFO] [stdout] 50 | next.push(next_pos); [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day9/b.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let mut max_j = all_numbers.len() - 1; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/day12/b.rs:48:24 [INFO] [stdout] | [INFO] [stdout] 48 | && map[position.0 as usize][position.1 as usize].1 == false [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!map[position.0 as usize][position.1 as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max_j` [INFO] [stdout] --> src/bin/day9/b.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let mut max_j = all_numbers.len() - 1; [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_max_j` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day12/b.rs:59:11 [INFO] [stdout] | [INFO] [stdout] 59 | while next.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!next.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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day12/b.rs:64:43 [INFO] [stdout] | [INFO] [stdout] 64 | fn check_angle(position: (i32, i32), map: &mut 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] 64 - fn check_angle(position: (i32, i32), map: &mut Vec>) -> i32 { [INFO] [stdout] 64 + fn check_angle(position: (i32, i32), map: &mut [Vec<(char, bool)>]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/day12/b.rs:91:49 [INFO] [stdout] | [INFO] [stdout] 91 | } else if !is_first_in && !is_second_in { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 92 | | res += 1; [INFO] [stdout] 93 | | } else if is_first_in && !is_second_in && val != map[first_point.0 as usize][first_point.1 as usize].0 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/day12/b.rs:93:112 [INFO] [stdout] | [INFO] [stdout] 93 | } else if is_first_in && !is_second_in && val != map[first_point.0 as usize][first_point.1 as usize].0 { [INFO] [stdout] | ________________________________________________________________________________________________________________^ [INFO] [stdout] 94 | | res += 1; [INFO] [stdout] 95 | | } else if !is_first_in && is_second_in && val != map[second_point.0 as usize][second_point.1 as usize].0 { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/day12/b.rs:93:112 [INFO] [stdout] | [INFO] [stdout] 93 | } else if is_first_in && !is_second_in && val != map[first_point.0 as usize][first_point.1 as usize].0 { [INFO] [stdout] | ________________________________________________________________________________________________________________^ [INFO] [stdout] 94 | | res += 1; [INFO] [stdout] 95 | | } else if !is_first_in && is_second_in && val != map[second_point.0 as usize][second_point.1 as usize].0 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/day12/b.rs:95:114 [INFO] [stdout] | [INFO] [stdout] 95 | } else if !is_first_in && is_second_in && val != map[second_point.0 as usize][second_point.1 as usize].0 { [INFO] [stdout] | __________________________________________________________________________________________________________________^ [INFO] [stdout] 96 | | res += 1; [INFO] [stdout] 97 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/day15/main.rs:15:10 [INFO] [stdout] | [INFO] [stdout] 15 | fn part1(input: &str) { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `solve` is never used [INFO] [stdout] --> src/bin/day15/a.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn solve(input: &str) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `find_next_empty` is never used [INFO] [stdout] --> src/bin/day15/a.rs:44:4 [INFO] [stdout] | [INFO] [stdout] 44 | fn find_next_empty(pos: (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parse_input` is never used [INFO] [stdout] --> src/bin/day15/a.rs:55:4 [INFO] [stdout] | [INFO] [stdout] 55 | fn parse_input(input: &str) -> MapMove { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MapMove` is never constructed [INFO] [stdout] --> src/bin/day15/a.rs:94:8 [INFO] [stdout] | [INFO] [stdout] 94 | struct MapMove { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `all_numbers` [INFO] [stdout] --> src/bin/day9/b.rs:12:14 [INFO] [stdout] | [INFO] [stdout] 12 | for i in 0..all_numbers.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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 12 - for i in 0..all_numbers.len() { [INFO] [stdout] 12 + for (i, ) in all_numbers.iter().enumerate() { [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/bin/day15/a.rs:44:66 [INFO] [stdout] | [INFO] [stdout] 44 | fn find_next_empty(pos: (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [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] 44 - fn find_next_empty(pos: (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [INFO] [stdout] 44 + fn find_next_empty(pos: (usize, usize), moves: &(i32, i32), map: &[Vec]) -> Option<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/bin/day9/b.rs:22:21 [INFO] [stdout] | [INFO] [stdout] 22 | output.push(0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `output.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `all_numbers` [INFO] [stdout] --> src/bin/day9/b.rs:12:14 [INFO] [stdout] | [INFO] [stdout] 12 | for i in 0..all_numbers.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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 12 - for i in 0..all_numbers.len() { [INFO] [stdout] 12 + for (i, ) in all_numbers.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/bin/day9/b.rs:22:21 [INFO] [stdout] | [INFO] [stdout] 22 | output.push(0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `output.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/day15/a.rs:76:10 [INFO] [stdout] | [INFO] [stdout] 76 | .map(|line| { [INFO] [stdout] | __________^ [INFO] [stdout] 77 | | line.chars() [INFO] [stdout] 78 | | .map(|charr| match charr { [INFO] [stdout] 79 | | '<' => (0, -1), [INFO] [stdout] ... | [INFO] [stdout] 86 | | }) [INFO] [stdout] 87 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 76 ~ .flat_map(|line| { [INFO] [stdout] 77 + line.chars() [INFO] [stdout] 78 + .map(|charr| match charr { [INFO] [stdout] 79 + '<' => (0, -1), [INFO] [stdout] 80 + '^' => (-1, 0), [INFO] [stdout] 81 + '>' => (0, 1), [INFO] [stdout] 82 + 'v' => (1, 0), [INFO] [stdout] 83 + _ => panic!("not a move"), [INFO] [stdout] 84 + }) [INFO] [stdout] 85 + .collect::>() [INFO] [stdout] 86 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day13/a.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut data = parse_input(input); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max` [INFO] [stdout] --> src/bin/day13/a.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let max = claw.price.0 / claw.button_b.0; [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_max` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day9/b.rs:47:48 [INFO] [stdout] | [INFO] [stdout] 47 | .fold(0, |acc, (i, num)| acc + i * *num as usize) [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `*num` [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: variable does not need to be mutable [INFO] [stdout] --> src/bin/day13/b.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut data = parse_input(input); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max` [INFO] [stdout] --> src/bin/day13/b.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let max = claw.price.0 / claw.button_b.0; [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_max` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `thread::current` [INFO] [stdout] --> src/bin/day6/main.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, thread::current, time::Instant}; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day9/b.rs:47:48 [INFO] [stdout] | [INFO] [stdout] 47 | .fold(0, |acc, (i, num)| acc + i * *num as usize) [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `*num` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day15/b.rs:41:59 [INFO] [stdout] | [INFO] [stdout] 41 | if let Some(next_empty) = find_next_empty(pos, moves, &map) { [INFO] [stdout] | ^^^^ help: change this to: `map` [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 looks like you are swapping `map[next.0 as usize][next.1 as usize]` and `char_to_move` manually [INFO] [stdout] --> src/bin/day15/b.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | / let tmp = map[next.0 as usize][next.1 as usize]; [INFO] [stdout] 51 | | map[next.0 as usize][next.1 as usize] = char_to_move; [INFO] [stdout] 52 | | char_to_move = tmp; [INFO] [stdout] | |_______________________________^ help: try: `std::mem::swap(&mut map[next.0 as usize][next.1 as usize], &mut char_to_move);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day15/b.rs:53:21 [INFO] [stdout] | [INFO] [stdout] 53 | next = (next.0 as i32 + moves.0, next.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day15/b.rs:53:46 [INFO] [stdout] | [INFO] [stdout] 53 | next = (next.0 as i32 + moves.0, next.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day15/b.rs:62:71 [INFO] [stdout] | [INFO] [stdout] 62 | fn find_next_empty(pos: &mut (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [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] 62 - fn find_next_empty(pos: &mut (usize, usize), moves: &(i32, i32), map: &Vec>) -> Option<(usize, usize)> { [INFO] [stdout] 62 + fn find_next_empty(pos: &mut (usize, usize), moves: &(i32, i32), map: &[Vec]) -> Option<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/bin/day15/b.rs:79:9 [INFO] [stdout] | [INFO] [stdout] 79 | vec_box.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 79 - vec_box.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] 79 + vec_box.sort_by_key(|a| a.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day15/b.rs:84:25 [INFO] [stdout] | [INFO] [stdout] 84 | let next = (ele.0 as i32 + moves.0, ele.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ele.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/bin/day15/b.rs:84:49 [INFO] [stdout] | [INFO] [stdout] 84 | let next = (ele.0 as i32 + moves.0, ele.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `ele.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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day15/b.rs:90:13 [INFO] [stdout] | [INFO] [stdout] 90 | map[pos.0 as usize][pos.1 as usize] = '.'; [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/day15/b.rs:90:29 [INFO] [stdout] | [INFO] [stdout] 90 | map[pos.0 as usize][pos.1 as usize] = '.'; [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: length comparison to zero [INFO] [stdout] --> src/bin/day15/b.rs:110:11 [INFO] [stdout] | [INFO] [stdout] 110 | while boxes_to_check.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!boxes_to_check.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day15/b.rs:112:17 [INFO] [stdout] | [INFO] [stdout] 112 | next = (boxx.0 as i32 + moves.0, boxx.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `boxx.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/bin/day15/b.rs:112:42 [INFO] [stdout] | [INFO] [stdout] 112 | next = (boxx.0 as i32 + moves.0, boxx.1 as i32 + moves.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `boxx.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 `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15/b.rs:124:17 [INFO] [stdout] | [INFO] [stdout] 124 | fn check_a(map: &mut Vec>, next: (i32, i32), boxes_to_check: &mut VecDeque<(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] 124 - fn check_a(map: &mut Vec>, next: (i32, i32), boxes_to_check: &mut VecDeque<(i32, i32)>) { [INFO] [stdout] 124 + fn check_a(map: &mut [Vec], next: (i32, i32), boxes_to_check: &mut VecDeque<(i32, i32)>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/day15/b.rs:161:10 [INFO] [stdout] | [INFO] [stdout] 161 | .map(|line| { [INFO] [stdout] | __________^ [INFO] [stdout] 162 | | line.chars() [INFO] [stdout] 163 | | .map(|charr| match charr { [INFO] [stdout] 164 | | '<' => (0, -1), [INFO] [stdout] ... | [INFO] [stdout] 171 | | }) [INFO] [stdout] 172 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 161 ~ .flat_map(|line| { [INFO] [stdout] 162 + line.chars() [INFO] [stdout] 163 + .map(|charr| match charr { [INFO] [stdout] 164 + '<' => (0, -1), [INFO] [stdout] 165 + '^' => (-1, 0), [INFO] [stdout] 166 + '>' => (0, 1), [INFO] [stdout] 167 + 'v' => (1, 0), [INFO] [stdout] 168 + _ => panic!("not a move"), [INFO] [stdout] 169 + }) [INFO] [stdout] 170 + .collect::>() [INFO] [stdout] 171 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/bin/day1/main.rs:40:40 [INFO] [stdout] | [INFO] [stdout] 40 | .map(|left_value| left_value * right_vec.get(left_value).or_else(|| Some(&0)).unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 40 - .map(|left_value| left_value * right_vec.get(left_value).or_else(|| Some(&0)).unwrap()) [INFO] [stdout] 40 + .map(|left_value| left_value * right_vec.get(left_value).or(Some(&0)).unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day6/main.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | let mut sum = 0; [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day6/main.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | let mut current_pos = initial_position; [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/day6/main.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | let mut next_move = moves_helper.next(); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `sum` [INFO] [stdout] --> src/bin/day6/main.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | let mut sum = 0; [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_sum` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `current_pos` [INFO] [stdout] --> src/bin/day6/main.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | let mut current_pos = initial_position; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_current_pos` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `next_move` [INFO] [stdout] --> src/bin/day6/main.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | let mut next_move = moves_helper.next(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_next_move` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6/main.rs:62:15 [INFO] [stdout] | [INFO] [stdout] 62 | fn check(map: &Vec>, initial_position: (i32, i32)) -> 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 62 - fn check(map: &Vec>, initial_position: (i32, i32)) -> bool { [INFO] [stdout] 62 + fn check(map: &[Vec], initial_position: (i32, i32)) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day6/main.rs:154:21 [INFO] [stdout] | [INFO] [stdout] 154 | return char; [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] 154 - return char; [INFO] [stdout] 154 + char [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `direction` is never read [INFO] [stdout] --> src/bin/day18/a.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 55 | struct ToProcess { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 59 | direction: (i32, i32), [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ToProcess` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `direction` is never read [INFO] [stdout] --> src/bin/day18/b.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 63 | struct ToProcess { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 67 | direction: (i32, i32), [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ToProcess` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/bin/day18/a.rs:9:12 [INFO] [stdout] | [INFO] [stdout] 9 | i: 0 as i32, [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/bin/day18/a.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | j: 0 as i32, [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: length comparison to zero [INFO] [stdout] --> src/bin/day18/a.rs:14:11 [INFO] [stdout] | [INFO] [stdout] 14 | while heap.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!heap.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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day18/a.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day18/a.rs:30:32 [INFO] [stdout] | [INFO] [stdout] 30 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/bin/day18/b.rs:20:12 [INFO] [stdout] | [INFO] [stdout] 20 | i: 0 as i32, [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: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/bin/day18/b.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 21 | j: 0 as i32, [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: length comparison to zero [INFO] [stdout] --> src/bin/day18/b.rs:25:11 [INFO] [stdout] | [INFO] [stdout] 25 | while heap.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!heap.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 (`i32` -> `i32`) [INFO] [stdout] --> src/bin/day18/b.rs:39:32 [INFO] [stdout] | [INFO] [stdout] 39 | ... i: next.0 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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/bin/day18/b.rs:40:32 [INFO] [stdout] | [INFO] [stdout] 40 | ... j: next.1 as i32, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `next.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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.64s [INFO] running `Command { std: "docker" "inspect" "a655cfd69c55d98dc3432557abe9871e509d9c7ec30683da4c8ecec907ae8457", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a655cfd69c55d98dc3432557abe9871e509d9c7ec30683da4c8ecec907ae8457", kill_on_drop: false }` [INFO] [stdout] a655cfd69c55d98dc3432557abe9871e509d9c7ec30683da4c8ecec907ae8457