[INFO] cloning repository https://github.com/peterellisjones/aoc2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/peterellisjones/aoc2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpeterellisjones%2Faoc2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpeterellisjones%2Faoc2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] fb12f9e37ec00a42c83a26d7f856c117c838337c [INFO] linting peterellisjones/aoc2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpeterellisjones%2Faoc2024" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/peterellisjones/aoc2024 [INFO] finished tweaking git repo https://github.com/peterellisjones/aoc2024 [INFO] tweaked toml for git repo https://github.com/peterellisjones/aoc2024 written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/peterellisjones/aoc2024 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/peterellisjones/aoc2024 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 160a7a0537f93e94327855370eb481f0b1aa94bf5550c055324b464e8665229d [INFO] running `Command { std: "docker" "start" "-a" "160a7a0537f93e94327855370eb481f0b1aa94bf5550c055324b464e8665229d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "160a7a0537f93e94327855370eb481f0b1aa94bf5550c055324b464e8665229d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "160a7a0537f93e94327855370eb481f0b1aa94bf5550c055324b464e8665229d", kill_on_drop: false }` [INFO] [stdout] 160a7a0537f93e94327855370eb481f0b1aa94bf5550c055324b464e8665229d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 96bc9538842b25276afbc787ea4fd317f080d927831c939dd7cbeaae4dde94f9 [INFO] running `Command { std: "docker" "start" "-a" "96bc9538842b25276afbc787ea4fd317f080d927831c939dd7cbeaae4dde94f9", kill_on_drop: false }` [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking either v1.13.0 [INFO] [stderr] Checking indexmap v2.7.1 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Checking petgraph v0.6.5 [INFO] [stderr] Checking crossbeam-epoch v0.9.18 [INFO] [stderr] Checking crossbeam-deque v0.8.6 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking rayon-core v1.12.1 [INFO] [stderr] Checking rayon v1.10.0 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking aoc2024 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/utils.rs:74:18 [INFO] [stdout] | [INFO] [stdout] 74 | pub fn width(self: &Self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 74 - pub fn width(self: &Self) -> usize { [INFO] [stdout] 74 + pub fn width(&self) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/utils.rs:78:19 [INFO] [stdout] | [INFO] [stdout] 78 | pub fn height(self: &Self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 78 - pub fn height(self: &Self) -> usize { [INFO] [stdout] 78 + pub fn height(&self) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/utils.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | self: &Self, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 83 - self: &Self, [INFO] [stdout] 83 + &self, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FnvHashSet` [INFO] [stdout] --> src/day12.rs:1:23 [INFO] [stdout] | [INFO] [stdout] 1 | use fnv::{FnvHashMap, FnvHashSet}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/day14.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FnvHasher` [INFO] [stdout] --> src/day14.rs:3:23 [INFO] [stdout] | [INFO] [stdout] 3 | use fnv::{FnvHashMap, FnvHasher}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/day5.rs:76:16 [INFO] [stdout] | [INFO] [stdout] 76 | fn compare(self: &Self, left: &i64, right: &i64) -> Ordering { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 76 - fn compare(self: &Self, left: &i64, right: &i64) -> Ordering { [INFO] [stdout] 76 + fn compare(&self, left: &i64, right: &i64) -> Ordering { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable statement [INFO] [stdout] --> src/day12.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 13 | todo!(); [INFO] [stdout] | ------- any code following this expression is unreachable [INFO] [stdout] 14 | [INFO] [stdout] 15 | let chars = parse_char_grid(raw_input).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/utils.rs:74:18 [INFO] [stdout] | [INFO] [stdout] 74 | pub fn width(self: &Self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 74 - pub fn width(self: &Self) -> usize { [INFO] [stdout] 74 + pub fn width(&self) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/utils.rs:78:19 [INFO] [stdout] | [INFO] [stdout] 78 | pub fn height(self: &Self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 78 - pub fn height(self: &Self) -> usize { [INFO] [stdout] 78 + pub fn height(&self) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/utils.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | self: &Self, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 83 - self: &Self, [INFO] [stdout] 83 + &self, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FnvHashSet` [INFO] [stdout] --> src/day12.rs:1:23 [INFO] [stdout] | [INFO] [stdout] 1 | use fnv::{FnvHashMap, FnvHashSet}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/day14.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FnvHasher` [INFO] [stdout] --> src/day14.rs:3:23 [INFO] [stdout] | [INFO] [stdout] 3 | use fnv::{FnvHashMap, FnvHasher}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/day5.rs:76:16 [INFO] [stdout] | [INFO] [stdout] 76 | fn compare(self: &Self, left: &i64, right: &i64) -> Ordering { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 76 - fn compare(self: &Self, left: &i64, right: &i64) -> Ordering { [INFO] [stdout] 76 + fn compare(&self, left: &i64, right: &i64) -> Ordering { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `raw_input` [INFO] [stdout] --> src/day12.rs:12:14 [INFO] [stdout] | [INFO] [stdout] 12 | fn part1(raw_input: &str) -> i64 { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_raw_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> src/day12.rs:184:36 [INFO] [stdout] | [INFO] [stdout] 184 | .map(|row| row.iter().map(|c| -1i64).collect()) [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> src/day12.rs:194:17 [INFO] [stdout] | [INFO] [stdout] 194 | for (x, c) in row.iter().enumerate() { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable statement [INFO] [stdout] --> src/day12.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 13 | todo!(); [INFO] [stdout] | ------- any code following this expression is unreachable [INFO] [stdout] 14 | [INFO] [stdout] 15 | let chars = parse_char_grid(raw_input).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unreachable statement [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `raw_input` [INFO] [stdout] --> src/day12.rs:12:14 [INFO] [stdout] | [INFO] [stdout] 12 | fn part1(raw_input: &str) -> i64 { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_raw_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> src/day12.rs:184:36 [INFO] [stdout] | [INFO] [stdout] 184 | .map(|row| row.iter().map(|c| -1i64).collect()) [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> src/day12.rs:194:17 [INFO] [stdout] | [INFO] [stdout] 194 | for (x, c) in row.iter().enumerate() { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / if let Err(e) = &ret { [INFO] [stdout] 21 | | if e.kind() == std::io::ErrorKind::NotFound { [INFO] [stdout] 22 | | eprintln!("Warning: File not found: {}", &file_path); [INFO] [stdout] 23 | | } [INFO] [stdout] 24 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 20 ~ if let Err(e) = &ret [INFO] [stdout] 21 ~ && e.kind() == std::io::ErrorKind::NotFound { [INFO] [stdout] 22 | eprintln!("Warning: File not found: {}", &file_path); [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/utils.rs:66:41 [INFO] [stdout] | [INFO] [stdout] 66 | .map(|&y| y.chars().map(|c| parse_char(c)).collect::>()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&parse_char` [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: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/day1.rs:26:14 [INFO] [stdout] | [INFO] [stdout] 26 | .fold(0, |acc, x| acc + x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found `.or(Some(…)).unwrap()` [INFO] [stdout] --> src/day1.rs:39:54 [INFO] [stdout] | [INFO] [stdout] 39 | acc + x * right_list_frequencies.get(&x).or(Some(&0i64)).unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or(&0i64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_then_unwrap [INFO] [stdout] = note: `#[warn(clippy::or_then_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:18:32 [INFO] [stdout] | [INFO] [stdout] 18 | trailhead_rating_score(&raw_input, false) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `raw_input` [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/day10.rs:22:32 [INFO] [stdout] | [INFO] [stdout] 22 | trailhead_rating_score(&raw_input, true) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `raw_input` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day10.rs:33:10 [INFO] [stdout] | [INFO] [stdout] 33 | .map(|(y, row)| row.iter().enumerate().map(move |(x, h)| (y, x, *h))) [INFO] [stdout] | __________^ [INFO] [stdout] 34 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|(y, row)| row.iter().enumerate().map(move |(x, h)| (y, x, *h)))` [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] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/day10.rs:52:17 [INFO] [stdout] | [INFO] [stdout] 52 | let (y, x) = stack.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 51 ~ while let Some((y, x)) = stack.pop() { [INFO] [stdout] 52 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day11.rs:49:46 [INFO] [stdout] | [INFO] [stdout] 49 | blink_on_stone_n_times(1, times - 1, &mut cache) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `cache` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day11.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 55 | if num_digits % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace with: `num_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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day11.rs:57:64 [INFO] [stdout] | [INFO] [stdout] 57 | blink_on_stone_n_times(stone / divisor, times - 1, &mut cache) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `cache` [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/day11.rs:58:70 [INFO] [stdout] | [INFO] [stdout] 58 | + blink_on_stone_n_times(stone % divisor, times - 1, &mut cache) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `cache` [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/day11.rs:61:61 [INFO] [stdout] | [INFO] [stdout] 61 | blink_on_stone_n_times(stone * 2024, times - 1, &mut cache) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `cache` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day12.rs:29:27 [INFO] [stdout] | [INFO] [stdout] 29 | if x == 0 { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 30 | | perimeter += 1; [INFO] [stdout] 31 | | } else if regions[y][x - 1] != *r { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day12.rs:31:51 [INFO] [stdout] | [INFO] [stdout] 31 | } else if regions[y][x - 1] != *r { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 32 | | perimeter += 1; [INFO] [stdout] 33 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day12.rs:35:27 [INFO] [stdout] | [INFO] [stdout] 35 | if y == 0 { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 36 | | perimeter += 1; [INFO] [stdout] 37 | | } else if regions[y - 1][x] != *r { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day12.rs:37:51 [INFO] [stdout] | [INFO] [stdout] 37 | } else if regions[y - 1][x] != *r { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 38 | | perimeter += 1; [INFO] [stdout] 39 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day12.rs:41:39 [INFO] [stdout] | [INFO] [stdout] 41 | if x == row.len() - 1 { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 42 | | perimeter += 1; [INFO] [stdout] 43 | | } else if regions[y][x + 1] != *r { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day12.rs:43:51 [INFO] [stdout] | [INFO] [stdout] 43 | } else if regions[y][x + 1] != *r { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 44 | | perimeter += 1; [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day12.rs:47:43 [INFO] [stdout] | [INFO] [stdout] 47 | if y == regions.len() - 1 { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 48 | | perimeter += 1; [INFO] [stdout] 49 | | } else if regions[y + 1][x] != *r { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day12.rs:49:51 [INFO] [stdout] | [INFO] [stdout] 49 | } else if regions[y + 1][x] != *r { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 50 | | perimeter += 1; [INFO] [stdout] 51 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:197:58 [INFO] [stdout] | [INFO] [stdout] 197 | floodfill(&mut regions, x, y, region_id, &chars); [INFO] [stdout] | ^^^^^^ help: change this to: `chars` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/day14.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 43 | / let safety_factor = quandrant_counts [INFO] [stdout] 44 | | .iter() [INFO] [stdout] 45 | | .fold(1i64, |acc, (_, count)| acc * count); [INFO] [stdout] | |_______________________________________________________- unnecessary `let` binding [INFO] [stdout] 46 | [INFO] [stdout] 47 | safety_factor [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 43 ~ [INFO] [stdout] 44 | [INFO] [stdout] 45 ~ quandrant_counts [INFO] [stdout] 46 + .iter() [INFO] [stdout] 47 + .fold(1i64, |acc, (_, count)| acc * count) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `grid` [INFO] [stdout] --> src/day14.rs:79:22 [INFO] [stdout] | [INFO] [stdout] 79 | for i in 45..75 { [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] 79 - for i in 45..75 { [INFO] [stdout] 79 + for in grid.iter().take(75).skip(45) { [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/day2.rs:54:20 [INFO] [stdout] | [INFO] [stdout] 54 | fn is_safe(levels: &Vec, skip_index: Option) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn is_safe(levels: &Vec, skip_index: Option) -> bool { [INFO] [stdout] 54 + fn is_safe(levels: &[i64], skip_index: Option) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day3.rs:56:35 [INFO] [stdout] | [INFO] [stdout] 56 | Op::Dont => (sum, false || ignore_dos_and_donts), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ignore_dos_and_donts` [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: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/day4.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for y in 0..height { [INFO] [stdout] 21 + for in grid.iter().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/day4.rs:53:22 [INFO] [stdout] | [INFO] [stdout] 53 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 53 - for x in 0..width { [INFO] [stdout] 53 + for in grid.iter().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day4.rs:163:25 [INFO] [stdout] | [INFO] [stdout] 163 | / if X_MAS[j][i] != '.' { [INFO] [stdout] 164 | | if grid[y + j][x + i] != X_MAS[j][i] { [INFO] [stdout] 165 | | found = false; [INFO] [stdout] 166 | | break; [INFO] [stdout] 167 | | } [INFO] [stdout] 168 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 163 ~ if X_MAS[j][i] != '.' [INFO] [stdout] 164 ~ && grid[y + j][x + i] != X_MAS[j][i] { [INFO] [stdout] 165 | found = false; [INFO] [stdout] 166 | break; [INFO] [stdout] 167 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day4.rs:184:25 [INFO] [stdout] | [INFO] [stdout] 184 | / if X_MAS[j][2 - i] != '.' { [INFO] [stdout] 185 | | if grid[y + j][x + i] != X_MAS[j][2 - i] { [INFO] [stdout] 186 | | found = false; [INFO] [stdout] 187 | | break; [INFO] [stdout] 188 | | } [INFO] [stdout] 189 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 184 ~ if X_MAS[j][2 - i] != '.' [INFO] [stdout] 185 ~ && grid[y + j][x + i] != X_MAS[j][2 - i] { [INFO] [stdout] 186 | found = false; [INFO] [stdout] 187 | break; [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day4.rs:205:25 [INFO] [stdout] | [INFO] [stdout] 205 | / if X_MAS[i][j] != '.' { [INFO] [stdout] 206 | | if grid[y + j][x + i] != X_MAS[i][j] { [INFO] [stdout] 207 | | found = false; [INFO] [stdout] 208 | | break; [INFO] [stdout] 209 | | } [INFO] [stdout] 210 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 205 ~ if X_MAS[i][j] != '.' [INFO] [stdout] 206 ~ && grid[y + j][x + i] != X_MAS[i][j] { [INFO] [stdout] 207 | found = false; [INFO] [stdout] 208 | break; [INFO] [stdout] 209 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day4.rs:226:25 [INFO] [stdout] | [INFO] [stdout] 226 | / if X_MAS[i][2 - j] != '.' { [INFO] [stdout] 227 | | if grid[y + j][x + i] != X_MAS[i][2 - j] { [INFO] [stdout] 228 | | found = false; [INFO] [stdout] 229 | | break; [INFO] [stdout] 230 | | } [INFO] [stdout] 231 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 226 ~ if X_MAS[i][2 - j] != '.' [INFO] [stdout] 227 ~ && grid[y + j][x + i] != X_MAS[i][2 - j] { [INFO] [stdout] 228 | found = false; [INFO] [stdout] 229 | break; [INFO] [stdout] 230 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day5.rs:69:33 [INFO] [stdout] | [INFO] [stdout] 69 | .or_insert_with(|| HashSet::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `HashSet::new` [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: unneeded `return` statement [INFO] [stdout] --> src/day5.rs:93:9 [INFO] [stdout] | [INFO] [stdout] 93 | return Ordering::Equal; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 93 - return Ordering::Equal; [INFO] [stdout] 93 + Ordering::Equal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/day5.rs:78:16 [INFO] [stdout] | [INFO] [stdout] 78 | == self [INFO] [stdout] | ________________^ [INFO] [stdout] 79 | | .0 [INFO] [stdout] 80 | | .get(left) [INFO] [stdout] 81 | | .and_then(|values| Some(values.contains(right))) [INFO] [stdout] | |________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 ~ == self [INFO] [stdout] 79 + .0 [INFO] [stdout] 80 + .get(left).map(|values| values.contains(right)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/day5.rs:85:16 [INFO] [stdout] | [INFO] [stdout] 85 | == self [INFO] [stdout] | ________________^ [INFO] [stdout] 86 | | .0 [INFO] [stdout] 87 | | .get(right) [INFO] [stdout] 88 | | .and_then(|values| Some(values.contains(left))) [INFO] [stdout] | |_______________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 85 ~ == self [INFO] [stdout] 86 + .0 [INFO] [stdout] 87 + .get(right).map(|values| values.contains(left)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day5.rs:97:30 [INFO] [stdout] | [INFO] [stdout] 97 | pub fn parse(input: &str) -> Result<(Vec<(i64, i64)>, Vec>), NomError<&str>> { [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day6.rs:62:26 [INFO] [stdout] | [INFO] [stdout] 62 | fn find_guard_start(map: &Vec>) -> (i64, i64) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 62 - fn find_guard_start(map: &Vec>) -> (i64, i64) { [INFO] [stdout] 62 + fn find_guard_start(map: &[Vec]) -> (i64, i64) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day6.rs:79:6 [INFO] [stdout] | [INFO] [stdout] 79 | ) -> (bool, Vec<((i64, i64), i64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#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/day6.rs:77:10 [INFO] [stdout] | [INFO] [stdout] 77 | 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] 77 - map: &Vec>, [INFO] [stdout] 77 + map: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day6.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | / if let Some(&previous_guard_direction_at_position) = route.get(&new_guard_position) { [INFO] [stdout] 111 | | if previous_guard_direction_at_position == guard_direction { [INFO] [stdout] 112 | | return (true, path); [INFO] [stdout] 113 | | } [INFO] [stdout] 114 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 110 ~ if let Some(&previous_guard_direction_at_position) = route.get(&new_guard_position) [INFO] [stdout] 111 ~ && previous_guard_direction_at_position == guard_direction { [INFO] [stdout] 112 | return (true, path); [INFO] [stdout] 113 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day7.rs:47:8 [INFO] [stdout] | [INFO] [stdout] 47 | if inputs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `inputs.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: redundant closure [INFO] [stdout] --> src/day8.rs:36:37 [INFO] [stdout] | [INFO] [stdout] 36 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day9.rs:75:52 [INFO] [stdout] | [INFO] [stdout] 75 | fn parse_files_and_free_spaces(raw_input: &str) -> (Vec<(i64, i64)>, Vec<(i64, i64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/main.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | if let Some(d) = argument.parse().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(d)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 46 - if let Some(d) = argument.parse().ok() { [INFO] [stdout] 46 + if let Ok(d) = argument.parse() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | / if let Some(d) = argument.parse().ok() { [INFO] [stdout] 47 | | if (0..days.len()).contains(&((d - 1) as usize)) { [INFO] [stdout] 48 | | day_to_run = DayToRun::Day(d); [INFO] [stdout] 49 | | } [INFO] [stdout] 50 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 46 ~ if let Some(d) = argument.parse().ok() [INFO] [stdout] 47 ~ && (0..days.len()).contains(&((d - 1) as usize)) { [INFO] [stdout] 48 | day_to_run = DayToRun::Day(d); [INFO] [stdout] 49 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / if let Err(e) = &ret { [INFO] [stdout] 21 | | if e.kind() == std::io::ErrorKind::NotFound { [INFO] [stdout] 22 | | eprintln!("Warning: File not found: {}", &file_path); [INFO] [stdout] 23 | | } [INFO] [stdout] 24 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 20 ~ if let Err(e) = &ret [INFO] [stdout] 21 ~ && e.kind() == std::io::ErrorKind::NotFound { [INFO] [stdout] 22 | eprintln!("Warning: File not found: {}", &file_path); [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/utils.rs:66:41 [INFO] [stdout] | [INFO] [stdout] 66 | .map(|&y| y.chars().map(|c| parse_char(c)).collect::>()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&parse_char` [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: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/day1.rs:26:14 [INFO] [stdout] | [INFO] [stdout] 26 | .fold(0, |acc, x| acc + x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found `.or(Some(…)).unwrap()` [INFO] [stdout] --> src/day1.rs:39:54 [INFO] [stdout] | [INFO] [stdout] 39 | acc + x * right_list_frequencies.get(&x).or(Some(&0i64)).unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or(&0i64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_then_unwrap [INFO] [stdout] = note: `#[warn(clippy::or_then_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:18:32 [INFO] [stdout] | [INFO] [stdout] 18 | trailhead_rating_score(&raw_input, false) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `raw_input` [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/day10.rs:22:32 [INFO] [stdout] | [INFO] [stdout] 22 | trailhead_rating_score(&raw_input, true) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `raw_input` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day10.rs:33:10 [INFO] [stdout] | [INFO] [stdout] 33 | .map(|(y, row)| row.iter().enumerate().map(move |(x, h)| (y, x, *h))) [INFO] [stdout] | __________^ [INFO] [stdout] 34 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|(y, row)| row.iter().enumerate().map(move |(x, h)| (y, x, *h)))` [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] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/day10.rs:52:17 [INFO] [stdout] | [INFO] [stdout] 52 | let (y, x) = stack.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 51 ~ while let Some((y, x)) = stack.pop() { [INFO] [stdout] 52 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day11.rs:49:46 [INFO] [stdout] | [INFO] [stdout] 49 | blink_on_stone_n_times(1, times - 1, &mut cache) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `cache` [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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day11.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 55 | if num_digits % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace with: `num_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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day11.rs:57:64 [INFO] [stdout] | [INFO] [stdout] 57 | blink_on_stone_n_times(stone / divisor, times - 1, &mut cache) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `cache` [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/day11.rs:58:70 [INFO] [stdout] | [INFO] [stdout] 58 | + blink_on_stone_n_times(stone % divisor, times - 1, &mut cache) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `cache` [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/day11.rs:61:61 [INFO] [stdout] | [INFO] [stdout] 61 | blink_on_stone_n_times(stone * 2024, times - 1, &mut cache) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `cache` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day12.rs:29:27 [INFO] [stdout] | [INFO] [stdout] 29 | if x == 0 { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 30 | | perimeter += 1; [INFO] [stdout] 31 | | } else if regions[y][x - 1] != *r { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day12.rs:31:51 [INFO] [stdout] | [INFO] [stdout] 31 | } else if regions[y][x - 1] != *r { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 32 | | perimeter += 1; [INFO] [stdout] 33 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day12.rs:35:27 [INFO] [stdout] | [INFO] [stdout] 35 | if y == 0 { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 36 | | perimeter += 1; [INFO] [stdout] 37 | | } else if regions[y - 1][x] != *r { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day12.rs:37:51 [INFO] [stdout] | [INFO] [stdout] 37 | } else if regions[y - 1][x] != *r { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 38 | | perimeter += 1; [INFO] [stdout] 39 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day12.rs:41:39 [INFO] [stdout] | [INFO] [stdout] 41 | if x == row.len() - 1 { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 42 | | perimeter += 1; [INFO] [stdout] 43 | | } else if regions[y][x + 1] != *r { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day12.rs:43:51 [INFO] [stdout] | [INFO] [stdout] 43 | } else if regions[y][x + 1] != *r { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 44 | | perimeter += 1; [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day12.rs:47:43 [INFO] [stdout] | [INFO] [stdout] 47 | if y == regions.len() - 1 { [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 48 | | perimeter += 1; [INFO] [stdout] 49 | | } else if regions[y + 1][x] != *r { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day12.rs:49:51 [INFO] [stdout] | [INFO] [stdout] 49 | } else if regions[y + 1][x] != *r { [INFO] [stdout] | ___________________________________________________^ [INFO] [stdout] 50 | | perimeter += 1; [INFO] [stdout] 51 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:197:58 [INFO] [stdout] | [INFO] [stdout] 197 | floodfill(&mut regions, x, y, region_id, &chars); [INFO] [stdout] | ^^^^^^ help: change this to: `chars` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/day14.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 43 | / let safety_factor = quandrant_counts [INFO] [stdout] 44 | | .iter() [INFO] [stdout] 45 | | .fold(1i64, |acc, (_, count)| acc * count); [INFO] [stdout] | |_______________________________________________________- unnecessary `let` binding [INFO] [stdout] 46 | [INFO] [stdout] 47 | safety_factor [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 43 ~ [INFO] [stdout] 44 | [INFO] [stdout] 45 ~ quandrant_counts [INFO] [stdout] 46 + .iter() [INFO] [stdout] 47 + .fold(1i64, |acc, (_, count)| acc * count) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `grid` [INFO] [stdout] --> src/day14.rs:79:22 [INFO] [stdout] | [INFO] [stdout] 79 | for i in 45..75 { [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] 79 - for i in 45..75 { [INFO] [stdout] 79 + for in grid.iter().take(75).skip(45) { [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/day2.rs:54:20 [INFO] [stdout] | [INFO] [stdout] 54 | fn is_safe(levels: &Vec, skip_index: Option) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn is_safe(levels: &Vec, skip_index: Option) -> bool { [INFO] [stdout] 54 + fn is_safe(levels: &[i64], skip_index: Option) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day3.rs:56:35 [INFO] [stdout] | [INFO] [stdout] 56 | Op::Dont => (sum, false || ignore_dos_and_donts), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ignore_dos_and_donts` [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: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/day4.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for y in 0..height { [INFO] [stdout] 21 + for in grid.iter().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/day4.rs:53:22 [INFO] [stdout] | [INFO] [stdout] 53 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 53 - for x in 0..width { [INFO] [stdout] 53 + for in grid.iter().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day4.rs:163:25 [INFO] [stdout] | [INFO] [stdout] 163 | / if X_MAS[j][i] != '.' { [INFO] [stdout] 164 | | if grid[y + j][x + i] != X_MAS[j][i] { [INFO] [stdout] 165 | | found = false; [INFO] [stdout] 166 | | break; [INFO] [stdout] 167 | | } [INFO] [stdout] 168 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 163 ~ if X_MAS[j][i] != '.' [INFO] [stdout] 164 ~ && grid[y + j][x + i] != X_MAS[j][i] { [INFO] [stdout] 165 | found = false; [INFO] [stdout] 166 | break; [INFO] [stdout] 167 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day4.rs:184:25 [INFO] [stdout] | [INFO] [stdout] 184 | / if X_MAS[j][2 - i] != '.' { [INFO] [stdout] 185 | | if grid[y + j][x + i] != X_MAS[j][2 - i] { [INFO] [stdout] 186 | | found = false; [INFO] [stdout] 187 | | break; [INFO] [stdout] 188 | | } [INFO] [stdout] 189 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 184 ~ if X_MAS[j][2 - i] != '.' [INFO] [stdout] 185 ~ && grid[y + j][x + i] != X_MAS[j][2 - i] { [INFO] [stdout] 186 | found = false; [INFO] [stdout] 187 | break; [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day4.rs:205:25 [INFO] [stdout] | [INFO] [stdout] 205 | / if X_MAS[i][j] != '.' { [INFO] [stdout] 206 | | if grid[y + j][x + i] != X_MAS[i][j] { [INFO] [stdout] 207 | | found = false; [INFO] [stdout] 208 | | break; [INFO] [stdout] 209 | | } [INFO] [stdout] 210 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 205 ~ if X_MAS[i][j] != '.' [INFO] [stdout] 206 ~ && grid[y + j][x + i] != X_MAS[i][j] { [INFO] [stdout] 207 | found = false; [INFO] [stdout] 208 | break; [INFO] [stdout] 209 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day4.rs:226:25 [INFO] [stdout] | [INFO] [stdout] 226 | / if X_MAS[i][2 - j] != '.' { [INFO] [stdout] 227 | | if grid[y + j][x + i] != X_MAS[i][2 - j] { [INFO] [stdout] 228 | | found = false; [INFO] [stdout] 229 | | break; [INFO] [stdout] 230 | | } [INFO] [stdout] 231 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 226 ~ if X_MAS[i][2 - j] != '.' [INFO] [stdout] 227 ~ && grid[y + j][x + i] != X_MAS[i][2 - j] { [INFO] [stdout] 228 | found = false; [INFO] [stdout] 229 | break; [INFO] [stdout] 230 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day5.rs:69:33 [INFO] [stdout] | [INFO] [stdout] 69 | .or_insert_with(|| HashSet::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `HashSet::new` [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: unneeded `return` statement [INFO] [stdout] --> src/day5.rs:93:9 [INFO] [stdout] | [INFO] [stdout] 93 | return Ordering::Equal; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 93 - return Ordering::Equal; [INFO] [stdout] 93 + Ordering::Equal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/day5.rs:78:16 [INFO] [stdout] | [INFO] [stdout] 78 | == self [INFO] [stdout] | ________________^ [INFO] [stdout] 79 | | .0 [INFO] [stdout] 80 | | .get(left) [INFO] [stdout] 81 | | .and_then(|values| Some(values.contains(right))) [INFO] [stdout] | |________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 ~ == self [INFO] [stdout] 79 + .0 [INFO] [stdout] 80 + .get(left).map(|values| values.contains(right)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/day5.rs:85:16 [INFO] [stdout] | [INFO] [stdout] 85 | == self [INFO] [stdout] | ________________^ [INFO] [stdout] 86 | | .0 [INFO] [stdout] 87 | | .get(right) [INFO] [stdout] 88 | | .and_then(|values| Some(values.contains(left))) [INFO] [stdout] | |_______________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 85 ~ == self [INFO] [stdout] 86 + .0 [INFO] [stdout] 87 + .get(right).map(|values| values.contains(left)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day5.rs:97:30 [INFO] [stdout] | [INFO] [stdout] 97 | pub fn parse(input: &str) -> Result<(Vec<(i64, i64)>, Vec>), NomError<&str>> { [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day6.rs:62:26 [INFO] [stdout] | [INFO] [stdout] 62 | fn find_guard_start(map: &Vec>) -> (i64, i64) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 62 - fn find_guard_start(map: &Vec>) -> (i64, i64) { [INFO] [stdout] 62 + fn find_guard_start(map: &[Vec]) -> (i64, i64) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day6.rs:79:6 [INFO] [stdout] | [INFO] [stdout] 79 | ) -> (bool, Vec<((i64, i64), i64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#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/day6.rs:77:10 [INFO] [stdout] | [INFO] [stdout] 77 | 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] 77 - map: &Vec>, [INFO] [stdout] 77 + map: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day6.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | / if let Some(&previous_guard_direction_at_position) = route.get(&new_guard_position) { [INFO] [stdout] 111 | | if previous_guard_direction_at_position == guard_direction { [INFO] [stdout] 112 | | return (true, path); [INFO] [stdout] 113 | | } [INFO] [stdout] 114 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 110 ~ if let Some(&previous_guard_direction_at_position) = route.get(&new_guard_position) [INFO] [stdout] 111 ~ && previous_guard_direction_at_position == guard_direction { [INFO] [stdout] 112 | return (true, path); [INFO] [stdout] 113 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day7.rs:47:8 [INFO] [stdout] | [INFO] [stdout] 47 | if inputs.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `inputs.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: redundant closure [INFO] [stdout] --> src/day8.rs:36:37 [INFO] [stdout] | [INFO] [stdout] 36 | .or_insert_with(|| Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day9.rs:75:52 [INFO] [stdout] | [INFO] [stdout] 75 | fn parse_files_and_free_spaces(raw_input: &str) -> (Vec<(i64, i64)>, Vec<(i64, i64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/main.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | if let Some(d) = argument.parse().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(d)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 46 - if let Some(d) = argument.parse().ok() { [INFO] [stdout] 46 + if let Ok(d) = argument.parse() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | / if let Some(d) = argument.parse().ok() { [INFO] [stdout] 47 | | if (0..days.len()).contains(&((d - 1) as usize)) { [INFO] [stdout] 48 | | day_to_run = DayToRun::Day(d); [INFO] [stdout] 49 | | } [INFO] [stdout] 50 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 46 ~ if let Some(d) = argument.parse().ok() [INFO] [stdout] 47 ~ && (0..days.len()).contains(&((d - 1) as usize)) { [INFO] [stdout] 48 | day_to_run = DayToRun::Day(d); [INFO] [stdout] 49 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 10.68s [INFO] running `Command { std: "docker" "inspect" "96bc9538842b25276afbc787ea4fd317f080d927831c939dd7cbeaae4dde94f9", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "96bc9538842b25276afbc787ea4fd317f080d927831c939dd7cbeaae4dde94f9", kill_on_drop: false }` [INFO] [stdout] 96bc9538842b25276afbc787ea4fd317f080d927831c939dd7cbeaae4dde94f9