[INFO] cloning repository https://github.com/tblue1994/aoc-rust-2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/tblue1994/aoc-rust-2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftblue1994%2Faoc-rust-2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftblue1994%2Faoc-rust-2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] b0ed6ebc46af0fffe114b50afbfdcc9e1feb98ab [INFO] linting tblue1994/aoc-rust-2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftblue1994%2Faoc-rust-2024" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-5-tc1/source/.cargo/config.toml [INFO] started tweaking git repo https://github.com/tblue1994/aoc-rust-2024 [INFO] finished tweaking git repo https://github.com/tblue1994/aoc-rust-2024 [INFO] tweaked toml for git repo https://github.com/tblue1994/aoc-rust-2024 written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/tblue1994/aoc-rust-2024 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/tblue1994/aoc-rust-2024 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded cauchy v0.4.0 [INFO] [stderr] Downloaded lax v0.16.0 [INFO] [stderr] Downloaded thread-tree v0.3.3 [INFO] [stderr] Downloaded katexit v0.1.4 [INFO] [stderr] Downloaded thiserror v1.0.55 [INFO] [stderr] Downloaded thiserror-impl v1.0.55 [INFO] [stderr] Downloaded fast_polynomial v0.3.0 [INFO] [stderr] Downloaded lambert_w v0.5.9 [INFO] [stderr] Downloaded ndarray-linalg v0.16.0 [INFO] [stderr] Downloaded portable-atomic v1.10.0 [INFO] [stderr] Downloaded mathru v0.15.4 [INFO] [stderr] Downloaded libc v0.2.168 [INFO] [stderr] Downloaded lapack-sys v0.14.0 [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] a181a9626acbdc292d7509faa9117daf9ece81185189ae5b2e5703c0648be3ad [INFO] running `Command { std: "docker" "start" "-a" "a181a9626acbdc292d7509faa9117daf9ece81185189ae5b2e5703c0648be3ad", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "a181a9626acbdc292d7509faa9117daf9ece81185189ae5b2e5703c0648be3ad", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a181a9626acbdc292d7509faa9117daf9ece81185189ae5b2e5703c0648be3ad", kill_on_drop: false }` [INFO] [stdout] a181a9626acbdc292d7509faa9117daf9ece81185189ae5b2e5703c0648be3ad [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] 916568b050c48d56b8e3b1aec78280faaabcd2efbc2f44ae533260323e2b97b5 [INFO] running `Command { std: "docker" "start" "-a" "916568b050c48d56b8e3b1aec78280faaabcd2efbc2f44ae533260323e2b97b5", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.70 [INFO] [stderr] Compiling libc v0.2.168 [INFO] [stderr] Checking byteorder v1.5.0 [INFO] [stderr] Compiling crossbeam-utils v0.8.20 [INFO] [stderr] Compiling serde v1.0.193 [INFO] [stderr] Compiling num-traits v0.2.17 [INFO] [stderr] Compiling matrixmultiply v0.3.9 [INFO] [stderr] Checking rawpointer v0.2.1 [INFO] [stderr] Compiling thiserror v1.0.55 [INFO] [stderr] Checking memchr v2.6.4 [INFO] [stderr] Checking lambert_w v0.5.9 [INFO] [stderr] Checking tinyjson v2.5.1 [INFO] [stderr] Checking crossbeam-channel v0.5.13 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking num_cpus v1.16.0 [INFO] [stderr] Checking cblas-sys v0.1.4 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking lapack-sys v0.14.0 [INFO] [stderr] Compiling quote v1.0.33 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Checking approx v0.4.0 [INFO] [stderr] Checking thread-tree v0.3.3 [INFO] [stderr] Compiling syn v2.0.39 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Compiling thiserror-impl v1.0.55 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Checking ppv-lite86 v0.2.20 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Compiling katexit v0.1.4 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking num-complex v0.4.5 [INFO] [stderr] Checking mathru v0.15.4 [INFO] [stderr] Checking cauchy v0.4.0 [INFO] [stderr] Checking ndarray v0.15.6 [INFO] [stderr] Checking ndarray v0.16.1 [INFO] [stderr] Checking lax v0.16.0 [INFO] [stderr] Checking ndarray-linalg v0.16.0 [INFO] [stderr] Checking advent_of_code v0.11.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 - data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] 54 + data.sort_unstable_by_key(|a| a.day); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 - data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] 54 + data.sort_unstable_by_key(|a| a.day); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(isize, isize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/06.rs:17:44 [INFO] [stdout] | [INFO] [stdout] 17 | let positions = solve_part1(&lab_grid, starting_guard_position.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `starting_guard_position` [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: importing legacy numeric constants [INFO] [stdout] --> src/bin/16.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | isize, u64, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `isize::` 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: importing legacy numeric constants [INFO] [stdout] --> src/bin/16.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | isize, u64, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `u64::` 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] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(isize, isize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/06.rs:22:34 [INFO] [stdout] | [INFO] [stdout] 22 | let mut guard_position = starting_guard_position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `starting_guard_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:114:5 [INFO] [stdout] | [INFO] [stdout] 114 | return positions; [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] 114 - return positions; [INFO] [stdout] 114 + positions [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/16.rs:118:11 [INFO] [stdout] | [INFO] [stdout] 118 | maze: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 118 - maze: &Vec>, [INFO] [stdout] 118 + maze: &[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/bin/06.rs:81:15 [INFO] [stdout] | [INFO] [stdout] 81 | lab_grid: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 81 - lab_grid: &Vec>, [INFO] [stdout] 81 + lab_grid: &[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/bin/06.rs:117:29 [INFO] [stdout] | [INFO] [stdout] 117 | pub fn find_guard(lab_grid: &Vec>) -> (isize, isize) { [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] 117 - pub fn find_guard(lab_grid: &Vec>) -> (isize, isize) { [INFO] [stdout] 117 + pub fn find_guard(lab_grid: &[Vec]) -> (isize, isize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `lab_grid` [INFO] [stdout] --> src/bin/06.rs:119:18 [INFO] [stdout] | [INFO] [stdout] 119 | for x in 0..lab_grid[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 119 - for x in 0..lab_grid[0].len() { [INFO] [stdout] 119 + for (x, ) in lab_grid.iter().enumerate().take(lab_grid[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/bin/16.rs:121:5 [INFO] [stdout] | [INFO] [stdout] 121 | / visited [INFO] [stdout] 122 | | .get(&space) [INFO] [stdout] 123 | | .and_then(|v| Some(*v >= expected_score - 1001)) [INFO] [stdout] 124 | | .or_else(|| Some(true)) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 124 - .or_else(|| Some(true)) [INFO] [stdout] 124 + .or(Some(true)) [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/bin/16.rs:121:5 [INFO] [stdout] | [INFO] [stdout] 121 | / visited [INFO] [stdout] 122 | | .get(&space) [INFO] [stdout] 123 | | .and_then(|v| Some(*v >= expected_score - 1001)) [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] 121 ~ visited [INFO] [stdout] 122 + .get(&space).map(|v| *v >= expected_score - 1001) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/bin/22.rs:112:8 [INFO] [stdout] | [INFO] [stdout] 112 | if sequence == &vec![-2, 1, -1, 3] { [INFO] [stdout] | ^^^^^^^^^^^^------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `vec![-2, 1, -1, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `x` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/20.rs:112:57 [INFO] [stdout] | [INFO] [stdout] 108 | if x.is_some() && y.is_some() && step_counts.contains_key(&(x.unwrap(), y.unwrap())) [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 112 | .checked_sub(*step_counts.get(&(x.unwrap(), y.unwrap())).unwrap()) [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `y` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/20.rs:112:69 [INFO] [stdout] | [INFO] [stdout] 108 | if x.is_some() && y.is_some() && step_counts.contains_key(&(x.unwrap(), y.unwrap())) [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 112 | .checked_sub(*step_counts.get(&(x.unwrap(), y.unwrap())).unwrap()) [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/20.rs:108:17 [INFO] [stdout] | [INFO] [stdout] 108 | / if x.is_some() && y.is_some() && step_counts.contains_key(&(x.unwrap(), y.unwrap())) [INFO] [stdout] 109 | | { [INFO] [stdout] 110 | | if position [INFO] [stdout] 111 | | .1 [INFO] [stdout] ... | [INFO] [stdout] 117 | | } [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] 108 ~ if x.is_some() && y.is_some() && step_counts.contains_key(&(x.unwrap(), y.unwrap())) [INFO] [stdout] 109 ~ && position [INFO] [stdout] 110 | .1 [INFO] [stdout] ... [INFO] [stdout] 114 | count += 1 [INFO] [stdout] 115 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:83:18 [INFO] [stdout] | [INFO] [stdout] 83 | 0 => register_a = Box::new(register_a.as_ref() * 2_u128.pow(operand_value as u32)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_a = register_a.as_ref() * 2_u128.pow(operand_value as u32)` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] = note: `#[warn(clippy::replace_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:84:18 [INFO] [stdout] | [INFO] [stdout] 84 | 1 => register_b = Box::new(register_b.as_ref() ^ operand as u128), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_b = register_b.as_ref() ^ operand as u128` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:85:18 [INFO] [stdout] | [INFO] [stdout] 85 | 2 => register_b = Box::new(operand_value % 8), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_b = operand_value % 8` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:91:18 [INFO] [stdout] | [INFO] [stdout] 91 | 4 => register_b = Box::new(register_b.as_ref() ^ register_c.as_ref()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_b = register_b.as_ref() ^ register_c.as_ref()` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:102:17 [INFO] [stdout] | [INFO] [stdout] 102 | *operand_value = Box::new(**operand_value + diff); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `**operand_value = **operand_value + diff` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:105:18 [INFO] [stdout] | [INFO] [stdout] 105 | 6 => register_a = Box::new(register_b.as_ref() * 2_u128.pow(operand_value as u32)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_a = register_b.as_ref() * 2_u128.pow(operand_value as u32)` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:106:18 [INFO] [stdout] | [INFO] [stdout] 106 | 7 => register_a = Box::new(register_c.as_ref() * 2_u128.pow(operand_value as u32)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_a = register_c.as_ref() * 2_u128.pow(operand_value as u32)` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `warehouse` [INFO] [stdout] --> src/bin/15.rs:29:18 [INFO] [stdout] | [INFO] [stdout] 29 | for x in 0..warehouse[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 29 - for x in 0..warehouse[0].len() { [INFO] [stdout] 29 + for (x, ) in warehouse.iter().enumerate().take(warehouse[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `warehouse` [INFO] [stdout] --> src/bin/15.rs:81:18 [INFO] [stdout] | [INFO] [stdout] 81 | for x in 0..warehouse[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 81 - for x in 0..warehouse[0].len() { [INFO] [stdout] 81 + for (x, ) in warehouse.iter().enumerate().take(warehouse[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/15.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | return desired_position; [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] 139 - return desired_position; [INFO] [stdout] 139 + desired_position [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/08.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | i32, isize, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` 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: importing legacy numeric constants [INFO] [stdout] --> src/bin/08.rs:3:10 [INFO] [stdout] | [INFO] [stdout] 3 | i32, isize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `isize::` 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] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `points` [INFO] [stdout] --> src/bin/08.rs:37:22 [INFO] [stdout] | [INFO] [stdout] 37 | for j in i + 1..points.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 37 - for j in i + 1..points.len() { [INFO] [stdout] 37 + for in points.iter().skip(i + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `lists` [INFO] [stdout] --> src/bin/01.rs:6:14 [INFO] [stdout] | [INFO] [stdout] 6 | for i in 0..lists[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 6 - for i in 0..lists[0].len() { [INFO] [stdout] 6 + for in lists.iter().take(lists[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/bin/01.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 34 | let vec = Vec::from([list1, list2]); [INFO] [stdout] | ------------------------------------ unnecessary `let` binding [INFO] [stdout] 35 | vec [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] 34 ~ [INFO] [stdout] 35 ~ Vec::from([list1, list2]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `lists` [INFO] [stdout] --> src/bin/01.rs:6:14 [INFO] [stdout] | [INFO] [stdout] 6 | for i in 0..lists[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 6 - for i in 0..lists[0].len() { [INFO] [stdout] 6 + for in lists.iter().take(lists[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/bin/01.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 34 | let vec = Vec::from([list1, list2]); [INFO] [stdout] | ------------------------------------ unnecessary `let` binding [INFO] [stdout] 35 | vec [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] 34 ~ [INFO] [stdout] 35 ~ Vec::from([list1, list2]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:68:5 [INFO] [stdout] | [INFO] [stdout] 68 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 68 - return true; [INFO] [stdout] 68 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:58:22 [INFO] [stdout] | [INFO] [stdout] 58 | pub fn solve(report: &mut 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] 58 - pub fn solve(report: &mut Vec) -> bool { [INFO] [stdout] 58 + pub fn solve(report: &mut [i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/02.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | if dif < 1 || dif > 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `!(1..=3).contains(&dif)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/02.rs:90:31 [INFO] [stdout] | [INFO] [stdout] 90 | } else if !(report.len() <= (i + 2)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(report.len() > (i + 2))` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 104 - return true; [INFO] [stdout] 104 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:71:36 [INFO] [stdout] | [INFO] [stdout] 71 | pub fn solve_with_mulligan(report: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - pub fn solve_with_mulligan(report: &Vec) -> bool { [INFO] [stdout] 71 + pub fn solve_with_mulligan(report: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/02.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | if dif < 1 || dif > 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `!(1..=3).contains(&dif)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/02.rs:87:24 [INFO] [stdout] | [INFO] [stdout] 87 | if skip_dif >= 1 && skip_dif <= 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=3).contains(&skip_dif)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/02.rs:93:28 [INFO] [stdout] | [INFO] [stdout] 93 | if forward_dif >= 1 && forward_dif <= 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=3).contains(&forward_dif)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:83:18 [INFO] [stdout] | [INFO] [stdout] 83 | 0 => register_a = Box::new(register_a.as_ref() * 2_u128.pow(operand_value as u32)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_a = register_a.as_ref() * 2_u128.pow(operand_value as u32)` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] = note: `#[warn(clippy::replace_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:84:18 [INFO] [stdout] | [INFO] [stdout] 84 | 1 => register_b = Box::new(register_b.as_ref() ^ operand as u128), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_b = register_b.as_ref() ^ operand as u128` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:85:18 [INFO] [stdout] | [INFO] [stdout] 85 | 2 => register_b = Box::new(operand_value % 8), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_b = operand_value % 8` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:91:18 [INFO] [stdout] | [INFO] [stdout] 91 | 4 => register_b = Box::new(register_b.as_ref() ^ register_c.as_ref()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_b = register_b.as_ref() ^ register_c.as_ref()` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:102:17 [INFO] [stdout] | [INFO] [stdout] 102 | *operand_value = Box::new(**operand_value + diff); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `**operand_value = **operand_value + diff` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:105:18 [INFO] [stdout] | [INFO] [stdout] 105 | 6 => register_a = Box::new(register_b.as_ref() * 2_u128.pow(operand_value as u32)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_a = register_b.as_ref() * 2_u128.pow(operand_value as u32)` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a new box [INFO] [stdout] --> src/bin/17.rs:106:18 [INFO] [stdout] | [INFO] [stdout] 106 | 7 => register_a = Box::new(register_c.as_ref() * 2_u128.pow(operand_value as u32)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with inner value instead: `*register_a = register_c.as_ref() * 2_u128.pow(operand_value as u32)` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `warehouse` [INFO] [stdout] --> src/bin/15.rs:29:18 [INFO] [stdout] | [INFO] [stdout] 29 | for x in 0..warehouse[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 29 - for x in 0..warehouse[0].len() { [INFO] [stdout] 29 + for (x, ) in warehouse.iter().enumerate().take(warehouse[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `warehouse` [INFO] [stdout] --> src/bin/15.rs:81:18 [INFO] [stdout] | [INFO] [stdout] 81 | for x in 0..warehouse[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 81 - for x in 0..warehouse[0].len() { [INFO] [stdout] 81 + for (x, ) in warehouse.iter().enumerate().take(warehouse[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/15.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | return desired_position; [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] 139 - return desired_position; [INFO] [stdout] 139 + desired_position [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `x` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/20.rs:112:57 [INFO] [stdout] | [INFO] [stdout] 108 | if x.is_some() && y.is_some() && step_counts.contains_key(&(x.unwrap(), y.unwrap())) [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 112 | .checked_sub(*step_counts.get(&(x.unwrap(), y.unwrap())).unwrap()) [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `y` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/20.rs:112:69 [INFO] [stdout] | [INFO] [stdout] 108 | if x.is_some() && y.is_some() && step_counts.contains_key(&(x.unwrap(), y.unwrap())) [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 112 | .checked_sub(*step_counts.get(&(x.unwrap(), y.unwrap())).unwrap()) [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/20.rs:108:17 [INFO] [stdout] | [INFO] [stdout] 108 | / if x.is_some() && y.is_some() && step_counts.contains_key(&(x.unwrap(), y.unwrap())) [INFO] [stdout] 109 | | { [INFO] [stdout] 110 | | if position [INFO] [stdout] 111 | | .1 [INFO] [stdout] ... | [INFO] [stdout] 117 | | } [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] 108 ~ if x.is_some() && y.is_some() && step_counts.contains_key(&(x.unwrap(), y.unwrap())) [INFO] [stdout] 109 ~ && position [INFO] [stdout] 110 | .1 [INFO] [stdout] ... [INFO] [stdout] 114 | count += 1 [INFO] [stdout] 115 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/14.rs:92:18 [INFO] [stdout] | [INFO] [stdout] 92 | let re = Regex::new(r"p=(\d+),(\d+) v=(-?\d+),(-?\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/14.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | for line in input.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/18.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | 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 `i` is only used to index `blocks` [INFO] [stdout] --> src/bin/18.rs:59:14 [INFO] [stdout] | [INFO] [stdout] 59 | for i in 0..num_blocks { [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] 59 - for i in 0..num_blocks { [INFO] [stdout] 59 + for in blocks.iter().take(num_blocks) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/18.rs:99:9 [INFO] [stdout] | [INFO] [stdout] 99 | return u32::MAX; [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] 99 - return u32::MAX; [INFO] [stdout] 99 + u32::MAX [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/19.rs:71:47 [INFO] [stdout] | [INFO] [stdout] 71 | let possible = is_design_possible(&design[towel.len()..], &filtered_towels, unmakeable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/19.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | if design.starts_with(towel) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 65 ~ if let Some() = design.strip_prefix(towel) { [INFO] [stdout] 66 | let filtered_towels: Vec<&str> = towels [INFO] [stdout] ... [INFO] [stdout] 70 | .collect(); [INFO] [stdout] 71 ~ let possible = is_design_possible(, &filtered_towels, unmakeable); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/19.rs:66:46 [INFO] [stdout] | [INFO] [stdout] 66 | let filtered_towels: Vec<&str> = towels [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 67 | | .into_iter() [INFO] [stdout] 68 | | .filter(|t| design.contains(*t)) [INFO] [stdout] 69 | | .map(|s| *s) [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 66 ~ let filtered_towels: Vec<&str> = towels [INFO] [stdout] 67 + .into_iter() [INFO] [stdout] 68 + .filter(|t| design.contains(*t)).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/bin/19.rs:67:18 [INFO] [stdout] | [INFO] [stdout] 67 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/19.rs:96:40 [INFO] [stdout] | [INFO] [stdout] 96 | count += get_design_counts(&design[towel.len()..], towels, known_keys); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/19.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | if design.starts_with(towel) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 95 ~ if let Some() = design.strip_prefix(towel) { [INFO] [stdout] 96 ~ count += get_design_counts(, towels, known_keys); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/bin/21.rs:122:13 [INFO] [stdout] | [INFO] [stdout] 122 | / if hash.contains_key(&(current_value, s.0)) { [INFO] [stdout] 123 | | new_sequence.extend(hash.get(&(current_value, s.0)).unwrap()); [INFO] [stdout] 124 | | } else { [INFO] [stdout] 125 | | let moves_for_move = get_arrowpad_move(current_value, s.0); [INFO] [stdout] 126 | | hash.insert((current_value, s.0), moves_for_move.clone()); [INFO] [stdout] 127 | | new_sequence.extend(moves_for_move); [INFO] [stdout] 128 | | } [INFO] [stdout] | |_____________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 122 ~ if let std::collections::hash_map::Entry::Vacant(e) = hash.entry((current_value, s.0)) { [INFO] [stdout] 123 + let moves_for_move = get_arrowpad_move(current_value, s.0); [INFO] [stdout] 124 + e.insert(moves_for_move.clone()); [INFO] [stdout] 125 + new_sequence.extend(moves_for_move); [INFO] [stdout] 126 + } else { [INFO] [stdout] 127 + new_sequence.extend(hash.get(&(current_value, s.0)).unwrap()); [INFO] [stdout] 128 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/19.rs:71:47 [INFO] [stdout] | [INFO] [stdout] 71 | let possible = is_design_possible(&design[towel.len()..], &filtered_towels, unmakeable); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/19.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | if design.starts_with(towel) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 65 ~ if let Some() = design.strip_prefix(towel) { [INFO] [stdout] 66 | let filtered_towels: Vec<&str> = towels [INFO] [stdout] ... [INFO] [stdout] 70 | .collect(); [INFO] [stdout] 71 ~ let possible = is_design_possible(, &filtered_towels, unmakeable); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/19.rs:66:46 [INFO] [stdout] | [INFO] [stdout] 66 | let filtered_towels: Vec<&str> = towels [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 67 | | .into_iter() [INFO] [stdout] 68 | | .filter(|t| design.contains(*t)) [INFO] [stdout] 69 | | .map(|s| *s) [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 66 ~ let filtered_towels: Vec<&str> = towels [INFO] [stdout] 67 + .into_iter() [INFO] [stdout] 68 + .filter(|t| design.contains(*t)).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/bin/19.rs:67:18 [INFO] [stdout] | [INFO] [stdout] 67 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/19.rs:96:40 [INFO] [stdout] | [INFO] [stdout] 96 | count += get_design_counts(&design[towel.len()..], towels, known_keys); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/19.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | if design.starts_with(towel) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 95 ~ if let Some() = design.strip_prefix(towel) { [INFO] [stdout] 96 ~ count += get_design_counts(, towels, known_keys); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/24.rs:220:5 [INFO] [stdout] | [INFO] [stdout] 220 | / if let Some(gate) = gate { [INFO] [stdout] 221 | | Some(gate.clone()) [INFO] [stdout] 222 | | } else { [INFO] [stdout] 223 | | None [INFO] [stdout] 224 | | } [INFO] [stdout] | |_____^ help: try: `gate.map(|gate| gate.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/23.rs:26:49 [INFO] [stdout] | [INFO] [stdout] 26 | let found_cycles = find_loop_of_len(&key, &key, 2, &mut current_path, &graph); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/23.rs:26:55 [INFO] [stdout] | [INFO] [stdout] 26 | let found_cycles = find_loop_of_len(&key, &key, 2, &mut current_path, &graph); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/23.rs:64:46 [INFO] [stdout] | [INFO] [stdout] 64 | let init_inter: BTreeSet<&str> = nodes.intersection(&a_nodes).map(|x| *x).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `nodes.intersection(&a_nodes).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `pages` [INFO] [stdout] --> src/bin/05.rs:36:26 [INFO] [stdout] | [INFO] [stdout] 36 | for j in 0..i { [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] 36 - for j in 0..i { [INFO] [stdout] 36 + for in pages.iter().take(i) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/05.rs:53:62 [INFO] [stdout] | [INFO] [stdout] 53 | } else if rules.get(a).unwrap().contains(&b) { [INFO] [stdout] | ^^ help: change this to: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/05.rs:55:62 [INFO] [stdout] | [INFO] [stdout] 55 | } else if rules.get(b).unwrap().contains(&a) { [INFO] [stdout] | ^^ help: change this to: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/23.rs:64:65 [INFO] [stdout] | [INFO] [stdout] 64 | let init_inter: BTreeSet<&str> = nodes.intersection(&a_nodes).map(|x| *x).collect(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `a_nodes` [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 are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/23.rs:88:34 [INFO] [stdout] | [INFO] [stdout] 88 | let new_babies = clone.intersection(adj_baby).map(|x| *x).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `clone.intersection(adj_baby).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(isize, isize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/06.rs:17:44 [INFO] [stdout] | [INFO] [stdout] 17 | let positions = solve_part1(&lab_grid, starting_guard_position.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `starting_guard_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(isize, isize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/06.rs:22:34 [INFO] [stdout] | [INFO] [stdout] 22 | let mut guard_position = starting_guard_position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `starting_guard_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:114:5 [INFO] [stdout] | [INFO] [stdout] 114 | return positions; [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] 114 - return positions; [INFO] [stdout] 114 + positions [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/06.rs:81:15 [INFO] [stdout] | [INFO] [stdout] 81 | lab_grid: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 81 - lab_grid: &Vec>, [INFO] [stdout] 81 + lab_grid: &[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/bin/06.rs:117:29 [INFO] [stdout] | [INFO] [stdout] 117 | pub fn find_guard(lab_grid: &Vec>) -> (isize, isize) { [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] 117 - pub fn find_guard(lab_grid: &Vec>) -> (isize, isize) { [INFO] [stdout] 117 + pub fn find_guard(lab_grid: &[Vec]) -> (isize, isize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `lab_grid` [INFO] [stdout] --> src/bin/06.rs:119:18 [INFO] [stdout] | [INFO] [stdout] 119 | for x in 0..lab_grid[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 119 - for x in 0..lab_grid[0].len() { [INFO] [stdout] 119 + for (x, ) in lab_grid.iter().enumerate().take(lab_grid[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/23.rs:26:49 [INFO] [stdout] | [INFO] [stdout] 26 | let found_cycles = find_loop_of_len(&key, &key, 2, &mut current_path, &graph); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/23.rs:26:55 [INFO] [stdout] | [INFO] [stdout] 26 | let found_cycles = find_loop_of_len(&key, &key, 2, &mut current_path, &graph); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:68:5 [INFO] [stdout] | [INFO] [stdout] 68 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 68 - return true; [INFO] [stdout] 68 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:58:22 [INFO] [stdout] | [INFO] [stdout] 58 | pub fn solve(report: &mut 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] 58 - pub fn solve(report: &mut Vec) -> bool { [INFO] [stdout] 58 + pub fn solve(report: &mut [i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/02.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | if dif < 1 || dif > 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `!(1..=3).contains(&dif)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/02.rs:90:31 [INFO] [stdout] | [INFO] [stdout] 90 | } else if !(report.len() <= (i + 2)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(report.len() > (i + 2))` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 104 - return true; [INFO] [stdout] 104 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:71:36 [INFO] [stdout] | [INFO] [stdout] 71 | pub fn solve_with_mulligan(report: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - pub fn solve_with_mulligan(report: &Vec) -> bool { [INFO] [stdout] 71 + pub fn solve_with_mulligan(report: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/02.rs:80:12 [INFO] [stdout] | [INFO] [stdout] 80 | if dif < 1 || dif > 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `!(1..=3).contains(&dif)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/02.rs:87:24 [INFO] [stdout] | [INFO] [stdout] 87 | if skip_dif >= 1 && skip_dif <= 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=3).contains(&skip_dif)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/02.rs:93:28 [INFO] [stdout] | [INFO] [stdout] 93 | if forward_dif >= 1 && forward_dif <= 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=3).contains(&forward_dif)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/23.rs:64:46 [INFO] [stdout] | [INFO] [stdout] 64 | let init_inter: BTreeSet<&str> = nodes.intersection(&a_nodes).map(|x| *x).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `nodes.intersection(&a_nodes).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/23.rs:64:65 [INFO] [stdout] | [INFO] [stdout] 64 | let init_inter: BTreeSet<&str> = nodes.intersection(&a_nodes).map(|x| *x).collect(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `a_nodes` [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 are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/23.rs:88:34 [INFO] [stdout] | [INFO] [stdout] 88 | let new_babies = clone.intersection(adj_baby).map(|x| *x).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `clone.intersection(adj_baby).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/bin/21.rs:122:13 [INFO] [stdout] | [INFO] [stdout] 122 | / if hash.contains_key(&(current_value, s.0)) { [INFO] [stdout] 123 | | new_sequence.extend(hash.get(&(current_value, s.0)).unwrap()); [INFO] [stdout] 124 | | } else { [INFO] [stdout] 125 | | let moves_for_move = get_arrowpad_move(current_value, s.0); [INFO] [stdout] 126 | | hash.insert((current_value, s.0), moves_for_move.clone()); [INFO] [stdout] 127 | | new_sequence.extend(moves_for_move); [INFO] [stdout] 128 | | } [INFO] [stdout] | |_____________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 122 ~ if let std::collections::hash_map::Entry::Vacant(e) = hash.entry((current_value, s.0)) { [INFO] [stdout] 123 + let moves_for_move = get_arrowpad_move(current_value, s.0); [INFO] [stdout] 124 + e.insert(moves_for_move.clone()); [INFO] [stdout] 125 + new_sequence.extend(moves_for_move); [INFO] [stdout] 126 + } else { [INFO] [stdout] 127 + new_sequence.extend(hash.get(&(current_value, s.0)).unwrap()); [INFO] [stdout] 128 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/08.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | i32, isize, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` 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: importing legacy numeric constants [INFO] [stdout] --> src/bin/08.rs:3:10 [INFO] [stdout] | [INFO] [stdout] 3 | i32, isize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `isize::` 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] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/13.rs:26:22 [INFO] [stdout] | [INFO] [stdout] 26 | let re = Regex::new(r"Button A: X\+(\d+), Y\+(\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/13.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | for (i, line) in input.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `points` [INFO] [stdout] --> src/bin/08.rs:37:22 [INFO] [stdout] | [INFO] [stdout] 37 | for j in i + 1..points.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 37 - for j in i + 1..points.len() { [INFO] [stdout] 37 + for in points.iter().skip(i + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/13.rs:35:22 [INFO] [stdout] | [INFO] [stdout] 35 | let re = Regex::new(r"Button B: X\+(\d+), Y\+(\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/13.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | for (i, line) in input.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/13.rs:44:22 [INFO] [stdout] | [INFO] [stdout] 44 | let re = Regex::new(r"Prize: X=(\d+), Y=(\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/13.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | for (i, line) in input.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/bin/22.rs:112:8 [INFO] [stdout] | [INFO] [stdout] 112 | if sequence == &vec![-2, 1, -1, 3] { [INFO] [stdout] | ^^^^^^^^^^^^------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `vec![-2, 1, -1, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/16.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | isize, u64, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `isize::` 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: importing legacy numeric constants [INFO] [stdout] --> src/bin/16.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | isize, u64, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `u64::` 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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/16.rs:118:11 [INFO] [stdout] | [INFO] [stdout] 118 | maze: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 118 - maze: &Vec>, [INFO] [stdout] 118 + maze: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/bin/16.rs:121:5 [INFO] [stdout] | [INFO] [stdout] 121 | / visited [INFO] [stdout] 122 | | .get(&space) [INFO] [stdout] 123 | | .and_then(|v| Some(*v >= expected_score - 1001)) [INFO] [stdout] 124 | | .or_else(|| Some(true)) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 124 - .or_else(|| Some(true)) [INFO] [stdout] 124 + .or(Some(true)) [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/bin/16.rs:121:5 [INFO] [stdout] | [INFO] [stdout] 121 | / visited [INFO] [stdout] 122 | | .get(&space) [INFO] [stdout] 123 | | .and_then(|v| Some(*v >= expected_score - 1001)) [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] 121 ~ visited [INFO] [stdout] 122 + .get(&space).map(|v| *v >= expected_score - 1001) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `pages` [INFO] [stdout] --> src/bin/05.rs:36:26 [INFO] [stdout] | [INFO] [stdout] 36 | for j in 0..i { [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] 36 - for j in 0..i { [INFO] [stdout] 36 + for in pages.iter().take(i) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/05.rs:53:62 [INFO] [stdout] | [INFO] [stdout] 53 | } else if rules.get(a).unwrap().contains(&b) { [INFO] [stdout] | ^^ help: change this to: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/05.rs:55:62 [INFO] [stdout] | [INFO] [stdout] 55 | } else if rules.get(b).unwrap().contains(&a) { [INFO] [stdout] | ^^ help: change this to: `a` [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 `unwrap` on `known` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/11.rs:65:17 [INFO] [stdout] | [INFO] [stdout] 64 | if known.is_some() { [INFO] [stdout] | ------------------ help: try: `if let Some() = known` [INFO] [stdout] 65 | return *known.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/11.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | return count; [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] 91 - return count; [INFO] [stdout] 91 + count [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/11.rs:72:12 [INFO] [stdout] | [INFO] [stdout] 72 | if stone_string.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `stone_string.len().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: importing legacy numeric constants [INFO] [stdout] --> src/bin/18.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | 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 `i` is only used to index `blocks` [INFO] [stdout] --> src/bin/18.rs:59:14 [INFO] [stdout] | [INFO] [stdout] 59 | for i in 0..num_blocks { [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] 59 - for i in 0..num_blocks { [INFO] [stdout] 59 + for in blocks.iter().take(num_blocks) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/18.rs:99:9 [INFO] [stdout] | [INFO] [stdout] 99 | return u32::MAX; [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] 99 - return u32::MAX; [INFO] [stdout] 99 + u32::MAX [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/14.rs:92:18 [INFO] [stdout] | [INFO] [stdout] 92 | let re = Regex::new(r"p=(\d+),(\d+) v=(-?\d+),(-?\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/14.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | for line in input.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/13.rs:26:22 [INFO] [stdout] | [INFO] [stdout] 26 | let re = Regex::new(r"Button A: X\+(\d+), Y\+(\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/13.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | for (i, line) in input.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/13.rs:35:22 [INFO] [stdout] | [INFO] [stdout] 35 | let re = Regex::new(r"Button B: X\+(\d+), Y\+(\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/13.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | for (i, line) in input.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/13.rs:44:22 [INFO] [stdout] | [INFO] [stdout] 44 | let re = Regex::new(r"Prize: X=(\d+), Y=(\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/13.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | for (i, line) in input.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/24.rs:220:5 [INFO] [stdout] | [INFO] [stdout] 220 | / if let Some(gate) = gate { [INFO] [stdout] 221 | | Some(gate.clone()) [INFO] [stdout] 222 | | } else { [INFO] [stdout] 223 | | None [INFO] [stdout] 224 | | } [INFO] [stdout] | |_____^ help: try: `gate.map(|gate| gate.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `known` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/11.rs:65:17 [INFO] [stdout] | [INFO] [stdout] 64 | if known.is_some() { [INFO] [stdout] | ------------------ help: try: `if let Some() = known` [INFO] [stdout] 65 | return *known.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/11.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | return count; [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] 91 - return count; [INFO] [stdout] 91 + count [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/11.rs:72:12 [INFO] [stdout] | [INFO] [stdout] 72 | if stone_string.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `stone_string.len().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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 37.59s [INFO] running `Command { std: "docker" "inspect" "916568b050c48d56b8e3b1aec78280faaabcd2efbc2f44ae533260323e2b97b5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "916568b050c48d56b8e3b1aec78280faaabcd2efbc2f44ae533260323e2b97b5", kill_on_drop: false }` [INFO] [stdout] 916568b050c48d56b8e3b1aec78280faaabcd2efbc2f44ae533260323e2b97b5