[INFO] cloning repository https://github.com/c-j-j/advent-of-code-2021 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/c-j-j/advent-of-code-2021" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fc-j-j%2Fadvent-of-code-2021", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fc-j-j%2Fadvent-of-code-2021'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 5d9ab4d3c5dd2153bb06c94388a8b242232b8041 [INFO] linting c-j-j/advent-of-code-2021 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fc-j-j%2Fadvent-of-code-2021" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/c-j-j/advent-of-code-2021 [INFO] finished tweaking git repo https://github.com/c-j-j/advent-of-code-2021 [INFO] tweaked toml for git repo https://github.com/c-j-j/advent-of-code-2021 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/c-j-j/advent-of-code-2021 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/c-j-j/advent-of-code-2021 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-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 5eed09343c226ad1e294634bc43b0acc7834f06ad8f1d0feb786045c53a01264 [INFO] running `Command { std: "docker" "start" "-a" "5eed09343c226ad1e294634bc43b0acc7834f06ad8f1d0feb786045c53a01264", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "5eed09343c226ad1e294634bc43b0acc7834f06ad8f1d0feb786045c53a01264", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "5eed09343c226ad1e294634bc43b0acc7834f06ad8f1d0feb786045c53a01264", kill_on_drop: false }` [INFO] [stdout] 5eed09343c226ad1e294634bc43b0acc7834f06ad8f1d0feb786045c53a01264 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 34023a073651ab4029295a23eaed50563177915b63110f687e43888aa7099cb2 [INFO] running `Command { std: "docker" "start" "-a" "34023a073651ab4029295a23eaed50563177915b63110f687e43888aa7099cb2", kill_on_drop: false }` [INFO] [stderr] Checking aoc21 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `VecDeque` [INFO] [stdout] --> src/day15.rs:2:36 [INFO] [stdout] | [INFO] [stdout] 2 | use std::collections::{BinaryHeap, VecDeque}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after outer attribute [INFO] [stdout] --> src/day3.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / #[allow(dead_code)] [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] 3 | fn add_bits(arr: Vec, next: Vec) -> Vec { [INFO] [stdout] | ----------- the attribute applies to this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_outer_attr)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the attribute should apply to the parent module use an inner attribute [INFO] [stdout] | [INFO] [stdout] 1 | #![allow(dead_code)] [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after outer attribute [INFO] [stdout] --> src/day4.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / #[allow(dead_code)] [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] 3 | type Line = Vec; [INFO] [stdout] | --------- the attribute applies to this type alias [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the attribute should apply to the parent module use an inner attribute [INFO] [stdout] | [INFO] [stdout] 1 | #![allow(dead_code)] [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after outer attribute [INFO] [stdout] --> src/day6.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / #[allow(dead_code)] [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] 3 | fn determine_next_state(current_state: &Vec) -> Vec { [INFO] [stdout] | ----------------------- the attribute applies to this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the attribute should apply to the parent module use an inner attribute [INFO] [stdout] | [INFO] [stdout] 1 | #![allow(dead_code)] [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `VecDeque` [INFO] [stdout] --> src/day15.rs:2:36 [INFO] [stdout] | [INFO] [stdout] 2 | use std::collections::{BinaryHeap, VecDeque}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after outer attribute [INFO] [stdout] --> src/day3.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / #[allow(dead_code)] [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] 3 | fn add_bits(arr: Vec, next: Vec) -> Vec { [INFO] [stdout] | ----------- the attribute applies to this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_outer_attr)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the attribute should apply to the parent module use an inner attribute [INFO] [stdout] | [INFO] [stdout] 1 | #![allow(dead_code)] [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after outer attribute [INFO] [stdout] --> src/day4.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / #[allow(dead_code)] [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] 3 | type Line = Vec; [INFO] [stdout] | --------- the attribute applies to this type alias [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the attribute should apply to the parent module use an inner attribute [INFO] [stdout] | [INFO] [stdout] 1 | #![allow(dead_code)] [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after outer attribute [INFO] [stdout] --> src/day6.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | / #[allow(dead_code)] [INFO] [stdout] 2 | | [INFO] [stdout] | |_^ [INFO] [stdout] 3 | fn determine_next_state(current_state: &Vec) -> Vec { [INFO] [stdout] | ----------------------- the attribute applies to this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the attribute should apply to the parent module use an inner attribute [INFO] [stdout] | [INFO] [stdout] 1 | #![allow(dead_code)] [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/day8.rs:162:1 [INFO] [stdout] | [INFO] [stdout] 162 | / /** [INFO] [stdout] 163 | | a - 8 - done [INFO] [stdout] 164 | | b - 6 [INFO] [stdout] 165 | | c - 8 [INFO] [stdout] ... | [INFO] [stdout] 170 | | */ [INFO] [stdout] 171 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 183 | fn testing_part2() { [INFO] [stdout] | ---------------- the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day1.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | return total_increases; [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] 12 - return total_increases; [INFO] [stdout] 12 + total_increases [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day1.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | total_increases = total_increases + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `total_increases += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day10.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | return Ok(stack); [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] 35 - return Ok(stack); [INFO] [stdout] 35 + Ok(stack) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day10.rs:12:17 [INFO] [stdout] | [INFO] [stdout] 12 | / if stack.pop() != Some(')') { [INFO] [stdout] 13 | | return Err(char); [INFO] [stdout] 14 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ ')' [INFO] [stdout] 12 ~ if stack.pop() != Some(')') => { [INFO] [stdout] 13 | return Err(char); [INFO] [stdout] 14 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day10.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | / if stack.pop() != Some('}') { [INFO] [stdout] 18 | | return Err(char); [INFO] [stdout] 19 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ '}' [INFO] [stdout] 17 ~ if stack.pop() != Some('}') => { [INFO] [stdout] 18 | return Err(char); [INFO] [stdout] 19 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day10.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | / if stack.pop() != Some(']') { [INFO] [stdout] 23 | | return Err(char); [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 21 ~ ']' [INFO] [stdout] 22 ~ if stack.pop() != Some(']') => { [INFO] [stdout] 23 | return Err(char); [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day10.rs:27:17 [INFO] [stdout] | [INFO] [stdout] 27 | / if stack.pop() != Some('>') { [INFO] [stdout] 28 | | return Err(char); [INFO] [stdout] 29 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ '>' [INFO] [stdout] 27 ~ if stack.pop() != Some('>') => { [INFO] [stdout] 28 | return Err(char); [INFO] [stdout] 29 ~ } [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/day11.rs:32:19 [INFO] [stdout] | [INFO] [stdout] 32 | fn run_step(grid: &mut Vec>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 32 - fn run_step(grid: &mut Vec>) -> usize { [INFO] [stdout] 32 + fn run_step(grid: &mut [Vec]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/day11.rs:36:14 [INFO] [stdout] | [INFO] [stdout] 36 | 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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 36 - for y in 0..height { [INFO] [stdout] 36 + for in grid.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/day11.rs:37:18 [INFO] [stdout] | [INFO] [stdout] 37 | 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] 37 - for x in 0..width { [INFO] [stdout] 37 + for in grid.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day12.rs:15:16 [INFO] [stdout] | [INFO] [stdout] 15 | small: !(a.to_uppercase() == a), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(a.to_uppercase() != a)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day12.rs:19:16 [INFO] [stdout] | [INFO] [stdout] 19 | small: !(b.to_uppercase() == b), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(b.to_uppercase() != b)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/day12.rs:26:10 [INFO] [stdout] | [INFO] [stdout] 26 | .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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:44:37 [INFO] [stdout] | [INFO] [stdout] 44 | for neighbour in get_neighbours(&connections, current).iter() { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `connections` [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/day12.rs:67:37 [INFO] [stdout] | [INFO] [stdout] 67 | for neighbour in get_neighbours(&connections, current).iter() { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `connections` [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/day12.rs:70:84 [INFO] [stdout] | [INFO] [stdout] 70 | && (!neighbour.small || !has_two_small_caves || !current_path.contains(&neighbour)) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `neighbour` [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: redundant closure [INFO] [stdout] --> src/day12.rs:81:60 [INFO] [stdout] | [INFO] [stdout] 81 | let connections: Vec<(Cave, Cave)> = input.lines().map(|l| parse_line(l)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day12.rs:89:60 [INFO] [stdout] | [INFO] [stdout] 89 | let connections: Vec<(Cave, Cave)> = input.lines().map(|l| parse_line(l)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day13.rs:39:14 [INFO] [stdout] | [INFO] [stdout] 39 | .map(|l| parse_coordinate(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_coordinate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day13.rs:45:14 [INFO] [stdout] | [INFO] [stdout] 45 | .map(|l| parse_instruction(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_instruction` [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: the loop variable `i` is only used to index `grid` [INFO] [stdout] --> src/day13.rs:96:22 [INFO] [stdout] | [INFO] [stdout] 96 | for i in 0..grid.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 96 - for i in 0..grid.len() { [INFO] [stdout] 96 + for in &mut grid { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/day15.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | return Some(cost as i32); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/day15.rs:65:32 [INFO] [stdout] | [INFO] [stdout] 65 | let cost_to_node = numbers[edge.1 * width + edge.0] as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `numbers[edge.1 * width + edge.0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/day15.rs:74:72 [INFO] [stdout] | [INFO] [stdout] 74 | distances[next.position.1 * width + next.position.0] = next.cost as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `next.cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/day15.rs:141:25 [INFO] [stdout] | [INFO] [stdout] 141 | return Some(cost as i32); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/day2.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / impl Default for Position { [INFO] [stdout] 11 | | fn default() -> Self { [INFO] [stdout] 12 | | Self { [INFO] [stdout] 13 | | horizontal: 0, [INFO] [stdout] ... | [INFO] [stdout] 18 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 4 + #[derive(Default)] [INFO] [stdout] 5 | pub struct Position { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day2.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | / return match dir { [INFO] [stdout] 39 | | "up" => Instruction::Up(amount), [INFO] [stdout] 40 | | "down" => Instruction::Down(amount), [INFO] [stdout] 41 | | "forward" => Instruction::Forward(amount), [INFO] [stdout] 42 | | _ => panic!("Invalid instruction {}", dir), [INFO] [stdout] 43 | | }; [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] 38 ~ match dir { [INFO] [stdout] 39 + "up" => Instruction::Up(amount), [INFO] [stdout] 40 + "down" => Instruction::Down(amount), [INFO] [stdout] 41 + "forward" => Instruction::Forward(amount), [INFO] [stdout] 42 + _ => panic!("Invalid instruction {}", dir), [INFO] [stdout] 43 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day2.rs:47:58 [INFO] [stdout] | [INFO] [stdout] 47 | let directions: Vec = input.lines().map(|l| parse_instruction(l)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_instruction` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day2.rs:68:58 [INFO] [stdout] | [INFO] [stdout] 68 | let directions: Vec = input.lines().map(|l| parse_instruction(l)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_instruction` [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/day1.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | return total_increases; [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] 12 - return total_increases; [INFO] [stdout] 12 + total_increases [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day1.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | total_increases = total_increases + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `total_increases += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day10.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | return Ok(stack); [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] 35 - return Ok(stack); [INFO] [stdout] 35 + Ok(stack) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day10.rs:12:17 [INFO] [stdout] | [INFO] [stdout] 12 | / if stack.pop() != Some(')') { [INFO] [stdout] 13 | | return Err(char); [INFO] [stdout] 14 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ ')' [INFO] [stdout] 12 ~ if stack.pop() != Some(')') => { [INFO] [stdout] 13 | return Err(char); [INFO] [stdout] 14 ~ } [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/day3.rs:12:31 [INFO] [stdout] | [INFO] [stdout] 12 | fn get_epsilon(running_total: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 12 - fn get_epsilon(running_total: &Vec) -> i32 { [INFO] [stdout] 12 + fn get_epsilon(running_total: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day10.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | / if stack.pop() != Some('}') { [INFO] [stdout] 18 | | return Err(char); [INFO] [stdout] 19 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ '}' [INFO] [stdout] 17 ~ if stack.pop() != Some('}') => { [INFO] [stdout] 18 | return Err(char); [INFO] [stdout] 19 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day10.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | / if stack.pop() != Some(']') { [INFO] [stdout] 23 | | return Err(char); [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 21 ~ ']' [INFO] [stdout] 22 ~ if stack.pop() != Some(']') => { [INFO] [stdout] 23 | return Err(char); [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day10.rs:27:17 [INFO] [stdout] | [INFO] [stdout] 27 | / if stack.pop() != Some('>') { [INFO] [stdout] 28 | | return Err(char); [INFO] [stdout] 29 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ '>' [INFO] [stdout] 27 ~ if stack.pop() != Some('>') => { [INFO] [stdout] 28 | return Err(char); [INFO] [stdout] 29 ~ } [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/day3.rs:21:29 [INFO] [stdout] | [INFO] [stdout] 21 | fn get_gamma(running_total: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 21 - fn get_gamma(running_total: &Vec) -> i32 { [INFO] [stdout] 21 + fn get_gamma(running_total: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day3.rs:44:23 [INFO] [stdout] | [INFO] [stdout] 44 | fn filter_down(input: &String, find_most_common: bool) -> 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] 44 - fn filter_down(input: &String, find_most_common: bool) -> Vec { [INFO] [stdout] 44 + fn filter_down(input: &str, find_most_common: bool) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/day3.rs:56:24 [INFO] [stdout] | [INFO] [stdout] 56 | let next = code.iter().nth(bit_index).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 56 - let next = code.iter().nth(bit_index).unwrap(); [INFO] [stdout] 56 + let next = code.get(bit_index).unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day3.rs:59:17 [INFO] [stdout] | [INFO] [stdout] 59 | num_ones = num_ones + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `num_ones += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day3.rs:61:17 [INFO] [stdout] | [INFO] [stdout] 61 | num_zeros = num_zeros + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `num_zeros += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/day3.rs:79:9 [INFO] [stdout] | [INFO] [stdout] 79 | / candidate_codes = candidate_codes [INFO] [stdout] 80 | | .into_iter() [INFO] [stdout] 81 | | .filter(|c| c.iter().nth(bit_index).unwrap().eq(&num_to_filter)) [INFO] [stdout] 82 | | .collect(); [INFO] [stdout] | |______________________^ help: consider calling `.retain()` instead: `candidate_codes.retain(|c| c.iter().nth(bit_index).unwrap().eq(&num_to_filter))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] = note: `#[warn(clippy::manual_retain)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/day3.rs:81:25 [INFO] [stdout] | [INFO] [stdout] 81 | .filter(|c| c.iter().nth(bit_index).unwrap().eq(&num_to_filter)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 81 - .filter(|c| c.iter().nth(bit_index).unwrap().eq(&num_to_filter)) [INFO] [stdout] 81 + .filter(|c| c.get(bit_index).unwrap().eq(&num_to_filter)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day3.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | bit_index = bit_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `bit_index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `.iter().next()` on an array [INFO] [stdout] --> src/day3.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | candidate_codes.iter().next().unwrap().to_owned() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling: `candidate_codes.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice [INFO] [stdout] = note: `#[warn(clippy::iter_next_slice)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day11.rs:32:19 [INFO] [stdout] | [INFO] [stdout] 32 | fn run_step(grid: &mut Vec>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 32 - fn run_step(grid: &mut Vec>) -> usize { [INFO] [stdout] 32 + fn run_step(grid: &mut [Vec]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/day11.rs:36:14 [INFO] [stdout] | [INFO] [stdout] 36 | 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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 36 - for y in 0..height { [INFO] [stdout] 36 + for in grid.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/day11.rs:37:18 [INFO] [stdout] | [INFO] [stdout] 37 | 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] 37 - for x in 0..width { [INFO] [stdout] 37 + for in grid.iter_mut().take(width) { [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/day4.rs:28:36 [INFO] [stdout] | [INFO] [stdout] 28 | fn get_winning_line(drawn_numbers: &Vec, board: &Board) -> Option { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 28 - fn get_winning_line(drawn_numbers: &Vec, board: &Board) -> Option { [INFO] [stdout] 28 + fn get_winning_line(drawn_numbers: &[u32], board: &Board) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day4.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | return unmarked.iter().sum::() * drawn.last().unwrap(); [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] 97 - return unmarked.iter().sum::() * drawn.last().unwrap(); [INFO] [stdout] 97 + unmarked.iter().sum::() * drawn.last().unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day4.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | / board [INFO] [stdout] 90 | | .iter() [INFO] [stdout] 91 | | .filter(|n| !drawn.contains(*n)) [INFO] [stdout] 92 | | .map(|n| *n) [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] 89 ~ board [INFO] [stdout] 90 + .iter() [INFO] [stdout] 91 + .filter(|n| !drawn.contains(*n)).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day4.rs:133:5 [INFO] [stdout] | [INFO] [stdout] 133 | return unmarked.iter().sum::() * drawn.last().unwrap(); [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] 133 - return unmarked.iter().sum::() * drawn.last().unwrap(); [INFO] [stdout] 133 + unmarked.iter().sum::() * drawn.last().unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day12.rs:15:16 [INFO] [stdout] | [INFO] [stdout] 15 | small: !(a.to_uppercase() == a), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(a.to_uppercase() != a)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day12.rs:19:16 [INFO] [stdout] | [INFO] [stdout] 19 | small: !(b.to_uppercase() == b), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(b.to_uppercase() != b)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/day12.rs:26:10 [INFO] [stdout] | [INFO] [stdout] 26 | .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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:44:37 [INFO] [stdout] | [INFO] [stdout] 44 | for neighbour in get_neighbours(&connections, current).iter() { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `connections` [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: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day4.rs:125:13 [INFO] [stdout] | [INFO] [stdout] 125 | / board [INFO] [stdout] 126 | | .iter() [INFO] [stdout] 127 | | .filter(|n| !drawn.contains(*n)) [INFO] [stdout] 128 | | .map(|n| *n) [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] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 125 ~ board [INFO] [stdout] 126 + .iter() [INFO] [stdout] 127 + .filter(|n| !drawn.contains(*n)).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day5.rs:35:23 [INFO] [stdout] | [INFO] [stdout] 35 | input.lines().map(|line| parse_line(line)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [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:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | return -1; [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] 40 - return -1; [INFO] [stdout] 40 + -1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day5.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | return 1; [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] 42 - return 1; [INFO] [stdout] 42 + 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day5.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | return 0; [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] 44 - return 0; [INFO] [stdout] 44 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:67:37 [INFO] [stdout] | [INFO] [stdout] 67 | for neighbour in get_neighbours(&connections, current).iter() { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `connections` [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/day12.rs:70:84 [INFO] [stdout] | [INFO] [stdout] 70 | && (!neighbour.small || !has_two_small_caves || !current_path.contains(&neighbour)) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `neighbour` [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: redundant closure [INFO] [stdout] --> src/day12.rs:81:60 [INFO] [stdout] | [INFO] [stdout] 81 | let connections: Vec<(Cave, Cave)> = input.lines().map(|l| parse_line(l)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day12.rs:89:60 [INFO] [stdout] | [INFO] [stdout] 89 | let connections: Vec<(Cave, Cave)> = input.lines().map(|l| parse_line(l)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day13.rs:39:14 [INFO] [stdout] | [INFO] [stdout] 39 | .map(|l| parse_coordinate(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_coordinate` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day6.rs:3:40 [INFO] [stdout] | [INFO] [stdout] 3 | fn determine_next_state(current_state: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 ~ fn determine_next_state(current_state: &[i64]) -> Vec { [INFO] [stdout] 4 ~ let mut next = current_state.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day13.rs:45:14 [INFO] [stdout] | [INFO] [stdout] 45 | .map(|l| parse_instruction(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_instruction` [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: the loop variable `i` is only used to index `next` [INFO] [stdout] --> src/day6.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | for i in 0..next.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 8 - for i in 0..next.len() { [INFO] [stdout] 8 + for in &mut next { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day6.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | next[i] = next[i] - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next[i] -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day6.rs:23:35 [INFO] [stdout] | [INFO] [stdout] 23 | fn determine_next_state_2(counts: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 23 ~ fn determine_next_state_2(counts: &[i64]) -> Vec { [INFO] [stdout] 24 ~ let mut next = counts.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day6.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | next[6] = next[6] + num_fish_to_reset; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next[6] += num_fish_to_reset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day6.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | counts[index] = counts[index] + 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `counts[index] += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `grid` [INFO] [stdout] --> src/day13.rs:96:22 [INFO] [stdout] | [INFO] [stdout] 96 | for i in 0..grid.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 96 - for i in 0..grid.len() { [INFO] [stdout] 96 + for in &mut grid { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/day15.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | return Some(cost as i32); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day7.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | fuel = fuel + (position - (i as i64)).abs() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `fuel += (position - (i as i64)).abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day7.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | sum = sum + i [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `sum += i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/day15.rs:65:32 [INFO] [stdout] | [INFO] [stdout] 65 | let cost_to_node = numbers[edge.1 * width + edge.0] as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `numbers[edge.1 * width + edge.0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day7.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | fuel = fuel + cost; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `fuel += cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/day15.rs:74:72 [INFO] [stdout] | [INFO] [stdout] 74 | distances[next.position.1 * width + next.position.0] = next.cost as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `next.cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/day15.rs:141:25 [INFO] [stdout] | [INFO] [stdout] 141 | return Some(cost as i32); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/day2.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | / impl Default for Position { [INFO] [stdout] 11 | | fn default() -> Self { [INFO] [stdout] 12 | | Self { [INFO] [stdout] 13 | | horizontal: 0, [INFO] [stdout] ... | [INFO] [stdout] 18 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 4 + #[derive(Default)] [INFO] [stdout] 5 | pub struct Position { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day2.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | / return match dir { [INFO] [stdout] 39 | | "up" => Instruction::Up(amount), [INFO] [stdout] 40 | | "down" => Instruction::Down(amount), [INFO] [stdout] 41 | | "forward" => Instruction::Forward(amount), [INFO] [stdout] 42 | | _ => panic!("Invalid instruction {}", dir), [INFO] [stdout] 43 | | }; [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] 38 ~ match dir { [INFO] [stdout] 39 + "up" => Instruction::Up(amount), [INFO] [stdout] 40 + "down" => Instruction::Down(amount), [INFO] [stdout] 41 + "forward" => Instruction::Forward(amount), [INFO] [stdout] 42 + _ => panic!("Invalid instruction {}", dir), [INFO] [stdout] 43 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day2.rs:47:58 [INFO] [stdout] | [INFO] [stdout] 47 | let directions: Vec = input.lines().map(|l| parse_instruction(l)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_instruction` [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: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/day8.rs:6:22 [INFO] [stdout] | [INFO] [stdout] 6 | let output = line.split('|').last().unwrap(); [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] 6 - let output = line.split('|').last().unwrap(); [INFO] [stdout] 6 + let output = line.split('|').next_back().unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day8.rs:12:17 [INFO] [stdout] | [INFO] [stdout] 12 | total = total + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `total += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day8.rs:23:32 [INFO] [stdout] | [INFO] [stdout] 23 | fn find_word_containing(words: &Vec, num_letters: usize, word: &String) -> String { [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] 23 - fn find_word_containing(words: &Vec, num_letters: usize, word: &String) -> String { [INFO] [stdout] 23 + fn find_word_containing(words: &[String], num_letters: usize, word: &String) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day8.rs:30:8 [INFO] [stdout] | [INFO] [stdout] 30 | if filtered_words.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `filtered_words.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/day2.rs:68:58 [INFO] [stdout] | [INFO] [stdout] 68 | let directions: Vec = input.lines().map(|l| parse_instruction(l)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_instruction` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day8.rs:51:29 [INFO] [stdout] | [INFO] [stdout] 51 | fn get_output_value(output: &String, mapping: HashMap) -> 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] 51 - fn get_output_value(output: &String, mapping: HashMap) -> i64 { [INFO] [stdout] 51 + fn get_output_value(output: &str, mapping: HashMap) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:67:26 [INFO] [stdout] | [INFO] [stdout] 67 | .map(|c| mapping.get(&c).unwrap().clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*mapping.get(&c).unwrap()` [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: consider using `sort` [INFO] [stdout] --> src/day8.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | key.sort_by(|a, b| a.cmp(b)); [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] 76 - key.sort_by(|a, b| a.cmp(b)); [INFO] [stdout] 76 + key.sort(); [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/day3.rs:12:31 [INFO] [stdout] | [INFO] [stdout] 12 | fn get_epsilon(running_total: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 12 - fn get_epsilon(running_total: &Vec) -> i32 { [INFO] [stdout] 12 + fn get_epsilon(running_total: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day3.rs:21:29 [INFO] [stdout] | [INFO] [stdout] 21 | fn get_gamma(running_total: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 21 - fn get_gamma(running_total: &Vec) -> i32 { [INFO] [stdout] 21 + fn get_gamma(running_total: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day3.rs:44:23 [INFO] [stdout] | [INFO] [stdout] 44 | fn filter_down(input: &String, find_most_common: bool) -> 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] 44 - fn filter_down(input: &String, find_most_common: bool) -> Vec { [INFO] [stdout] 44 + fn filter_down(input: &str, find_most_common: bool) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/day3.rs:56:24 [INFO] [stdout] | [INFO] [stdout] 56 | let next = code.iter().nth(bit_index).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 56 - let next = code.iter().nth(bit_index).unwrap(); [INFO] [stdout] 56 + let next = code.get(bit_index).unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day3.rs:59:17 [INFO] [stdout] | [INFO] [stdout] 59 | num_ones = num_ones + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `num_ones += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day3.rs:61:17 [INFO] [stdout] | [INFO] [stdout] 61 | num_zeros = num_zeros + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `num_zeros += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/day3.rs:79:9 [INFO] [stdout] | [INFO] [stdout] 79 | / candidate_codes = candidate_codes [INFO] [stdout] 80 | | .into_iter() [INFO] [stdout] 81 | | .filter(|c| c.iter().nth(bit_index).unwrap().eq(&num_to_filter)) [INFO] [stdout] 82 | | .collect(); [INFO] [stdout] | |______________________^ help: consider calling `.retain()` instead: `candidate_codes.retain(|c| c.iter().nth(bit_index).unwrap().eq(&num_to_filter))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] = note: `#[warn(clippy::manual_retain)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/day3.rs:81:25 [INFO] [stdout] | [INFO] [stdout] 81 | .filter(|c| c.iter().nth(bit_index).unwrap().eq(&num_to_filter)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 81 - .filter(|c| c.iter().nth(bit_index).unwrap().eq(&num_to_filter)) [INFO] [stdout] 81 + .filter(|c| c.get(bit_index).unwrap().eq(&num_to_filter)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day3.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | bit_index = bit_index + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `bit_index += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `.iter().next()` on an array [INFO] [stdout] --> src/day3.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | candidate_codes.iter().next().unwrap().to_owned() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling: `candidate_codes.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice [INFO] [stdout] = note: `#[warn(clippy::iter_next_slice)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, char>` [INFO] [stdout] --> src/day8.rs:87:30 [INFO] [stdout] | [INFO] [stdout] 87 | let mut line_input = line.split('|').into_iter(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `line.split('|')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | let b = counts.iter().find(|(_k, v)| **v == 6).unwrap().0.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*counts.iter().find(|(_k, v)| **v == 6).unwrap().0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:104:17 [INFO] [stdout] | [INFO] [stdout] 104 | let c = counts [INFO] [stdout] | _________________^ [INFO] [stdout] 105 | | .iter() [INFO] [stdout] 106 | | .find(|(k, v)| **v == 8 && **k != a) [INFO] [stdout] 107 | | .unwrap() [INFO] [stdout] 108 | | .0 [INFO] [stdout] 109 | | .clone(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 104 ~ let c = *counts [INFO] [stdout] 105 + .iter() [INFO] [stdout] 106 + .find(|(k, v)| **v == 8 && **k != a) [INFO] [stdout] 107 + .unwrap() [INFO] [stdout] 108 ~ .0; [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/day4.rs:28:36 [INFO] [stdout] | [INFO] [stdout] 28 | fn get_winning_line(drawn_numbers: &Vec, board: &Board) -> Option { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 28 - fn get_winning_line(drawn_numbers: &Vec, board: &Board) -> Option { [INFO] [stdout] 28 + fn get_winning_line(drawn_numbers: &[u32], board: &Board) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | let d = counts [INFO] [stdout] | _________________^ [INFO] [stdout] 111 | | .iter() [INFO] [stdout] 112 | | .filter(|(_k, v)| **v == 7) [INFO] [stdout] 113 | | .find(|(k, _v)| four.contains(**k)) [INFO] [stdout] 114 | | .unwrap() [INFO] [stdout] 115 | | .0 [INFO] [stdout] 116 | | .clone(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 110 ~ let d = *counts [INFO] [stdout] 111 + .iter() [INFO] [stdout] 112 + .filter(|(_k, v)| **v == 7) [INFO] [stdout] 113 + .find(|(k, _v)| four.contains(**k)) [INFO] [stdout] 114 + .unwrap() [INFO] [stdout] 115 ~ .0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 117 | let e = counts.iter().find(|(_k, v)| **v == 4).unwrap().0.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*counts.iter().find(|(_k, v)| **v == 4).unwrap().0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:118:17 [INFO] [stdout] | [INFO] [stdout] 118 | let f = counts.iter().find(|(_k, v)| **v == 9).unwrap().0.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*counts.iter().find(|(_k, v)| **v == 9).unwrap().0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:119:17 [INFO] [stdout] | [INFO] [stdout] 119 | let g = counts [INFO] [stdout] | _________________^ [INFO] [stdout] 120 | | .iter() [INFO] [stdout] 121 | | .find(|(k, v)| **v == 7 && **k != d) [INFO] [stdout] 122 | | .unwrap() [INFO] [stdout] 123 | | .0 [INFO] [stdout] 124 | | .clone(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 119 ~ let g = *counts [INFO] [stdout] 120 + .iter() [INFO] [stdout] 121 + .find(|(k, v)| **v == 7 && **k != d) [INFO] [stdout] 122 + .unwrap() [INFO] [stdout] 123 ~ .0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day8.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | total = total + get_output_value(&output, mapping); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `total += get_output_value(&output, mapping)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day4.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | return unmarked.iter().sum::() * drawn.last().unwrap(); [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] 97 - return unmarked.iter().sum::() * drawn.last().unwrap(); [INFO] [stdout] 97 + unmarked.iter().sum::() * drawn.last().unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day4.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | / board [INFO] [stdout] 90 | | .iter() [INFO] [stdout] 91 | | .filter(|n| !drawn.contains(*n)) [INFO] [stdout] 92 | | .map(|n| *n) [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] 89 ~ board [INFO] [stdout] 90 + .iter() [INFO] [stdout] 91 + .filter(|n| !drawn.contains(*n)).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day4.rs:133:5 [INFO] [stdout] | [INFO] [stdout] 133 | return unmarked.iter().sum::() * drawn.last().unwrap(); [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] 133 - return unmarked.iter().sum::() * drawn.last().unwrap(); [INFO] [stdout] 133 + unmarked.iter().sum::() * drawn.last().unwrap() [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/day9.rs:1:17 [INFO] [stdout] | [INFO] [stdout] 1 | fn get_xy(grid: &Vec>, x: i64, y: i64) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1 - fn get_xy(grid: &Vec>, x: i64, y: i64) -> u32 { [INFO] [stdout] 1 + fn get_xy(grid: &[Vec], x: i64, y: i64) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/day9.rs:3:16 [INFO] [stdout] | [INFO] [stdout] 3 | return u32::max_value(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [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] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 3 - return u32::max_value(); [INFO] [stdout] 3 + return u32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/day9.rs:6:16 [INFO] [stdout] | [INFO] [stdout] 6 | return u32::max_value(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 6 - return u32::max_value(); [INFO] [stdout] 6 + return u32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day4.rs:125:13 [INFO] [stdout] | [INFO] [stdout] 125 | / board [INFO] [stdout] 126 | | .iter() [INFO] [stdout] 127 | | .filter(|n| !drawn.contains(*n)) [INFO] [stdout] 128 | | .map(|n| *n) [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] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 125 ~ board [INFO] [stdout] 126 + .iter() [INFO] [stdout] 127 + .filter(|n| !drawn.contains(*n)).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day9.rs:53:13 [INFO] [stdout] | [INFO] [stdout] 53 | basin_size = basin_size + dfs(grid, neighbour.0, neighbour.1, visited) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `basin_size += dfs(grid, neighbour.0, neighbour.1, visited)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day5.rs:35:23 [INFO] [stdout] | [INFO] [stdout] 35 | input.lines().map(|line| parse_line(line)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [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:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | return -1; [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] 40 - return -1; [INFO] [stdout] 40 + -1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day5.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | return 1; [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] 42 - return 1; [INFO] [stdout] 42 + 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day5.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | return 0; [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] 44 - return 0; [INFO] [stdout] 44 + 0 [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/day6.rs:3:40 [INFO] [stdout] | [INFO] [stdout] 3 | fn determine_next_state(current_state: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 ~ fn determine_next_state(current_state: &[i64]) -> Vec { [INFO] [stdout] 4 ~ let mut next = current_state.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `next` [INFO] [stdout] --> src/day6.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | for i in 0..next.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 8 - for i in 0..next.len() { [INFO] [stdout] 8 + for in &mut next { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day6.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | next[i] = next[i] - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next[i] -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day6.rs:23:35 [INFO] [stdout] | [INFO] [stdout] 23 | fn determine_next_state_2(counts: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 23 ~ fn determine_next_state_2(counts: &[i64]) -> Vec { [INFO] [stdout] 24 ~ let mut next = counts.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day6.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | next[6] = next[6] + num_fish_to_reset; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next[6] += num_fish_to_reset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day9.rs:28:28 [INFO] [stdout] | [INFO] [stdout] 28 | let elements = vec![a, b, current, d, e]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[a, b, current, d, e]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day9.rs:83:28 [INFO] [stdout] | [INFO] [stdout] 83 | let elements = vec![a, b, current, d, e]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[a, b, current, d, e]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day6.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | counts[index] = counts[index] + 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `counts[index] += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `.clone()` on a double reference, which returns `&str` instead of cloning the inner type [INFO] [stdout] --> src/day8.rs:78:54 [INFO] [stdout] | [INFO] [stdout] 78 | numbers.get(sorted_key.as_str()).unwrap().clone() [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(suspicious_double_ref_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day7.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | fuel = fuel + (position - (i as i64)).abs() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `fuel += (position - (i as i64)).abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day7.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | sum = sum + i [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `sum += i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day7.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | fuel = fuel + cost; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `fuel += cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/day8.rs:6:22 [INFO] [stdout] | [INFO] [stdout] 6 | let output = line.split('|').last().unwrap(); [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] 6 - let output = line.split('|').last().unwrap(); [INFO] [stdout] 6 + let output = line.split('|').next_back().unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day8.rs:12:17 [INFO] [stdout] | [INFO] [stdout] 12 | total = total + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `total += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day8.rs:23:32 [INFO] [stdout] | [INFO] [stdout] 23 | fn find_word_containing(words: &Vec, num_letters: usize, word: &String) -> String { [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] 23 - fn find_word_containing(words: &Vec, num_letters: usize, word: &String) -> String { [INFO] [stdout] 23 + fn find_word_containing(words: &[String], num_letters: usize, word: &String) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day8.rs:30:8 [INFO] [stdout] | [INFO] [stdout] 30 | if filtered_words.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `filtered_words.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day8.rs:51:29 [INFO] [stdout] | [INFO] [stdout] 51 | fn get_output_value(output: &String, mapping: HashMap) -> 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] 51 - fn get_output_value(output: &String, mapping: HashMap) -> i64 { [INFO] [stdout] 51 + fn get_output_value(output: &str, mapping: HashMap) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:67:26 [INFO] [stdout] | [INFO] [stdout] 67 | .map(|c| mapping.get(&c).unwrap().clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*mapping.get(&c).unwrap()` [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: consider using `sort` [INFO] [stdout] --> src/day8.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | key.sort_by(|a, b| a.cmp(b)); [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] 76 - key.sort_by(|a, b| a.cmp(b)); [INFO] [stdout] 76 + key.sort(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, char>` [INFO] [stdout] --> src/day8.rs:87:30 [INFO] [stdout] | [INFO] [stdout] 87 | let mut line_input = line.split('|').into_iter(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `line.split('|')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | let b = counts.iter().find(|(_k, v)| **v == 6).unwrap().0.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*counts.iter().find(|(_k, v)| **v == 6).unwrap().0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:104:17 [INFO] [stdout] | [INFO] [stdout] 104 | let c = counts [INFO] [stdout] | _________________^ [INFO] [stdout] 105 | | .iter() [INFO] [stdout] 106 | | .find(|(k, v)| **v == 8 && **k != a) [INFO] [stdout] 107 | | .unwrap() [INFO] [stdout] 108 | | .0 [INFO] [stdout] 109 | | .clone(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 104 ~ let c = *counts [INFO] [stdout] 105 + .iter() [INFO] [stdout] 106 + .find(|(k, v)| **v == 8 && **k != a) [INFO] [stdout] 107 + .unwrap() [INFO] [stdout] 108 ~ .0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | let d = counts [INFO] [stdout] | _________________^ [INFO] [stdout] 111 | | .iter() [INFO] [stdout] 112 | | .filter(|(_k, v)| **v == 7) [INFO] [stdout] 113 | | .find(|(k, _v)| four.contains(**k)) [INFO] [stdout] 114 | | .unwrap() [INFO] [stdout] 115 | | .0 [INFO] [stdout] 116 | | .clone(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 110 ~ let d = *counts [INFO] [stdout] 111 + .iter() [INFO] [stdout] 112 + .filter(|(_k, v)| **v == 7) [INFO] [stdout] 113 + .find(|(k, _v)| four.contains(**k)) [INFO] [stdout] 114 + .unwrap() [INFO] [stdout] 115 ~ .0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 117 | let e = counts.iter().find(|(_k, v)| **v == 4).unwrap().0.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*counts.iter().find(|(_k, v)| **v == 4).unwrap().0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:118:17 [INFO] [stdout] | [INFO] [stdout] 118 | let f = counts.iter().find(|(_k, v)| **v == 9).unwrap().0.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*counts.iter().find(|(_k, v)| **v == 9).unwrap().0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day8.rs:119:17 [INFO] [stdout] | [INFO] [stdout] 119 | let g = counts [INFO] [stdout] | _________________^ [INFO] [stdout] 120 | | .iter() [INFO] [stdout] 121 | | .find(|(k, v)| **v == 7 && **k != d) [INFO] [stdout] 122 | | .unwrap() [INFO] [stdout] 123 | | .0 [INFO] [stdout] 124 | | .clone(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 119 ~ let g = *counts [INFO] [stdout] 120 + .iter() [INFO] [stdout] 121 + .find(|(k, v)| **v == 7 && **k != d) [INFO] [stdout] 122 + .unwrap() [INFO] [stdout] 123 ~ .0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day8.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | total = total + get_output_value(&output, mapping); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `total += get_output_value(&output, mapping)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day9.rs:1:17 [INFO] [stdout] | [INFO] [stdout] 1 | fn get_xy(grid: &Vec>, x: i64, y: i64) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1 - fn get_xy(grid: &Vec>, x: i64, y: i64) -> u32 { [INFO] [stdout] 1 + fn get_xy(grid: &[Vec], x: i64, y: i64) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/day9.rs:3:16 [INFO] [stdout] | [INFO] [stdout] 3 | return u32::max_value(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [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] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 3 - return u32::max_value(); [INFO] [stdout] 3 + return u32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/day9.rs:6:16 [INFO] [stdout] | [INFO] [stdout] 6 | return u32::max_value(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 6 - return u32::max_value(); [INFO] [stdout] 6 + return u32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day9.rs:53:13 [INFO] [stdout] | [INFO] [stdout] 53 | basin_size = basin_size + dfs(grid, neighbour.0, neighbour.1, visited) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `basin_size += dfs(grid, neighbour.0, neighbour.1, visited)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day9.rs:28:28 [INFO] [stdout] | [INFO] [stdout] 28 | let elements = vec![a, b, current, d, e]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[a, b, current, d, e]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day9.rs:83:28 [INFO] [stdout] | [INFO] [stdout] 83 | let elements = vec![a, b, current, d, e]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[a, b, current, d, e]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `.clone()` on a double reference, which returns `&str` instead of cloning the inner type [INFO] [stdout] --> src/day8.rs:78:54 [INFO] [stdout] | [INFO] [stdout] 78 | numbers.get(sorted_key.as_str()).unwrap().clone() [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(suspicious_double_ref_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.77s [INFO] running `Command { std: "docker" "inspect" "34023a073651ab4029295a23eaed50563177915b63110f687e43888aa7099cb2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "34023a073651ab4029295a23eaed50563177915b63110f687e43888aa7099cb2", kill_on_drop: false }` [INFO] [stdout] 34023a073651ab4029295a23eaed50563177915b63110f687e43888aa7099cb2