[INFO] cloning repository https://github.com/rChaoz/advent-2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/rChaoz/advent-2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FrChaoz%2Fadvent-2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FrChaoz%2Fadvent-2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] cff87fc0b491b73647cb6ef9d48d055914f39341 [INFO] linting rChaoz/advent-2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FrChaoz%2Fadvent-2024" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/rChaoz/advent-2024 [INFO] finished tweaking git repo https://github.com/rChaoz/advent-2024 [INFO] tweaked toml for git repo https://github.com/rChaoz/advent-2024 written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/rChaoz/advent-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/rChaoz/advent-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] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded fix_fn v1.0.2 [INFO] [stderr] Downloaded kust v0.0.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 0c75b11d68708262480cc25ce11d85996c2b98c411e9dbb2a3cfd4911672607e [INFO] running `Command { std: "docker" "start" "-a" "0c75b11d68708262480cc25ce11d85996c2b98c411e9dbb2a3cfd4911672607e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "0c75b11d68708262480cc25ce11d85996c2b98c411e9dbb2a3cfd4911672607e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0c75b11d68708262480cc25ce11d85996c2b98c411e9dbb2a3cfd4911672607e", kill_on_drop: false }` [INFO] [stdout] 0c75b11d68708262480cc25ce11d85996c2b98c411e9dbb2a3cfd4911672607e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 0679b3e0a4ffa4756204e71e8ab24d1a417cde0274dfca691e78ff79e82a45d6 [INFO] running `Command { std: "docker" "start" "-a" "0679b3e0a4ffa4756204e71e8ab24d1a417cde0274dfca691e78ff79e82a45d6", kill_on_drop: false }` [INFO] [stderr] Checking memchr v2.7.4 [INFO] [stderr] Checking kust v0.0.2 [INFO] [stderr] Compiling seq-macro v0.3.5 [INFO] [stderr] Checking fix_fn v1.0.2 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking aoc-2024-rust v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day_1.rs:22:26 [INFO] [stdout] | [INFO] [stdout] 22 | fn parse(input: &str) -> Map (u32, u32)> { [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: you are using an explicit closure for copying elements [INFO] [stdout] --> src/days/day_1.rs:55:36 [INFO] [stdout] | [INFO] [stdout] 55 | similarity += num as u64 * count.get(&num).map(|&n| n).unwrap_or(0) as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `count.get(&num).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_2.rs:29:18 [INFO] [stdout] | [INFO] [stdout] 29 | fn is_safe(nums: &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] 29 - fn is_safe(nums: &Vec) -> bool { [INFO] [stdout] 29 + fn is_safe(nums: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days/day_4.rs:84:20 [INFO] [stdout] | [INFO] [stdout] 84 | if !(a == b'M' && b == b'S') && !(a == b'S' && b == b'M') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(a == b'M' && b == b'S' || a == b'S' && b == b'M')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days/day_4.rs:92:20 [INFO] [stdout] | [INFO] [stdout] 92 | if !(a == b'M' && b == b'S') && !(a == b'S' && b == b'M') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(a == b'M' && b == b'S' || a == b'S' && b == b'M')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day_5.rs:42:39 [INFO] [stdout] | [INFO] [stdout] 42 | fn parse_rules<'a>(input: &'a str) -> (Vec<(u32, u32)>, Box>>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_5.rs:64:25 [INFO] [stdout] | [INFO] [stdout] 64 | fn check_update(update: &Vec, rules: &Vec<(u32, u32)>) -> 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] 64 - fn check_update(update: &Vec, rules: &Vec<(u32, u32)>) -> bool { [INFO] [stdout] 64 + fn check_update(update: &[u32], rules: &Vec<(u32, u32)>) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day_5.rs:100:40 [INFO] [stdout] | [INFO] [stdout] 100 | .filter(|update| !check_update(&update, &rules)) [INFO] [stdout] | ^^^^^^^ help: change this to: `update` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day_5.rs:113:58 [INFO] [stdout] | [INFO] [stdout] 113 | ... || !all_numbers.contains(&first) [INFO] [stdout] | ^^^^^^ help: change this to: `first` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day_5.rs:114:53 [INFO] [stdout] | [INFO] [stdout] 114 | ... || numbers.contains(&first) [INFO] [stdout] | ^^^^^^ help: change this to: `first` [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_6.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | fn run(map: &mut Vec>, mut x: i32, mut y: i32, mut direction: Direction) -> 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] 76 - fn run(map: &mut Vec>, mut x: i32, mut y: i32, mut direction: Direction) -> bool { [INFO] [stdout] 76 + fn run(map: &mut [Vec], mut x: i32, mut y: i32, mut direction: Direction) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day_7.rs:35:8 [INFO] [stdout] | [INFO] [stdout] 35 | if rest.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `rest.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day_8.rs:27:26 [INFO] [stdout] | [INFO] [stdout] 27 | fn parse(input: &str) -> (Range, Range, HashMap>) { [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 `repeat().take()` can be written more concisely [INFO] [stdout] --> src/days/day_9.rs:107:13 [INFO] [stdout] | [INFO] [stdout] 107 | / repeat(if index % 2 != 0 { [INFO] [stdout] 108 | | Block::Free [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | Block::File(index as u32 / 2) [INFO] [stdout] 111 | | }) [INFO] [stdout] 112 | | .take(len as usize) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] help: consider using `repeat_n()` instead [INFO] [stdout] | [INFO] [stdout] 107 ~ std::iter::repeat_n(if index % 2 != 0 { [INFO] [stdout] 108 + Block::Free [INFO] [stdout] 109 + } else { [INFO] [stdout] 110 + Block::File(index as u32 / 2) [INFO] [stdout] 111 + }, len as usize) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/days/day_11.rs:23:16 [INFO] [stdout] | [INFO] [stdout] 23 | if digits % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `digits.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `dir` is only used to index `DIRECTIONS` [INFO] [stdout] --> src/days/day_12.rs:42:16 [INFO] [stdout] | [INFO] [stdout] 42 | for dir in 0..DIRECTIONS.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 42 - for dir in 0..DIRECTIONS.len() { [INFO] [stdout] 42 + for in &DIRECTIONS { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_12.rs:67:45 [INFO] [stdout] | [INFO] [stdout] 67 | fn base u32>(map: &Vec>, mut f: F) { [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 base u32>(map: &Vec>, mut f: F) { [INFO] [stdout] 67 + fn base u32>(map: &[Vec], mut f: F) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_14.rs:65:24 [INFO] [stdout] | [INFO] [stdout] 65 | fn move_robots(robots: &mut Vec, seconds: 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] 65 - fn move_robots(robots: &mut Vec, seconds: i32) { [INFO] [stdout] 65 + fn move_robots(robots: &mut [Robot], seconds: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_15.rs:103:14 [INFO] [stdout] | [INFO] [stdout] 103 | map: &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] 103 - map: &Vec>, [INFO] [stdout] 103 + map: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_15.rs:118:48 [INFO] [stdout] | [INFO] [stdout] 118 | fn map_calc_gps bool>(map: &Vec>, matcher: F) -> u32 { [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] 118 - fn map_calc_gps bool>(map: &Vec>, matcher: F) -> u32 { [INFO] [stdout] 118 + fn map_calc_gps bool>(map: &[Vec], matcher: F) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/days/day_15.rs:215:33 [INFO] [stdout] | [INFO] [stdout] 215 | / ... match tile { [INFO] [stdout] 216 | | ... Tile1::Wall | Tile1::Box(true) => true, [INFO] [stdout] 217 | | ... _ => false, [INFO] [stdout] 218 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 215 - match tile { [INFO] [stdout] 216 - Tile1::Wall | Tile1::Box(true) => true, [INFO] [stdout] 217 - _ => false, [INFO] [stdout] 218 - } [INFO] [stdout] 215 + matches!(tile, Tile1::Wall | Tile1::Box(true)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/days/day_15.rs:235:44 [INFO] [stdout] | [INFO] [stdout] 235 | map_calc_gps(&self.map, |tile| match tile { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 236 | | Tile1::Box(_) => true, [INFO] [stdout] 237 | | _ => false, [INFO] [stdout] 238 | | }) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 235 - map_calc_gps(&self.map, |tile| match tile { [INFO] [stdout] 236 - Tile1::Box(_) => true, [INFO] [stdout] 237 - _ => false, [INFO] [stdout] 238 - }) [INFO] [stdout] 235 + map_calc_gps(&self.map, |tile| matches!(tile, Tile1::Box(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/days/day_15.rs:347:21 [INFO] [stdout] | [INFO] [stdout] 347 | / match map.map[next_y as usize][(next_x + 1) as usize] { [INFO] [stdout] 348 | | Tile2::BoxLeft => move_box(map, next_x + 1, next_y, direction), [INFO] [stdout] 349 | | _ => (), [INFO] [stdout] 350 | | } [INFO] [stdout] | |_____________________^ help: try: `if map.map[next_y as usize][(next_x + 1) as usize] == Tile2::BoxLeft { move_box(map, next_x + 1, next_y, direction) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/days/day_15.rs:384:44 [INFO] [stdout] | [INFO] [stdout] 384 | map_calc_gps(&self.map, |tile| match tile { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 385 | | Tile2::BoxLeft => true, [INFO] [stdout] 386 | | _ => false, [INFO] [stdout] 387 | | }) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 384 - map_calc_gps(&self.map, |tile| match tile { [INFO] [stdout] 385 - Tile2::BoxLeft => true, [INFO] [stdout] 386 - _ => false, [INFO] [stdout] 387 - }) [INFO] [stdout] 384 + map_calc_gps(&self.map, |tile| matches!(tile, Tile2::BoxLeft)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/days/day_15.rs:413:5 [INFO] [stdout] | [INFO] [stdout] 413 | while let Some(line) = lines.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in lines` [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: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/days/day_16.rs:58:1 [INFO] [stdout] | [INFO] [stdout] 58 | / impl PartialOrd for Entry { [INFO] [stdout] 59 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 60 | | other.score.partial_cmp(&self.score) [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 60 - other.score.partial_cmp(&self.score) [INFO] [stdout] 61 - } [INFO] [stdout] 59 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_16.rs:95:50 [INFO] [stdout] | [INFO] [stdout] 95 | fn dijkstra(start_x: usize, start_y: usize, map: &Vec>) -> 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] 95 - fn dijkstra(start_x: usize, start_y: usize, map: &Vec>) -> Vec> { [INFO] [stdout] 95 + fn dijkstra(start_x: usize, start_y: usize, map: &[Vec]) -> Vec> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `dir` is used to index `best` [INFO] [stdout] --> src/days/day_16.rs:187:16 [INFO] [stdout] | [INFO] [stdout] 187 | for dir in 0..DIRECTIONS.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 187 - for dir in 0..DIRECTIONS.len() { [INFO] [stdout] 187 + for (dir, ) in best.iter().enumerate().take(DIRECTIONS.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_17.rs:45:41 [INFO] [stdout] | [INFO] [stdout] 45 | fn run(mut register: [i64; 3], program: &Vec) -> 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] 45 - fn run(mut register: [i64; 3], program: &Vec) -> Vec { [INFO] [stdout] 45 + fn run(mut register: [i64; 3], program: &[u8]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_20.rs:57:13 [INFO] [stdout] | [INFO] [stdout] 57 | fn bfs(map: &Vec>, start: Point) -> 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] 57 - fn bfs(map: &Vec>, start: Point) -> Vec> { [INFO] [stdout] 57 + fn bfs(map: &[Vec], start: Point) -> Vec> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/days/day_21.rs:187:37 [INFO] [stdout] | [INFO] [stdout] 187 | LazyLock::new(|| paths_to_codes(&*NUMPAD_PATHS)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `&NUMPAD_PATHS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/days/day_21.rs:189:37 [INFO] [stdout] | [INFO] [stdout] 189 | LazyLock::new(|| paths_to_codes(&*DIRPAD_PATHS)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `&DIRPAD_PATHS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `seq` [INFO] [stdout] --> src/days/day_22.rs:63:22 [INFO] [stdout] | [INFO] [stdout] 63 | for i in 0..3 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 63 - for i in 0..3 { [INFO] [stdout] 63 + for in seq.iter_mut().take(3) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LAN` contains a capitalized acronym [INFO] [stdout] --> src/days/day_23.rs:74:6 [INFO] [stdout] | [INFO] [stdout] 74 | type LAN = Vec; [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Lan` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day_23.rs:157:15 [INFO] [stdout] | [INFO] [stdout] 157 | while remaining.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!remaining.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: name `AND` contains a capitalized acronym [INFO] [stdout] --> src/days/day_24.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | AND, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `And` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `XOR` contains a capitalized acronym [INFO] [stdout] --> src/days/day_24.rs:130:5 [INFO] [stdout] | [INFO] [stdout] 130 | XOR, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Xor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/days/day_24.rs:183:5 [INFO] [stdout] | [INFO] [stdout] 183 | while let Some(line) = lines.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in lines` [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] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/days/day_24.rs:214:29 [INFO] [stdout] | [INFO] [stdout] 214 | let shift = wire[1..].parse::().unwrap(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/days/day_24.rs:213:13 [INFO] [stdout] | [INFO] [stdout] 213 | if wire.starts_with("z") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 213 ~ if let Some() = wire.strip_prefix("z") { [INFO] [stdout] 214 ~ let shift = .parse::().unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/days/day_24.rs:354:22 [INFO] [stdout] | [INFO] [stdout] 354 | Some(wire[1..].parse::().unwrap()) [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/days/day_24.rs:353:13 [INFO] [stdout] | [INFO] [stdout] 353 | if wire.starts_with('z') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 353 ~ if let Some() = wire.strip_prefix('z') { [INFO] [stdout] 354 ~ Some(.parse::().unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:414:34 [INFO] [stdout] | [INFO] [stdout] 414 | bad_gates.insert(input_xor.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*input_xor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:431:34 [INFO] [stdout] | [INFO] [stdout] 431 | bad_gates.insert(carry_gate.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*carry_gate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:438:17 [INFO] [stdout] | [INFO] [stdout] 438 | / gates [INFO] [stdout] 439 | | .iter() [INFO] [stdout] 440 | | .find(|gate| gate.output == wire!(z bit)) [INFO] [stdout] 441 | | .unwrap() [INFO] [stdout] 442 | | .clone(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 438 ~ *gates [INFO] [stdout] 439 + .iter() [INFO] [stdout] 440 + .find(|gate| gate.output == wire!(z bit)) [INFO] [stdout] 441 ~ .unwrap(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:454:34 [INFO] [stdout] | [INFO] [stdout] 454 | bad_gates.insert(carry_and.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*carry_and` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:455:34 [INFO] [stdout] | [INFO] [stdout] 455 | bad_gates.insert(input_and.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*input_and` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:462:30 [INFO] [stdout] | [INFO] [stdout] 462 | bad_gates.insert(carry_gate.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*carry_gate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:463:30 [INFO] [stdout] | [INFO] [stdout] 463 | bad_gates.insert(input_xor.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*input_xor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/days/day_1.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | fn parse(input: &str) -> Map (u32, u32)> { [INFO] [stdout] | ^^^^ ^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 22 | fn parse(input: &str) -> Map, fn(&str) -> (u32, u32)> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/days/day_2.rs:21:17 [INFO] [stdout] | [INFO] [stdout] 21 | fn parse(input: &str) -> Map Vec> { [INFO] [stdout] | ^^^^ ^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 21 | fn parse(input: &str) -> Map, fn(&str) -> Vec> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day_1.rs:22:26 [INFO] [stdout] | [INFO] [stdout] 22 | fn parse(input: &str) -> Map (u32, u32)> { [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: you are using an explicit closure for copying elements [INFO] [stdout] --> src/days/day_1.rs:55:36 [INFO] [stdout] | [INFO] [stdout] 55 | similarity += num as u64 * count.get(&num).map(|&n| n).unwrap_or(0) as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `count.get(&num).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_2.rs:29:18 [INFO] [stdout] | [INFO] [stdout] 29 | fn is_safe(nums: &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] 29 - fn is_safe(nums: &Vec) -> bool { [INFO] [stdout] 29 + fn is_safe(nums: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days/day_4.rs:84:20 [INFO] [stdout] | [INFO] [stdout] 84 | if !(a == b'M' && b == b'S') && !(a == b'S' && b == b'M') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(a == b'M' && b == b'S' || a == b'S' && b == b'M')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days/day_4.rs:92:20 [INFO] [stdout] | [INFO] [stdout] 92 | if !(a == b'M' && b == b'S') && !(a == b'S' && b == b'M') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(a == b'M' && b == b'S' || a == b'S' && b == b'M')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day_5.rs:42:39 [INFO] [stdout] | [INFO] [stdout] 42 | fn parse_rules<'a>(input: &'a str) -> (Vec<(u32, u32)>, Box>>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_5.rs:64:25 [INFO] [stdout] | [INFO] [stdout] 64 | fn check_update(update: &Vec, rules: &Vec<(u32, u32)>) -> 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] 64 - fn check_update(update: &Vec, rules: &Vec<(u32, u32)>) -> bool { [INFO] [stdout] 64 + fn check_update(update: &[u32], rules: &Vec<(u32, u32)>) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day_5.rs:100:40 [INFO] [stdout] | [INFO] [stdout] 100 | .filter(|update| !check_update(&update, &rules)) [INFO] [stdout] | ^^^^^^^ help: change this to: `update` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day_5.rs:113:58 [INFO] [stdout] | [INFO] [stdout] 113 | ... || !all_numbers.contains(&first) [INFO] [stdout] | ^^^^^^ help: change this to: `first` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day_5.rs:114:53 [INFO] [stdout] | [INFO] [stdout] 114 | ... || numbers.contains(&first) [INFO] [stdout] | ^^^^^^ help: change this to: `first` [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_6.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | fn run(map: &mut Vec>, mut x: i32, mut y: i32, mut direction: Direction) -> 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] 76 - fn run(map: &mut Vec>, mut x: i32, mut y: i32, mut direction: Direction) -> bool { [INFO] [stdout] 76 + fn run(map: &mut [Vec], mut x: i32, mut y: i32, mut direction: Direction) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day_7.rs:35:8 [INFO] [stdout] | [INFO] [stdout] 35 | if rest.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `rest.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/days/day_8.rs:27:26 [INFO] [stdout] | [INFO] [stdout] 27 | fn parse(input: &str) -> (Range, Range, HashMap>) { [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 `repeat().take()` can be written more concisely [INFO] [stdout] --> src/days/day_9.rs:107:13 [INFO] [stdout] | [INFO] [stdout] 107 | / repeat(if index % 2 != 0 { [INFO] [stdout] 108 | | Block::Free [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | Block::File(index as u32 / 2) [INFO] [stdout] 111 | | }) [INFO] [stdout] 112 | | .take(len as usize) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] help: consider using `repeat_n()` instead [INFO] [stdout] | [INFO] [stdout] 107 ~ std::iter::repeat_n(if index % 2 != 0 { [INFO] [stdout] 108 + Block::Free [INFO] [stdout] 109 + } else { [INFO] [stdout] 110 + Block::File(index as u32 / 2) [INFO] [stdout] 111 + }, len as usize) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/days/day_11.rs:23:16 [INFO] [stdout] | [INFO] [stdout] 23 | if digits % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `digits.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `dir` is only used to index `DIRECTIONS` [INFO] [stdout] --> src/days/day_12.rs:42:16 [INFO] [stdout] | [INFO] [stdout] 42 | for dir in 0..DIRECTIONS.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 42 - for dir in 0..DIRECTIONS.len() { [INFO] [stdout] 42 + for in &DIRECTIONS { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_12.rs:67:45 [INFO] [stdout] | [INFO] [stdout] 67 | fn base u32>(map: &Vec>, mut f: F) { [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 base u32>(map: &Vec>, mut f: F) { [INFO] [stdout] 67 + fn base u32>(map: &[Vec], mut f: F) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_14.rs:65:24 [INFO] [stdout] | [INFO] [stdout] 65 | fn move_robots(robots: &mut Vec, seconds: 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] 65 - fn move_robots(robots: &mut Vec, seconds: i32) { [INFO] [stdout] 65 + fn move_robots(robots: &mut [Robot], seconds: i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_15.rs:103:14 [INFO] [stdout] | [INFO] [stdout] 103 | map: &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] 103 - map: &Vec>, [INFO] [stdout] 103 + map: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_15.rs:118:48 [INFO] [stdout] | [INFO] [stdout] 118 | fn map_calc_gps bool>(map: &Vec>, matcher: F) -> u32 { [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] 118 - fn map_calc_gps bool>(map: &Vec>, matcher: F) -> u32 { [INFO] [stdout] 118 + fn map_calc_gps bool>(map: &[Vec], matcher: F) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/days/day_15.rs:215:33 [INFO] [stdout] | [INFO] [stdout] 215 | / ... match tile { [INFO] [stdout] 216 | | ... Tile1::Wall | Tile1::Box(true) => true, [INFO] [stdout] 217 | | ... _ => false, [INFO] [stdout] 218 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 215 - match tile { [INFO] [stdout] 216 - Tile1::Wall | Tile1::Box(true) => true, [INFO] [stdout] 217 - _ => false, [INFO] [stdout] 218 - } [INFO] [stdout] 215 + matches!(tile, Tile1::Wall | Tile1::Box(true)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/days/day_15.rs:235:44 [INFO] [stdout] | [INFO] [stdout] 235 | map_calc_gps(&self.map, |tile| match tile { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 236 | | Tile1::Box(_) => true, [INFO] [stdout] 237 | | _ => false, [INFO] [stdout] 238 | | }) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 235 - map_calc_gps(&self.map, |tile| match tile { [INFO] [stdout] 236 - Tile1::Box(_) => true, [INFO] [stdout] 237 - _ => false, [INFO] [stdout] 238 - }) [INFO] [stdout] 235 + map_calc_gps(&self.map, |tile| matches!(tile, Tile1::Box(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/days/day_15.rs:347:21 [INFO] [stdout] | [INFO] [stdout] 347 | / match map.map[next_y as usize][(next_x + 1) as usize] { [INFO] [stdout] 348 | | Tile2::BoxLeft => move_box(map, next_x + 1, next_y, direction), [INFO] [stdout] 349 | | _ => (), [INFO] [stdout] 350 | | } [INFO] [stdout] | |_____________________^ help: try: `if map.map[next_y as usize][(next_x + 1) as usize] == Tile2::BoxLeft { move_box(map, next_x + 1, next_y, direction) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/days/day_15.rs:384:44 [INFO] [stdout] | [INFO] [stdout] 384 | map_calc_gps(&self.map, |tile| match tile { [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 385 | | Tile2::BoxLeft => true, [INFO] [stdout] 386 | | _ => false, [INFO] [stdout] 387 | | }) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 384 - map_calc_gps(&self.map, |tile| match tile { [INFO] [stdout] 385 - Tile2::BoxLeft => true, [INFO] [stdout] 386 - _ => false, [INFO] [stdout] 387 - }) [INFO] [stdout] 384 + map_calc_gps(&self.map, |tile| matches!(tile, Tile2::BoxLeft)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/days/day_15.rs:413:5 [INFO] [stdout] | [INFO] [stdout] 413 | while let Some(line) = lines.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in lines` [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: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/days/day_16.rs:58:1 [INFO] [stdout] | [INFO] [stdout] 58 | / impl PartialOrd for Entry { [INFO] [stdout] 59 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 60 | | other.score.partial_cmp(&self.score) [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 60 - other.score.partial_cmp(&self.score) [INFO] [stdout] 61 - } [INFO] [stdout] 59 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_16.rs:95:50 [INFO] [stdout] | [INFO] [stdout] 95 | fn dijkstra(start_x: usize, start_y: usize, map: &Vec>) -> 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] 95 - fn dijkstra(start_x: usize, start_y: usize, map: &Vec>) -> Vec> { [INFO] [stdout] 95 + fn dijkstra(start_x: usize, start_y: usize, map: &[Vec]) -> Vec> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `dir` is used to index `best` [INFO] [stdout] --> src/days/day_16.rs:187:16 [INFO] [stdout] | [INFO] [stdout] 187 | for dir in 0..DIRECTIONS.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 187 - for dir in 0..DIRECTIONS.len() { [INFO] [stdout] 187 + for (dir, ) in best.iter().enumerate().take(DIRECTIONS.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_17.rs:45:41 [INFO] [stdout] | [INFO] [stdout] 45 | fn run(mut register: [i64; 3], program: &Vec) -> 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] 45 - fn run(mut register: [i64; 3], program: &Vec) -> Vec { [INFO] [stdout] 45 + fn run(mut register: [i64; 3], program: &[u8]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day_20.rs:57:13 [INFO] [stdout] | [INFO] [stdout] 57 | fn bfs(map: &Vec>, start: Point) -> 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] 57 - fn bfs(map: &Vec>, start: Point) -> Vec> { [INFO] [stdout] 57 + fn bfs(map: &[Vec], start: Point) -> Vec> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/days/day_21.rs:187:37 [INFO] [stdout] | [INFO] [stdout] 187 | LazyLock::new(|| paths_to_codes(&*NUMPAD_PATHS)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `&NUMPAD_PATHS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/days/day_21.rs:189:37 [INFO] [stdout] | [INFO] [stdout] 189 | LazyLock::new(|| paths_to_codes(&*DIRPAD_PATHS)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `&DIRPAD_PATHS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `seq` [INFO] [stdout] --> src/days/day_22.rs:63:22 [INFO] [stdout] | [INFO] [stdout] 63 | for i in 0..3 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 63 - for i in 0..3 { [INFO] [stdout] 63 + for in seq.iter_mut().take(3) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LAN` contains a capitalized acronym [INFO] [stdout] --> src/days/day_23.rs:74:6 [INFO] [stdout] | [INFO] [stdout] 74 | type LAN = Vec; [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Lan` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days/day_23.rs:157:15 [INFO] [stdout] | [INFO] [stdout] 157 | while remaining.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!remaining.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: name `AND` contains a capitalized acronym [INFO] [stdout] --> src/days/day_24.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | AND, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `And` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `XOR` contains a capitalized acronym [INFO] [stdout] --> src/days/day_24.rs:130:5 [INFO] [stdout] | [INFO] [stdout] 130 | XOR, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Xor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/days/day_24.rs:183:5 [INFO] [stdout] | [INFO] [stdout] 183 | while let Some(line) = lines.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in lines` [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] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/days/day_24.rs:214:29 [INFO] [stdout] | [INFO] [stdout] 214 | let shift = wire[1..].parse::().unwrap(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/days/day_24.rs:213:13 [INFO] [stdout] | [INFO] [stdout] 213 | if wire.starts_with("z") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 213 ~ if let Some() = wire.strip_prefix("z") { [INFO] [stdout] 214 ~ let shift = .parse::().unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/days/day_24.rs:354:22 [INFO] [stdout] | [INFO] [stdout] 354 | Some(wire[1..].parse::().unwrap()) [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/days/day_24.rs:353:13 [INFO] [stdout] | [INFO] [stdout] 353 | if wire.starts_with('z') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 353 ~ if let Some() = wire.strip_prefix('z') { [INFO] [stdout] 354 ~ Some(.parse::().unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:414:34 [INFO] [stdout] | [INFO] [stdout] 414 | bad_gates.insert(input_xor.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*input_xor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:431:34 [INFO] [stdout] | [INFO] [stdout] 431 | bad_gates.insert(carry_gate.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*carry_gate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:438:17 [INFO] [stdout] | [INFO] [stdout] 438 | / gates [INFO] [stdout] 439 | | .iter() [INFO] [stdout] 440 | | .find(|gate| gate.output == wire!(z bit)) [INFO] [stdout] 441 | | .unwrap() [INFO] [stdout] 442 | | .clone(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 438 ~ *gates [INFO] [stdout] 439 + .iter() [INFO] [stdout] 440 + .find(|gate| gate.output == wire!(z bit)) [INFO] [stdout] 441 ~ .unwrap(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:454:34 [INFO] [stdout] | [INFO] [stdout] 454 | bad_gates.insert(carry_and.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*carry_and` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:455:34 [INFO] [stdout] | [INFO] [stdout] 455 | bad_gates.insert(input_and.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*input_and` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:462:30 [INFO] [stdout] | [INFO] [stdout] 462 | bad_gates.insert(carry_gate.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*carry_gate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Gate<'_>` which implements the `Copy` trait [INFO] [stdout] --> src/days/day_24.rs:463:30 [INFO] [stdout] | [INFO] [stdout] 463 | bad_gates.insert(input_xor.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*input_xor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/days/day_1.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | fn parse(input: &str) -> Map (u32, u32)> { [INFO] [stdout] | ^^^^ ^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 22 | fn parse(input: &str) -> Map, fn(&str) -> (u32, u32)> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/days/day_2.rs:21:17 [INFO] [stdout] | [INFO] [stdout] 21 | fn parse(input: &str) -> Map Vec> { [INFO] [stdout] | ^^^^ ^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 21 | fn parse(input: &str) -> Map, fn(&str) -> Vec> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.68s [INFO] running `Command { std: "docker" "inspect" "0679b3e0a4ffa4756204e71e8ab24d1a417cde0274dfca691e78ff79e82a45d6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0679b3e0a4ffa4756204e71e8ab24d1a417cde0274dfca691e78ff79e82a45d6", kill_on_drop: false }` [INFO] [stdout] 0679b3e0a4ffa4756204e71e8ab24d1a417cde0274dfca691e78ff79e82a45d6