[INFO] cloning repository https://github.com/josband/advent-of-code [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/josband/advent-of-code" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjosband%2Fadvent-of-code", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjosband%2Fadvent-of-code'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 46ebc513007a90014dd601e5b9d1407fe17b52e5 [INFO] linting josband/advent-of-code against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjosband%2Fadvent-of-code" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/josband/advent-of-code [INFO] finished tweaking git repo https://github.com/josband/advent-of-code [INFO] tweaked toml for git repo https://github.com/josband/advent-of-code written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/josband/advent-of-code 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/josband/advent-of-code 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 unicode-ident v1.0.14 [INFO] [stderr] Downloaded color-print-proc-macro v0.3.7 [INFO] [stderr] Downloaded color-print v0.3.7 [INFO] [stderr] Downloaded proc-macro2 v1.0.92 [INFO] [stderr] Downloaded syn v2.0.90 [INFO] [stderr] Downloaded regex v1.11.1 [INFO] [stderr] Downloaded regex-automata v0.4.9 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] a8a7db3b115590d3f12fa2b9aca1f268dc98908229e245c4b6328cf67d0eee12 [INFO] running `Command { std: "docker" "start" "-a" "a8a7db3b115590d3f12fa2b9aca1f268dc98908229e245c4b6328cf67d0eee12", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "a8a7db3b115590d3f12fa2b9aca1f268dc98908229e245c4b6328cf67d0eee12", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a8a7db3b115590d3f12fa2b9aca1f268dc98908229e245c4b6328cf67d0eee12", kill_on_drop: false }` [INFO] [stdout] a8a7db3b115590d3f12fa2b9aca1f268dc98908229e245c4b6328cf67d0eee12 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 705c3197f23794d5e649db2edc77f0a75c6d64d05e2ecfd19ad227337cf926c8 [INFO] running `Command { std: "docker" "start" "-a" "705c3197f23794d5e649db2edc77f0a75c6d64d05e2ecfd19ad227337cf926c8", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.92 [INFO] [stderr] Compiling unicode-ident v1.0.14 [INFO] [stderr] Compiling memchr v2.7.4 [INFO] [stderr] Compiling minimal-lexical v0.2.1 [INFO] [stderr] Checking regex-syntax v0.8.5 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Checking itertools v0.14.0 [INFO] [stderr] Compiling nom v7.1.3 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Compiling quote v1.0.37 [INFO] [stderr] Compiling syn v2.0.90 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Compiling color-print-proc-macro v0.3.7 [INFO] [stderr] Checking color-print v0.3.7 [INFO] [stderr] Checking advent-of-code v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/year2024/day09.rs:110:12 [INFO] [stdout] | [INFO] [stdout] 110 | if swap_end - swap_start + 1 >= right - left + 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `swap_end - swap_start + 1 > right - left` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/year2024/day09.rs:110:12 [INFO] [stdout] | [INFO] [stdout] 110 | if swap_end - swap_start + 1 >= right - left + 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `swap_end - swap_start + 1 > right - left` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/year2024/day02.rs:33:18 [INFO] [stdout] | [INFO] [stdout] 33 | 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] 33 - fn is_safe(nums: &Vec) -> bool { [INFO] [stdout] 33 + fn is_safe(nums: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/year2024/day03.rs:13:10 [INFO] [stdout] | [INFO] [stdout] 13 | .map(|line| { [INFO] [stdout] | __________^ [INFO] [stdout] 14 | | let re = Regex::new(r"mul\(([0-9]{1,3}),([0-9]{1,3})\)").unwrap(); [INFO] [stdout] 15 | | re.captures_iter(line).map(|capture| { [INFO] [stdout] 16 | | (capture[1].parse().unwrap(), capture[2].parse().unwrap()) [INFO] [stdout] 17 | | }).collect::>() [INFO] [stdout] 18 | | }).flatten().collect() [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] 13 ~ .flat_map(|line| { [INFO] [stdout] 14 + let re = Regex::new(r"mul\(([0-9]{1,3}),([0-9]{1,3})\)").unwrap(); [INFO] [stdout] 15 + re.captures_iter(line).map(|capture| { [INFO] [stdout] 16 + (capture[1].parse().unwrap(), capture[2].parse().unwrap()) [INFO] [stdout] 17 + }).collect::>() [INFO] [stdout] 18 ~ }).collect() [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/year2024/day04.rs:26:26 [INFO] [stdout] | [INFO] [stdout] 26 | fn match_xmas(crossword: &Vec>, r: i32, c: 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] 26 - fn match_xmas(crossword: &Vec>, r: i32, c: i32) -> i32 { [INFO] [stdout] 26 + fn match_xmas(crossword: &[Vec], r: i32, c: i32) -> 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/year2024/day04.rs:59:25 [INFO] [stdout] | [INFO] [stdout] 59 | fn match_mas(crossword: &Vec>, r: usize, c: usize) -> 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] 59 - fn match_mas(crossword: &Vec>, r: usize, c: usize) -> i32 { [INFO] [stdout] 59 + fn match_mas(crossword: &[Vec], r: usize, c: usize) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/year2024/day05.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | / if !ordering_map.contains_key(&key) { [INFO] [stdout] 22 | | ordering_map.insert(key, Vec::new()); [INFO] [stdout] 23 | | } [INFO] [stdout] | |_________^ help: try: `ordering_map.entry(key).or_insert_with(|| Vec::new());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` 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/year2024/day05.rs:65:42 [INFO] [stdout] | [INFO] [stdout] 65 | let pages = ordering_map.get(&page_num); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `page_num` [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 boolean expression can be simplified [INFO] [stdout] --> src/year2024/day06.rs:98:16 [INFO] [stdout] | [INFO] [stdout] 98 | if !(next_row == start_row && next_col == start_col) && !seen[next_row][next_col] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(seen[next_row][next_col] || next_row == start_row && next_col == start_col)` [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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/year2024/day06.rs:105:27 [INFO] [stdout] | [INFO] [stdout] 105 | (row, col) = (next_row as usize, next_col as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `next_row` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/year2024/day06.rs:105:46 [INFO] [stdout] | [INFO] [stdout] 105 | (row, col) = (next_row as usize, next_col as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `next_col` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2024/day06.rs:115:71 [INFO] [stdout] | [INFO] [stdout] 115 | while is_location_in_bounds((row as i32, col as i32) + direction, &board) { [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/year2024/day08.rs:39:73 [INFO] [stdout] | [INFO] [stdout] 39 | for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 39 - for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] 39 + for location_two in (&sensor_locations[row+1..]).iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/year2024/day08.rs:39:38 [INFO] [stdout] | [INFO] [stdout] 39 | for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `sensor_locations[row+1..]` [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: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/year2024/day08.rs:78:77 [INFO] [stdout] | [INFO] [stdout] 78 | for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 78 - for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] 78 + for location_two in (&sensor_locations[row+1..]).iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/year2024/day08.rs:78:42 [INFO] [stdout] | [INFO] [stdout] 78 | for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `sensor_locations[row+1..]` [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 `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/year2024/day09.rs:25:27 [INFO] [stdout] | [INFO] [stdout] 25 | fn compute_checksum(disk: &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] 25 - fn compute_checksum(disk: &Vec) -> u64 { [INFO] [stdout] 25 + fn compute_checksum(disk: &[i32]) -> u64 { [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/year2024/day09.rs:38:33 [INFO] [stdout] | [INFO] [stdout] 38 | fn compact_disc(expanded_input: &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] 38 - fn compact_disc(expanded_input: &mut Vec) { [INFO] [stdout] 38 + fn compact_disc(expanded_input: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.filter_map(..)` can be written more simply using `.map(..)` [INFO] [stdout] --> src/year2024/day09.rs:60:30 [INFO] [stdout] | [INFO] [stdout] 60 | input.iter().enumerate().filter_map(|(index, size)| { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 61 | | let output_num = if index % 2 == 0 { [INFO] [stdout] 62 | | let res = file_id; [INFO] [stdout] 63 | | file_id += 1; [INFO] [stdout] ... | [INFO] [stdout] 68 | | Some(vec![output_num; *size as usize]) [INFO] [stdout] 69 | | }).flatten().collect() [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map [INFO] [stdout] = note: `#[warn(clippy::unnecessary_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `compute_checksum` doesn't need a mutable reference [INFO] [stdout] --> src/year2024/day09.rs:90:35 [INFO] [stdout] | [INFO] [stdout] 90 | let result = compute_checksum(&mut expanded_layout); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 90 - let result = compute_checksum(&mut expanded_layout); [INFO] [stdout] 90 + let result = compute_checksum(&expanded_layout); [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/year2024/day09.rs:94:26 [INFO] [stdout] | [INFO] [stdout] 94 | fn shift_file_left(disk: &mut Vec, left: usize, right: 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] 94 - fn shift_file_left(disk: &mut Vec, left: usize, right: usize) { [INFO] [stdout] 94 + fn shift_file_left(disk: &mut [i32], left: usize, right: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `pos` is used as a loop counter [INFO] [stdout] --> src/year2024/day09.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | for i in left..right + 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (pos, i) in (swap_start..).zip((left..right + 1))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/year2024/day11.rs:31:15 [INFO] [stdout] | [INFO] [stdout] 31 | } else if num_digits(stone_value) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `num_digits(stone_value).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: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/year2024/day11.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / if !mem.contains_key(&blinks_left) { [INFO] [stdout] 60 | | mem.insert(blinks_left, HashMap::new()); [INFO] [stdout] 61 | | } [INFO] [stdout] | |_____^ help: try: `mem.entry(blinks_left).or_insert_with(|| HashMap::new());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/year2024/day11.rs:69:15 [INFO] [stdout] | [INFO] [stdout] 69 | } else if num_digits(stone_value) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `num_digits(stone_value).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/year2024/day12.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | perimeter = perimeter + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `perimeter += 1` [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: redundant closure [INFO] [stdout] --> src/year2024/day13.rs:39:90 [INFO] [stdout] | [INFO] [stdout] 39 | let result: isize = input.iter().filter_map(|machine| compute_solution(machine)).map(|result| compute_cost(result)).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2024/day13.rs:39:49 [INFO] [stdout] | [INFO] [stdout] 39 | let result: isize = input.iter().filter_map(|machine| compute_solution(machine)).map(|result| compute_cost(result)).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_solution` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2024/day13.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | }).map(|result| compute_cost(result)).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Machine` which implements the `Copy` trait [INFO] [stdout] --> src/year2024/day13.rs:60:36 [INFO] [stdout] | [INFO] [stdout] 60 | let mut modified_machine = machine.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*machine` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2024/day15.rs:42:42 [INFO] [stdout] | [INFO] [stdout] 42 | Self::swap_positions(&self, &Position { row: next_position.row, col: next_position.col }, map); [INFO] [stdout] | ^^^^^ help: change this to: `self` [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/year2024/day15.rs:128:68 [INFO] [stdout] | [INFO] [stdout] 128 | fn swap_positions(pos_one: &Position, pos_two: &Position, map: &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] 128 - fn swap_positions(pos_one: &Position, pos_two: &Position, map: &mut Vec>) { [INFO] [stdout] 128 + fn swap_positions(pos_one: &Position, pos_two: &Position, map: &mut [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/year2024/day15.rs:166:33 [INFO] [stdout] | [INFO] [stdout] 166 | fn is_in_bounds(&self, map: &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] 166 - fn is_in_bounds(&self, map: &Vec>) -> bool { [INFO] [stdout] 166 + fn is_in_bounds(&self, map: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `map` [INFO] [stdout] --> src/year2024/day15.rs:236:16 [INFO] [stdout] | [INFO] [stdout] 236 | for row in 1..(map.len() - 1) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 236 - for row in 1..(map.len() - 1) { [INFO] [stdout] 236 + for (row, ) in map.iter().enumerate().take((map.len() - 1)).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `map` [INFO] [stdout] --> src/year2024/day15.rs:237:20 [INFO] [stdout] | [INFO] [stdout] 237 | for col in 1..(map[row].len() - 1) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 237 - for col in 1..(map[row].len() - 1) { [INFO] [stdout] 237 + for (col, ) in map.iter().enumerate().take((map[row].len() - 1)).skip(1) { [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/year2024/day15.rs:247:30 [INFO] [stdout] | [INFO] [stdout] 247 | fn get_start_position(input: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 247 - fn get_start_position(input: &Vec>) -> Option { [INFO] [stdout] 247 + fn get_start_position(input: &[Vec]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/year2024/day15.rs:248:16 [INFO] [stdout] | [INFO] [stdout] 248 | for row in 0..input.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] 248 - for row in 0..input.len() { [INFO] [stdout] 248 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/year2024/day15.rs:249:20 [INFO] [stdout] | [INFO] [stdout] 249 | for col in 0..input[row].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] 249 - for col in 0..input[row].len() { [INFO] [stdout] 249 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `converted_map` [INFO] [stdout] --> src/year2024/day15.rs:272:16 [INFO] [stdout] | [INFO] [stdout] 272 | for row in 1..(converted_map.len() - 1) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 272 - for row in 1..(converted_map.len() - 1) { [INFO] [stdout] 272 + for (row, ) in converted_map.iter().enumerate().take((converted_map.len() - 1)).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `converted_map` [INFO] [stdout] --> src/year2024/day15.rs:273:20 [INFO] [stdout] | [INFO] [stdout] 273 | for col in 2..(converted_map[row].len() - 2) { [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] 273 - for col in 2..(converted_map[row].len() - 2) { [INFO] [stdout] 273 + for (col, ) in converted_map.iter().enumerate().take((converted_map[row].len() - 2)).skip(2) { [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/year2024/day15.rs:283:21 [INFO] [stdout] | [INFO] [stdout] 283 | fn convert_map(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] 283 - fn convert_map(map: &Vec>) -> Vec> { [INFO] [stdout] 283 + fn convert_map(map: &[Vec]) -> Vec> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is only used to index `map` [INFO] [stdout] --> src/year2024/day15.rs:285:16 [INFO] [stdout] | [INFO] [stdout] 285 | for row in 0..map.len() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 285 - for row in 0..map.len() { [INFO] [stdout] 285 + for in &map { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is only used to index `map` [INFO] [stdout] --> src/year2024/day15.rs:287:20 [INFO] [stdout] | [INFO] [stdout] 287 | for col in 0..map[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 287 - for col in 0..map[row].len() { [INFO] [stdout] 287 + for in map.iter().take(map[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/year2024/day16.rs:1:77 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::{BinaryHeap, HashSet}, fs::read_to_string, ops::Add, usize}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/year2024/day16.rs:114:16 [INFO] [stdout] | [INFO] [stdout] 114 | for row in 0..input.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] 114 - for row in 0..input.len() { [INFO] [stdout] 114 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/year2024/day16.rs:115:20 [INFO] [stdout] | [INFO] [stdout] 115 | for col in 0..input[row].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] 115 - for col in 0..input[row].len() { [INFO] [stdout] 115 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/year2024/day16.rs:126:16 [INFO] [stdout] | [INFO] [stdout] 126 | for row in 0..input.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] 126 - for row in 0..input.len() { [INFO] [stdout] 126 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/year2024/day16.rs:127:20 [INFO] [stdout] | [INFO] [stdout] 127 | for col in 0..input[row].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] 127 - for col in 0..input[row].len() { [INFO] [stdout] 127 + for (col, ) in input.iter().enumerate().take(input[row].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/year2024/day16.rs:137:19 [INFO] [stdout] | [INFO] [stdout] 137 | fn djikstras(map: &Vec>, start: Position, end: Position, init_direction: Direction) -> (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] 137 - fn djikstras(map: &Vec>, start: Position, end: Position, init_direction: Direction) -> (Vec>, Vec>) { [INFO] [stdout] 137 + fn djikstras(map: &[Vec], start: Position, end: Position, init_direction: Direction) -> (Vec>, Vec>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `grid` [INFO] [stdout] --> src/year2025/day09.rs:108:26 [INFO] [stdout] | [INFO] [stdout] 108 | for j in min(prev.x, point.x) + 1..max(point.x, prev.x) { [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] 108 - for j in min(prev.x, point.x) + 1..max(point.x, prev.x) { [INFO] [stdout] 108 + for in grid.iter_mut().take(max(point.x, prev.x)).skip(min(prev.x, point.x) + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/year2025/day09.rs:152:14 [INFO] [stdout] | [INFO] [stdout] 152 | for x in min(point.x, corner.x)..=max(point.x, corner.x) { [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] 152 - for x in min(point.x, corner.x)..=max(point.x, corner.x) { [INFO] [stdout] 152 + for in grid.iter().take(max(point.x, corner.x) + 1).skip(min(point.x, corner.x)) { [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/year2024/day02.rs:33:18 [INFO] [stdout] | [INFO] [stdout] 33 | 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] 33 - fn is_safe(nums: &Vec) -> bool { [INFO] [stdout] 33 + fn is_safe(nums: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/year2024/day03.rs:13:10 [INFO] [stdout] | [INFO] [stdout] 13 | .map(|line| { [INFO] [stdout] | __________^ [INFO] [stdout] 14 | | let re = Regex::new(r"mul\(([0-9]{1,3}),([0-9]{1,3})\)").unwrap(); [INFO] [stdout] 15 | | re.captures_iter(line).map(|capture| { [INFO] [stdout] 16 | | (capture[1].parse().unwrap(), capture[2].parse().unwrap()) [INFO] [stdout] 17 | | }).collect::>() [INFO] [stdout] 18 | | }).flatten().collect() [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] 13 ~ .flat_map(|line| { [INFO] [stdout] 14 + let re = Regex::new(r"mul\(([0-9]{1,3}),([0-9]{1,3})\)").unwrap(); [INFO] [stdout] 15 + re.captures_iter(line).map(|capture| { [INFO] [stdout] 16 + (capture[1].parse().unwrap(), capture[2].parse().unwrap()) [INFO] [stdout] 17 + }).collect::>() [INFO] [stdout] 18 ~ }).collect() [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/year2024/day04.rs:26:26 [INFO] [stdout] | [INFO] [stdout] 26 | fn match_xmas(crossword: &Vec>, r: i32, c: 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] 26 - fn match_xmas(crossword: &Vec>, r: i32, c: i32) -> i32 { [INFO] [stdout] 26 + fn match_xmas(crossword: &[Vec], r: i32, c: i32) -> 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/year2024/day04.rs:59:25 [INFO] [stdout] | [INFO] [stdout] 59 | fn match_mas(crossword: &Vec>, r: usize, c: usize) -> 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] 59 - fn match_mas(crossword: &Vec>, r: usize, c: usize) -> i32 { [INFO] [stdout] 59 + fn match_mas(crossword: &[Vec], r: usize, c: usize) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/year2024/day05.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | / if !ordering_map.contains_key(&key) { [INFO] [stdout] 22 | | ordering_map.insert(key, Vec::new()); [INFO] [stdout] 23 | | } [INFO] [stdout] | |_________^ help: try: `ordering_map.entry(key).or_insert_with(|| Vec::new());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` 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/year2024/day05.rs:65:42 [INFO] [stdout] | [INFO] [stdout] 65 | let pages = ordering_map.get(&page_num); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `page_num` [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 boolean expression can be simplified [INFO] [stdout] --> src/year2024/day06.rs:98:16 [INFO] [stdout] | [INFO] [stdout] 98 | if !(next_row == start_row && next_col == start_col) && !seen[next_row][next_col] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(seen[next_row][next_col] || next_row == start_row && next_col == start_col)` [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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/year2024/day06.rs:105:27 [INFO] [stdout] | [INFO] [stdout] 105 | (row, col) = (next_row as usize, next_col as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `next_row` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/year2024/day06.rs:105:46 [INFO] [stdout] | [INFO] [stdout] 105 | (row, col) = (next_row as usize, next_col as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `next_col` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2024/day06.rs:115:71 [INFO] [stdout] | [INFO] [stdout] 115 | while is_location_in_bounds((row as i32, col as i32) + direction, &board) { [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/year2024/day08.rs:39:73 [INFO] [stdout] | [INFO] [stdout] 39 | for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 39 - for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] 39 + for location_two in (&sensor_locations[row+1..]).iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/year2024/day08.rs:39:38 [INFO] [stdout] | [INFO] [stdout] 39 | for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `sensor_locations[row+1..]` [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: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/year2024/day08.rs:78:77 [INFO] [stdout] | [INFO] [stdout] 78 | for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 78 - for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] 78 + for location_two in (&sensor_locations[row+1..]).iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/year2024/day08.rs:78:42 [INFO] [stdout] | [INFO] [stdout] 78 | for (_, location_two) in (&sensor_locations[row+1..]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `sensor_locations[row+1..]` [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 `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/year2024/day09.rs:25:27 [INFO] [stdout] | [INFO] [stdout] 25 | fn compute_checksum(disk: &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] 25 - fn compute_checksum(disk: &Vec) -> u64 { [INFO] [stdout] 25 + fn compute_checksum(disk: &[i32]) -> u64 { [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/year2024/day09.rs:38:33 [INFO] [stdout] | [INFO] [stdout] 38 | fn compact_disc(expanded_input: &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] 38 - fn compact_disc(expanded_input: &mut Vec) { [INFO] [stdout] 38 + fn compact_disc(expanded_input: &mut [i32]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.filter_map(..)` can be written more simply using `.map(..)` [INFO] [stdout] --> src/year2024/day09.rs:60:30 [INFO] [stdout] | [INFO] [stdout] 60 | input.iter().enumerate().filter_map(|(index, size)| { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 61 | | let output_num = if index % 2 == 0 { [INFO] [stdout] 62 | | let res = file_id; [INFO] [stdout] 63 | | file_id += 1; [INFO] [stdout] ... | [INFO] [stdout] 68 | | Some(vec![output_num; *size as usize]) [INFO] [stdout] 69 | | }).flatten().collect() [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map [INFO] [stdout] = note: `#[warn(clippy::unnecessary_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `compute_checksum` doesn't need a mutable reference [INFO] [stdout] --> src/year2024/day09.rs:90:35 [INFO] [stdout] | [INFO] [stdout] 90 | let result = compute_checksum(&mut expanded_layout); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 90 - let result = compute_checksum(&mut expanded_layout); [INFO] [stdout] 90 + let result = compute_checksum(&expanded_layout); [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/year2024/day09.rs:94:26 [INFO] [stdout] | [INFO] [stdout] 94 | fn shift_file_left(disk: &mut Vec, left: usize, right: 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] 94 - fn shift_file_left(disk: &mut Vec, left: usize, right: usize) { [INFO] [stdout] 94 + fn shift_file_left(disk: &mut [i32], left: usize, right: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `pos` is used as a loop counter [INFO] [stdout] --> src/year2024/day09.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | for i in left..right + 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (pos, i) in (swap_start..).zip((left..right + 1))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/year2024/day11.rs:31:15 [INFO] [stdout] | [INFO] [stdout] 31 | } else if num_digits(stone_value) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `num_digits(stone_value).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: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/year2024/day11.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / if !mem.contains_key(&blinks_left) { [INFO] [stdout] 60 | | mem.insert(blinks_left, HashMap::new()); [INFO] [stdout] 61 | | } [INFO] [stdout] | |_____^ help: try: `mem.entry(blinks_left).or_insert_with(|| HashMap::new());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/year2024/day11.rs:69:15 [INFO] [stdout] | [INFO] [stdout] 69 | } else if num_digits(stone_value) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `num_digits(stone_value).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/year2024/day12.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | perimeter = perimeter + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `perimeter += 1` [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: redundant closure [INFO] [stdout] --> src/year2024/day13.rs:39:90 [INFO] [stdout] | [INFO] [stdout] 39 | let result: isize = input.iter().filter_map(|machine| compute_solution(machine)).map(|result| compute_cost(result)).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2024/day13.rs:39:49 [INFO] [stdout] | [INFO] [stdout] 39 | let result: isize = input.iter().filter_map(|machine| compute_solution(machine)).map(|result| compute_cost(result)).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_solution` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2024/day13.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | }).map(|result| compute_cost(result)).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Machine` which implements the `Copy` trait [INFO] [stdout] --> src/year2024/day13.rs:60:36 [INFO] [stdout] | [INFO] [stdout] 60 | let mut modified_machine = machine.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*machine` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2024/day15.rs:42:42 [INFO] [stdout] | [INFO] [stdout] 42 | Self::swap_positions(&self, &Position { row: next_position.row, col: next_position.col }, map); [INFO] [stdout] | ^^^^^ help: change this to: `self` [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/year2024/day15.rs:128:68 [INFO] [stdout] | [INFO] [stdout] 128 | fn swap_positions(pos_one: &Position, pos_two: &Position, map: &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] 128 - fn swap_positions(pos_one: &Position, pos_two: &Position, map: &mut Vec>) { [INFO] [stdout] 128 + fn swap_positions(pos_one: &Position, pos_two: &Position, map: &mut [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/year2024/day15.rs:166:33 [INFO] [stdout] | [INFO] [stdout] 166 | fn is_in_bounds(&self, map: &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] 166 - fn is_in_bounds(&self, map: &Vec>) -> bool { [INFO] [stdout] 166 + fn is_in_bounds(&self, map: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `map` [INFO] [stdout] --> src/year2024/day15.rs:236:16 [INFO] [stdout] | [INFO] [stdout] 236 | for row in 1..(map.len() - 1) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 236 - for row in 1..(map.len() - 1) { [INFO] [stdout] 236 + for (row, ) in map.iter().enumerate().take((map.len() - 1)).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `map` [INFO] [stdout] --> src/year2024/day15.rs:237:20 [INFO] [stdout] | [INFO] [stdout] 237 | for col in 1..(map[row].len() - 1) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 237 - for col in 1..(map[row].len() - 1) { [INFO] [stdout] 237 + for (col, ) in map.iter().enumerate().take((map[row].len() - 1)).skip(1) { [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/year2024/day15.rs:247:30 [INFO] [stdout] | [INFO] [stdout] 247 | fn get_start_position(input: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 247 - fn get_start_position(input: &Vec>) -> Option { [INFO] [stdout] 247 + fn get_start_position(input: &[Vec]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/year2024/day15.rs:248:16 [INFO] [stdout] | [INFO] [stdout] 248 | for row in 0..input.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] 248 - for row in 0..input.len() { [INFO] [stdout] 248 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/year2024/day15.rs:249:20 [INFO] [stdout] | [INFO] [stdout] 249 | for col in 0..input[row].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] 249 - for col in 0..input[row].len() { [INFO] [stdout] 249 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `converted_map` [INFO] [stdout] --> src/year2024/day15.rs:272:16 [INFO] [stdout] | [INFO] [stdout] 272 | for row in 1..(converted_map.len() - 1) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 272 - for row in 1..(converted_map.len() - 1) { [INFO] [stdout] 272 + for (row, ) in converted_map.iter().enumerate().take((converted_map.len() - 1)).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `converted_map` [INFO] [stdout] --> src/year2024/day15.rs:273:20 [INFO] [stdout] | [INFO] [stdout] 273 | for col in 2..(converted_map[row].len() - 2) { [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] 273 - for col in 2..(converted_map[row].len() - 2) { [INFO] [stdout] 273 + for (col, ) in converted_map.iter().enumerate().take((converted_map[row].len() - 2)).skip(2) { [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/year2024/day15.rs:283:21 [INFO] [stdout] | [INFO] [stdout] 283 | fn convert_map(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] 283 - fn convert_map(map: &Vec>) -> Vec> { [INFO] [stdout] 283 + fn convert_map(map: &[Vec]) -> Vec> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is only used to index `map` [INFO] [stdout] --> src/year2024/day15.rs:285:16 [INFO] [stdout] | [INFO] [stdout] 285 | for row in 0..map.len() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 285 - for row in 0..map.len() { [INFO] [stdout] 285 + for in &map { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is only used to index `map` [INFO] [stdout] --> src/year2024/day15.rs:287:20 [INFO] [stdout] | [INFO] [stdout] 287 | for col in 0..map[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 287 - for col in 0..map[row].len() { [INFO] [stdout] 287 + for in map.iter().take(map[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/year2024/day16.rs:1:77 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::{BinaryHeap, HashSet}, fs::read_to_string, ops::Add, usize}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/year2024/day16.rs:114:16 [INFO] [stdout] | [INFO] [stdout] 114 | for row in 0..input.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] 114 - for row in 0..input.len() { [INFO] [stdout] 114 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/year2024/day16.rs:115:20 [INFO] [stdout] | [INFO] [stdout] 115 | for col in 0..input[row].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] 115 - for col in 0..input[row].len() { [INFO] [stdout] 115 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/year2024/day16.rs:126:16 [INFO] [stdout] | [INFO] [stdout] 126 | for row in 0..input.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] 126 - for row in 0..input.len() { [INFO] [stdout] 126 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/year2024/day16.rs:127:20 [INFO] [stdout] | [INFO] [stdout] 127 | for col in 0..input[row].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] 127 - for col in 0..input[row].len() { [INFO] [stdout] 127 + for (col, ) in input.iter().enumerate().take(input[row].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/year2024/day16.rs:137:19 [INFO] [stdout] | [INFO] [stdout] 137 | fn djikstras(map: &Vec>, start: Position, end: Position, init_direction: Direction) -> (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] 137 - fn djikstras(map: &Vec>, start: Position, end: Position, init_direction: Direction) -> (Vec>, Vec>) { [INFO] [stdout] 137 + fn djikstras(map: &[Vec], start: Position, end: Position, init_direction: Direction) -> (Vec>, Vec>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `grid` [INFO] [stdout] --> src/year2025/day09.rs:108:26 [INFO] [stdout] | [INFO] [stdout] 108 | for j in min(prev.x, point.x) + 1..max(point.x, prev.x) { [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] 108 - for j in min(prev.x, point.x) + 1..max(point.x, prev.x) { [INFO] [stdout] 108 + for in grid.iter_mut().take(max(point.x, prev.x)).skip(min(prev.x, point.x) + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/year2025/day09.rs:152:14 [INFO] [stdout] | [INFO] [stdout] 152 | for x in min(point.x, corner.x)..=max(point.x, corner.x) { [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] 152 - for x in min(point.x, corner.x)..=max(point.x, corner.x) { [INFO] [stdout] 152 + for in grid.iter().take(max(point.x, corner.x) + 1).skip(min(point.x, corner.x)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 10.35s [INFO] running `Command { std: "docker" "inspect" "705c3197f23794d5e649db2edc77f0a75c6d64d05e2ecfd19ad227337cf926c8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "705c3197f23794d5e649db2edc77f0a75c6d64d05e2ecfd19ad227337cf926c8", kill_on_drop: false }` [INFO] [stdout] 705c3197f23794d5e649db2edc77f0a75c6d64d05e2ecfd19ad227337cf926c8