[INFO] cloning repository https://github.com/dprgarner/advent-of-code-2022 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/dprgarner/advent-of-code-2022" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdprgarner%2Fadvent-of-code-2022", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdprgarner%2Fadvent-of-code-2022'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 132702e1c6eeb8c1205b9851a689c67b6398c855 [INFO] linting dprgarner/advent-of-code-2022 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdprgarner%2Fadvent-of-code-2022" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/dprgarner/advent-of-code-2022 [INFO] finished tweaking git repo https://github.com/dprgarner/advent-of-code-2022 [INFO] tweaked toml for git repo https://github.com/dprgarner/advent-of-code-2022 written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/dprgarner/advent-of-code-2022 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/dprgarner/advent-of-code-2022 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-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 57699bb96a3e0670bdb7589ff331206ad5eaaa8da1753e11dcb5b9af9c11d83c [INFO] running `Command { std: "docker" "start" "-a" "57699bb96a3e0670bdb7589ff331206ad5eaaa8da1753e11dcb5b9af9c11d83c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "57699bb96a3e0670bdb7589ff331206ad5eaaa8da1753e11dcb5b9af9c11d83c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "57699bb96a3e0670bdb7589ff331206ad5eaaa8da1753e11dcb5b9af9c11d83c", kill_on_drop: false }` [INFO] [stdout] 57699bb96a3e0670bdb7589ff331206ad5eaaa8da1753e11dcb5b9af9c11d83c [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 0e49c544badda8b434343f124c772ec5d6787e4f08ec61f637d97f44695390d3 [INFO] running `Command { std: "docker" "start" "-a" "0e49c544badda8b434343f124c772ec5d6787e4f08ec61f637d97f44695390d3", kill_on_drop: false }` [INFO] [stderr] Checking either v1.8.0 [INFO] [stderr] Checking regex-syntax v0.6.28 [INFO] [stderr] Checking aho-corasick v0.7.20 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking regex v1.7.0 [INFO] [stderr] Checking advent-of-code-2022 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/aoc_24.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | blizzard_history: blizzard_history, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `blizzard_history` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/aoc_24.rs:91:26 [INFO] [stdout] | [INFO] [stdout] 91 | .map(|d| (position + d)) [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 91 - .map(|d| (position + d)) [INFO] [stdout] 91 + .map(|d| position + d ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/aoc_24.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | blizzard_history: blizzard_history, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `blizzard_history` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/aoc_24.rs:91:26 [INFO] [stdout] | [INFO] [stdout] 91 | .map(|d| (position + d)) [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 91 - .map(|d| (position + d)) [INFO] [stdout] 91 + .map(|d| position + d ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> src/aoc_07/commands.rs:4:15 [INFO] [stdout] | [INFO] [stdout] 4 | File(u32, String), [INFO] [stdout] | ---- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ListDirectoryOutput` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 4 - File(u32, String), [INFO] [stdout] 4 + File(u32, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `print` is never used [INFO] [stdout] --> src/aoc_22/map.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 6 | pub trait MonkeyMap { [INFO] [stdout] | --------- method in this trait [INFO] [stdout] ... [INFO] [stdout] 10 | fn print(&self, position: &Position); [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/aoc_01.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 8 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/aoc_01.rs:27:20 [INFO] [stdout] | [INFO] [stdout] 27 | let best_elf = best_elves.unwrap().first().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*best_elves.unwrap().first().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: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:14:31 [INFO] [stdout] | [INFO] [stdout] 14 | ("A", "Z") => 0 + 3, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:15:31 [INFO] [stdout] | [INFO] [stdout] 15 | ("B", "X") => 0 + 1, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:19:31 [INFO] [stdout] | [INFO] [stdout] 19 | ("C", "Y") => 0 + 2, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:36:31 [INFO] [stdout] | [INFO] [stdout] 36 | ("A", "X") => 0 + 3, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:39:31 [INFO] [stdout] | [INFO] [stdout] 39 | ("B", "X") => 0 + 1, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:42:31 [INFO] [stdout] | [INFO] [stdout] 42 | ("C", "X") => 0 + 2, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_03.rs:56:33 [INFO] [stdout] | [INFO] [stdout] 56 | count += get_score_char(&int2.next().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `int2.next().unwrap()` [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/aoc_05.rs:13:44 [INFO] [stdout] | [INFO] [stdout] 13 | for (idx, cap) in re.captures_iter(&line).enumerate() { [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/aoc_05.rs:66:28 [INFO] [stdout] | [INFO] [stdout] 66 | fn get_last_crates(crates: &Vec>) -> 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 66 - fn get_last_crates(crates: &Vec>) -> String { [INFO] [stdout] 66 + fn get_last_crates(crates: &[Vec]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/aoc_05.rs:105:30 [INFO] [stdout] | [INFO] [stdout] 105 | let mut idx: usize = origin_stack.len().into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `origin_stack.len()` [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: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/aoc_06.rs:6:42 [INFO] [stdout] | [INFO] [stdout] 6 | let uniq_chars: HashSet<&char> = (&chars[i..i + length]).iter().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `chars[i..i + length]` [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: length comparison to zero [INFO] [stdout] --> src/aoc_07/commands.rs:21:16 [INFO] [stdout] | [INFO] [stdout] 21 | if ls_output.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ls_output.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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/aoc_07/commands.rs:39:38 [INFO] [stdout] | [INFO] [stdout] 39 | let file_size: u32 = line.split(" ").nth(0)?.parse().ok()?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `line.split(" ").next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/aoc_07/commands.rs:45:8 [INFO] [stdout] | [INFO] [stdout] 45 | if ls_output.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ls_output.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_07/directories.rs:52:48 [INFO] [stdout] | [INFO] [stdout] 52 | .map(|d| d.get_total_of_dirs_below(&max)) [INFO] [stdout] | ^^^^ help: change this to: `max` [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/aoc_07/directories.rs:76:65 [INFO] [stdout] | [INFO] [stdout] 76 | .filter_map(|d| d.get_smallest_dir_greater_than_min(&min)) [INFO] [stdout] | ^^^^ help: change this to: `min` [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: using `clone` on type `u32` which implements the `Copy` trait [INFO] [stdout] --> src/aoc_07.rs:47:50 [INFO] [stdout] | [INFO] [stdout] 47 | ... current.add_file(size.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*size` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/aoc_08.rs:7:31 [INFO] [stdout] | [INFO] [stdout] 7 | fn blocking_tree_north(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 7 - fn blocking_tree_north(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] 7 + fn blocking_tree_north(trees: &[Vec], i: usize, j: usize) -> Option<(usize, usize)> { [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/aoc_08.rs:19:30 [INFO] [stdout] | [INFO] [stdout] 19 | fn blocking_tree_west(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 19 - fn blocking_tree_west(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] 19 + fn blocking_tree_west(trees: &[Vec], i: usize, j: usize) -> Option<(usize, usize)> { [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/aoc_08.rs:31:31 [INFO] [stdout] | [INFO] [stdout] 31 | fn blocking_tree_south(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 31 - fn blocking_tree_south(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] 31 + fn blocking_tree_south(trees: &[Vec], i: usize, j: usize) -> Option<(usize, usize)> { [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/aoc_08.rs:44:30 [INFO] [stdout] | [INFO] [stdout] 44 | fn blocking_tree_east(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - fn blocking_tree_east(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] 44 + fn blocking_tree_east(trees: &[Vec], i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_09.rs:74:43 [INFO] [stdout] | [INFO] [stdout] 74 | let displacement = other.distance(&self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_09.rs:100:39 [INFO] [stdout] | [INFO] [stdout] 100 | self.head = self.head.add(&direction); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `direction` [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: calls to `push` immediately after creation [INFO] [stdout] --> src/aoc_10.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | / let mut history = Vec::new(); [INFO] [stdout] 35 | | history.push(1); [INFO] [stdout] | |________________________^ help: consider using the `vec![]` macro: `let history = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/aoc_10.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | result.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `result.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_11/monkeys.rs:105:17 [INFO] [stdout] | [INFO] [stdout] 105 | item = item / 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `item /= 3` [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: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_11/monkeys.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | item = item % modulo; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `item %= modulo` [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 `.is_multiple_of()` [INFO] [stdout] --> src/aoc_11/monkeys.rs:112:31 [INFO] [stdout] | [INFO] [stdout] 112 | let test_result = item % self.test_divisor == 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `item.is_multiple_of(self.test_divisor)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_11.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | monkey_business = monkey_business * inspection_counts.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `monkey_business *= inspection_counts.pop().unwrap()` [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/aoc_11.rs:46:5 [INFO] [stdout] | [INFO] [stdout] 46 | monkey_business = monkey_business * inspection_counts.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `monkey_business *= inspection_counts.pop().unwrap()` [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/aoc_12.rs:13:32 [INFO] [stdout] | [INFO] [stdout] 13 | fn get_neighbours(heights: &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] 13 - fn get_neighbours(heights: &Vec>) -> Vec>> { [INFO] [stdout] 13 + fn get_neighbours(heights: &[Vec]) -> Vec>> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/aoc_12.rs:89:36 [INFO] [stdout] | [INFO] [stdout] 89 | locations_to_try.push_back(self.end.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.end` [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: binary comparison to literal `Option::None` [INFO] [stdout] --> src/aoc_12.rs:99:20 [INFO] [stdout] | [INFO] [stdout] 99 | if distances[*p][*q] == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `distances[*p][*q].is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/aoc_13/signal.rs:11:19 [INFO] [stdout] | [INFO] [stdout] 11 | fn parse_next<'a>(s: &'a str) -> Option<(SignalToken, &'a str)> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 11 - fn parse_next<'a>(s: &'a str) -> Option<(SignalToken, &'a str)> { [INFO] [stdout] 11 + fn parse_next(s: &str) -> Option<(SignalToken, &str)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/aoc_13/signal.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 12 | if s.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/aoc_13/signal.rs:21:27 [INFO] [stdout] | [INFO] [stdout] 21 | .find(|x| x == '[' || x == ']' || x == ',') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']', ',']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/aoc_13/signal.rs:23:32 [INFO] [stdout] | [INFO] [stdout] 23 | let int: u32 = (&s[0..idx]).parse().ok()?; [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `s[0..idx]` [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: length comparison to zero [INFO] [stdout] --> src/aoc_13/signal.rs:35:15 [INFO] [stdout] | [INFO] [stdout] 35 | while s.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/aoc_13.rs:32:21 [INFO] [stdout] | [INFO] [stdout] 32 | .filter(|x| x != "") [INFO] [stdout] | ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_14.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | return None; [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] 83 - return None; [INFO] [stdout] 83 + None [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/aoc_15.rs:39:44 [INFO] [stdout] | [INFO] [stdout] 39 | fn count_beaconless_in_row(sensor_beacons: &Vec, row: i32) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - fn count_beaconless_in_row(sensor_beacons: &Vec, row: i32) -> usize { [INFO] [stdout] 39 + fn count_beaconless_in_row(sensor_beacons: &[Sensor], row: i32) -> usize { [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/aoc_15.rs:66:43 [INFO] [stdout] | [INFO] [stdout] 66 | fn find_beaconless_in_row(sensor_beacons: &Vec, row: i32, max: i32) -> 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] 66 - fn find_beaconless_in_row(sensor_beacons: &Vec, row: i32, max: i32) -> Option { [INFO] [stdout] 66 + fn find_beaconless_in_row(sensor_beacons: &[Sensor], row: i32, max: i32) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `idx` is only used to index `ranges_in_row` [INFO] [stdout] --> src/aoc_15.rs:81:16 [INFO] [stdout] | [INFO] [stdout] 81 | for idx in 1..last_idx { [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] 81 - for idx in 1..last_idx { [INFO] [stdout] 81 + for in ranges_in_row.iter().take(last_idx).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_15.rs:92:51 [INFO] [stdout] | [INFO] [stdout] 92 | if let Some(col) = find_beaconless_in_row(&sensors, row, max) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `sensors` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/aoc_16/volcano.rs:61:6 [INFO] [stdout] | [INFO] [stdout] 61 | ) -> Result<(HashMap, HashMap>), Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/aoc_16/volcano.rs:89:20 [INFO] [stdout] | [INFO] [stdout] 89 | if distance_to_start_map.get(neighbour) == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `distance_to_start_map.get(neighbour).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/aoc_16/volcano.rs:131:52 [INFO] [stdout] | [INFO] [stdout] 131 | let non_trivial_nodes = HashSet::from_iter(non_trivial_flows.keys().map(|x| *x)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `non_trivial_flows.keys().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_17.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | self.coords[idx].0 = self.coords[idx].0 + direction.0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.coords[idx].0 += direction.0` [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/aoc_17.rs:92:13 [INFO] [stdout] | [INFO] [stdout] 92 | self.coords[idx].1 = self.coords[idx].1 + direction.1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.coords[idx].1 += direction.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: empty string literal in `println!` [INFO] [stdout] --> src/aoc_17.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_17.rs:175:9 [INFO] [stdout] | [INFO] [stdout] 175 | return height_gained; [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] 175 - return height_gained; [INFO] [stdout] 175 + height_gained [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/aoc_17.rs:240:30 [INFO] [stdout] | [INFO] [stdout] 240 | let mut chamber_history: Vec<(usize, usize, HashSet<(i32, i32)>, i32)> = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/aoc_17.rs:251:35 [INFO] [stdout] | [INFO] [stdout] 251 | last_occurrence.3.try_into().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `i32` to `i64` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 251 - last_occurrence.3.try_into().unwrap(), [INFO] [stdout] 251 + last_occurrence.3.into(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/aoc_17.rs:252:33 [INFO] [stdout] | [INFO] [stdout] 252 | chamber.highest.try_into().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `i32` to `i64` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 252 - chamber.highest.try_into().unwrap(), [INFO] [stdout] 252 + chamber.highest.into(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | Coord(&self.0 + 1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:29:45 [INFO] [stdout] | [INFO] [stdout] 29 | Coord(&self.0 + 1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/aoc_18.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | Coord(&self.0 + -1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | -------^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:30:33 [INFO] [stdout] | [INFO] [stdout] 30 | Coord(&self.0 + -1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:30:46 [INFO] [stdout] | [INFO] [stdout] 30 | Coord(&self.0 + -1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:31:19 [INFO] [stdout] | [INFO] [stdout] 31 | Coord(&self.0 + 0, &self.1 + 1, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:31:45 [INFO] [stdout] | [INFO] [stdout] 31 | Coord(&self.0 + 0, &self.1 + 1, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:32:19 [INFO] [stdout] | [INFO] [stdout] 32 | Coord(&self.0 + 0, &self.1 + -1, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/aoc_18.rs:32:32 [INFO] [stdout] | [INFO] [stdout] 32 | Coord(&self.0 + 0, &self.1 + -1, &self.2 + 0), [INFO] [stdout] | -------^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:32:46 [INFO] [stdout] | [INFO] [stdout] 32 | Coord(&self.0 + 0, &self.1 + -1, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:33:19 [INFO] [stdout] | [INFO] [stdout] 33 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + 1), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:33:32 [INFO] [stdout] | [INFO] [stdout] 33 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + 1), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:34:19 [INFO] [stdout] | [INFO] [stdout] 34 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + -1), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:34:32 [INFO] [stdout] | [INFO] [stdout] 34 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + -1), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/aoc_18.rs:34:45 [INFO] [stdout] | [INFO] [stdout] 34 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + -1), [INFO] [stdout] | -------^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/aoc_19/blueprint.rs:18:34 [INFO] [stdout] | [INFO] [stdout] 18 | let material = match caps.name("material").and_then(|x| Some(x.as_str())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `caps.name("material").map(|x| x.as_str())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/aoc_19/factory_state.rs:19:24 [INFO] [stdout] | [INFO] [stdout] 19 | str_.push_str(&format!("Resources:\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Resources:\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/aoc_19/factory_state.rs:24:24 [INFO] [stdout] | [INFO] [stdout] 24 | str_.push_str(&format!("Robots:\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Robots:\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/aoc_19/factory_state.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | let required_turns_for_resource: usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `required_turns_for_resource` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 59 ~ [INFO] [stdout] 60 | let missing_resources = cost_amount - &self.resources[&cost_material]; [INFO] [stdout] ... [INFO] [stdout] 65 | } [INFO] [stdout] 66 ~ let required_turns_for_resource: usize = if missing_resources <= 0 { [INFO] [stdout] 67 ~ 0 [INFO] [stdout] 68 | } else { [INFO] [stdout] 69 ~ (missing_resources / production_rate [INFO] [stdout] 70 | + (if missing_resources % production_rate != 0 { [INFO] [stdout] ... [INFO] [stdout] 73 | 0 [INFO] [stdout] 74 ~ })) as usize [INFO] [stdout] 75 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/aoc_19/factory_state.rs:60:37 [INFO] [stdout] | [INFO] [stdout] 60 | let missing_resources = cost_amount - &self.resources[&cost_material]; [INFO] [stdout] | ^^^^^^^^^^^^^^------------------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `self.resources[&cost_material]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_19/factory_state.rs:60:67 [INFO] [stdout] | [INFO] [stdout] 60 | let missing_resources = cost_amount - &self.resources[&cost_material]; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `cost_material` [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/aoc_19/factory_state.rs:61:47 [INFO] [stdout] | [INFO] [stdout] 61 | let production_rate = self.robots[&cost_material]; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `cost_material` [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/aoc_19/factory_state.rs:86:74 [INFO] [stdout] | [INFO] [stdout] 86 | let material_cost = new_factory.blueprint.robot_costs[robot][&robot_material]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `robot_material` [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/aoc_19/factory_state.rs:88:35 [INFO] [stdout] | [INFO] [stdout] 88 | new_factory.resources[&robot_material] += [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `robot_material` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_19/factory_state.rs:124:9 [INFO] [stdout] | [INFO] [stdout] 124 | return state.resources[&Material::Geode] + self.robots[&Material::Geode]; [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] 124 - return state.resources[&Material::Geode] + self.robots[&Material::Geode]; [INFO] [stdout] 124 + state.resources[&Material::Geode] + self.robots[&Material::Geode] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/aoc_19/factory_state.rs:129:76 [INFO] [stdout] | [INFO] [stdout] 129 | self.resources[&Material::Geode] + self.robots[&Material::Geode] * remaining_turns as i32 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `remaining_turns` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_19.rs:24:74 [INFO] [stdout] | [INFO] [stdout] 24 | if let Some(next_state) = factory_states[l - 1].build_next_robot(&material) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `material` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/aoc_20.rs:5:19 [INFO] [stdout] | [INFO] [stdout] 5 | fn shift(numbers: &mut Vec<(usize, i64)>, og_idx: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - fn shift(numbers: &mut Vec<(usize, i64)>, og_idx: usize) { [INFO] [stdout] 5 + fn shift(numbers: &mut [(usize, i64)], og_idx: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_21.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | return Some(instruction.parse().expect("Could not parse integer")); [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] 72 - return Some(instruction.parse().expect("Could not parse integer")); [INFO] [stdout] 72 + Some(instruction.parse().expect("Could not parse integer")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/aoc_21.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | *self.call.borrow() != None [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `(*self.call.borrow()).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_21.rs:93:9 [INFO] [stdout] | [INFO] [stdout] 93 | / return Monkey { [INFO] [stdout] 94 | | name: name.into(), [INFO] [stdout] 95 | | instruction, [INFO] [stdout] 96 | | call: RefCell::new(call), [INFO] [stdout] 97 | | }; [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] 93 ~ Monkey { [INFO] [stdout] 94 + name: name.into(), [INFO] [stdout] 95 + instruction, [INFO] [stdout] 96 + call: RefCell::new(call), [INFO] [stdout] 97 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/aoc_21.rs:134:32 [INFO] [stdout] | [INFO] [stdout] 134 | monkey.resolve(match op { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 135 | | &Operation::Add => monkey_1.value() + monkey_2.value(), [INFO] [stdout] 136 | | &Operation::Subtract => monkey_1.value() - monkey_2.value(), [INFO] [stdout] 137 | | &Operation::Multiply => monkey_1.value() * monkey_2.value(), [INFO] [stdout] 138 | | &Operation::Divide => monkey_1.value() / monkey_2.value(), [INFO] [stdout] 139 | | }); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 134 ~ monkey.resolve(match *op { [INFO] [stdout] 135 ~ Operation::Add => monkey_1.value() + monkey_2.value(), [INFO] [stdout] 136 ~ Operation::Subtract => monkey_1.value() - monkey_2.value(), [INFO] [stdout] 137 ~ Operation::Multiply => monkey_1.value() * monkey_2.value(), [INFO] [stdout] 138 ~ Operation::Divide => monkey_1.value() / monkey_2.value(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_21.rs:209:17 [INFO] [stdout] | [INFO] [stdout] 209 | required_value = required_value * other_monkey_value; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `required_value *= other_monkey_value` [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/aoc_22/cubic_map.rs:27:26 [INFO] [stdout] | [INFO] [stdout] 27 | fn get_face_coords(grid: &Vec>) -> (Vec<(usize, usize, Position)>, usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 27 - fn get_face_coords(grid: &Vec>) -> (Vec<(usize, usize, Position)>, usize) { [INFO] [stdout] 27 + fn get_face_coords(grid: &[Vec]) -> (Vec<(usize, usize, Position)>, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to both the expression and the patterns [INFO] [stdout] --> src/aoc_22/cubic_map.rs:229:48 [INFO] [stdout] | [INFO] [stdout] 229 | let distance_from_corner_on_left = match &orientation { [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 230 | | &NORTH => position.1 - origin_face_top_left.1, [INFO] [stdout] 231 | | &EAST => position.0 - origin_face_top_left.0, [INFO] [stdout] 232 | | &SOUTH => self.face_width - 1 - (position.1 - origin_face_top_left.1), [INFO] [stdout] 233 | | &WEST => self.face_width - 1 - (position.0 - origin_face_top_left.0), [INFO] [stdout] 234 | | _ => panic!("Unexpected direction"), [INFO] [stdout] 235 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 229 ~ let distance_from_corner_on_left = match orientation { [INFO] [stdout] 230 ~ NORTH => position.1 - origin_face_top_left.1, [INFO] [stdout] 231 ~ EAST => position.0 - origin_face_top_left.0, [INFO] [stdout] 232 ~ SOUTH => self.face_width - 1 - (position.1 - origin_face_top_left.1), [INFO] [stdout] 233 ~ WEST => self.face_width - 1 - (position.0 - origin_face_top_left.0), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/aoc_22/cubic_map.rs:242:29 [INFO] [stdout] | [INFO] [stdout] 242 | next_position = match destination_orientation { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 243 | | &NORTH => Position( [INFO] [stdout] 244 | | destination_face_top_left.0 + self.face_width - 1, [INFO] [stdout] 245 | | destination_face_top_left.1 + distance_from_corner_on_left, [INFO] [stdout] ... | [INFO] [stdout] 263 | | _ => panic!("Unexpected direction"), [INFO] [stdout] 264 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 242 ~ next_position = match *destination_orientation { [INFO] [stdout] 243 ~ NORTH => Position( [INFO] [stdout] 244 | destination_face_top_left.0 + self.face_width - 1, [INFO] [stdout] 245 | destination_face_top_left.1 + distance_from_corner_on_left, [INFO] [stdout] 246 | ), [INFO] [stdout] 247 ~ EAST => Position( [INFO] [stdout] 248 | destination_face_top_left.0 + distance_from_corner_on_left, [INFO] [stdout] 249 | destination_face_top_left.1, [INFO] [stdout] 250 | ), [INFO] [stdout] 251 ~ SOUTH => Position( [INFO] [stdout] 252 | destination_face_top_left.0, [INFO] [stdout] ... [INFO] [stdout] 256 | ), [INFO] [stdout] 257 ~ WEST => Position( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_22/cubic_map.rs:277:32 [INFO] [stdout] | [INFO] [stdout] 277 | print_grid(&self.grid, &position); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `position` [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: the loop variable `i` is only used to index `grid` [INFO] [stdout] --> src/aoc_22/grid.rs:30:14 [INFO] [stdout] | [INFO] [stdout] 30 | 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] 30 - for i in 0..grid.len() { [INFO] [stdout] 30 + for in &mut grid { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/aoc_22/grid.rs:32:15 [INFO] [stdout] | [INFO] [stdout] 32 | while &grid[i].len() < &max_row_length { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 32 - while &grid[i].len() < &max_row_length { [INFO] [stdout] 32 + while grid[i].len() < max_row_length { [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/aoc_22/grid.rs:39:24 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn get_start(grid: &Vec>) -> Position { [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] 39 - pub fn get_start(grid: &Vec>) -> Position { [INFO] [stdout] 39 + pub fn get_start(grid: &[Vec]) -> Position { [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/aoc_22/grid.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | pub fn print_grid(grid: &Vec>, position: &Position) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 45 - pub fn print_grid(grid: &Vec>, position: &Position) { [INFO] [stdout] 45 + pub fn print_grid(grid: &[Vec], position: &Position) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/aoc_22/grid.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 61 - print!("\n"); [INFO] [stdout] 61 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/aoc_22/instruction.rs:22:27 [INFO] [stdout] | [INFO] [stdout] 22 | .find(|c| c == 'L' || c == 'R') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['L', 'R']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/aoc_22/instruction.rs:21:27 [INFO] [stdout] | [INFO] [stdout] 21 | let end = (&input[idx..]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `input[idx..]` [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/aoc_22/toroidal_map.rs:44:32 [INFO] [stdout] | [INFO] [stdout] 44 | print_grid(&self.grid, &position); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `position` [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: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/aoc_23.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 87 - print!("\n"); [INFO] [stdout] 87 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/aoc_23.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 89 - print!("\n"); [INFO] [stdout] 89 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/aoc_23.rs:103:13 [INFO] [stdout] | [INFO] [stdout] 103 | / !ALL_DIRECTIONS [INFO] [stdout] 104 | | .into_iter() [INFO] [stdout] 105 | | .find(|d| self.elves.contains(&(**elf + *d))) [INFO] [stdout] 106 | | .is_none() [INFO] [stdout] | |__________________________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 103 ~ ALL_DIRECTIONS [INFO] [stdout] 104 + .into_iter() [INFO] [stdout] 105 + .find(|d| self.elves.contains(&(**elf + *d))).is_some() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/aoc_23.rs:120:17 [INFO] [stdout] | [INFO] [stdout] 120 | / if inverse_elf_intentions.contains_key(&elf_intention) { [INFO] [stdout] 121 | | // There's more than one elf trying to go to the same position; remove the existing one. [INFO] [stdout] 122 | | let elf = inverse_elf_intentions.remove(&elf_intention).unwrap(); [INFO] [stdout] 123 | | elf_intentions.remove(elf); [INFO] [stdout] ... | [INFO] [stdout] 126 | | inverse_elf_intentions.insert(elf_intention, elf); [INFO] [stdout] 127 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 120 ~ if let std::collections::hash_map::Entry::Vacant(e) = inverse_elf_intentions.entry(elf_intention) { [INFO] [stdout] 121 + elf_intentions.insert(elf, elf_intention); [INFO] [stdout] 122 + e.insert(elf); [INFO] [stdout] 123 + } else { [INFO] [stdout] 124 + // There's more than one elf trying to go to the same position; remove the existing one. [INFO] [stdout] 125 + let elf = inverse_elf_intentions.remove(&elf_intention).unwrap(); [INFO] [stdout] 126 + elf_intentions.remove(elf); [INFO] [stdout] 127 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/aoc_25.rs:45:55 [INFO] [stdout] | [INFO] [stdout] 45 | let str = String::from_iter(self.0.iter().map(|s| char::from(s))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `char::from` [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/aoc_25.rs:58:42 [INFO] [stdout] | [INFO] [stdout] 58 | String::from_iter(s.0.iter().map(|d| char::from(d))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `char::from` [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: useless use of `vec!` [INFO] [stdout] --> src/aoc_07/directories.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | vec![dir_size_greater_than_min, smallest_subdir_greater_than_min] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[dir_size_greater_than_min, smallest_subdir_greater_than_min]` [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: for loop over an `Option`. This is more readably written as an `if let` statement [INFO] [stdout] --> src/aoc_02.rs:6:29 [INFO] [stdout] | [INFO] [stdout] 6 | for (str1, str2) in line.split_once(" ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(for_loops_over_fallibles)]` on by default [INFO] [stdout] help: to check pattern in a loop use `while let` [INFO] [stdout] | [INFO] [stdout] 6 - for (str1, str2) in line.split_once(" ") { [INFO] [stdout] 6 + while let Some((str1, str2)) = line.split_once(" ") { [INFO] [stdout] | [INFO] [stdout] help: consider using `if let` to clear intent [INFO] [stdout] | [INFO] [stdout] 6 - for (str1, str2) in line.split_once(" ") { [INFO] [stdout] 6 + if let Some((str1, str2)) = line.split_once(" ") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: for loop over an `Option`. This is more readably written as an `if let` statement [INFO] [stdout] --> src/aoc_02.rs:32:29 [INFO] [stdout] | [INFO] [stdout] 32 | for (str1, str2) in line.split_once(" ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: to check pattern in a loop use `while let` [INFO] [stdout] | [INFO] [stdout] 32 - for (str1, str2) in line.split_once(" ") { [INFO] [stdout] 32 + while let Some((str1, str2)) = line.split_once(" ") { [INFO] [stdout] | [INFO] [stdout] help: consider using `if let` to clear intent [INFO] [stdout] | [INFO] [stdout] 32 - for (str1, str2) in line.split_once(" ") { [INFO] [stdout] 32 + if let Some((str1, str2)) = line.split_once(" ") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> src/aoc_07/commands.rs:4:15 [INFO] [stdout] | [INFO] [stdout] 4 | File(u32, String), [INFO] [stdout] | ---- ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ListDirectoryOutput` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 4 - File(u32, String), [INFO] [stdout] 4 + File(u32, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `print` is never used [INFO] [stdout] --> src/aoc_22/map.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 6 | pub trait MonkeyMap { [INFO] [stdout] | --------- method in this trait [INFO] [stdout] ... [INFO] [stdout] 10 | fn print(&self, position: &Position); [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/aoc_01.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 8 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> src/aoc_01.rs:27:20 [INFO] [stdout] | [INFO] [stdout] 27 | let best_elf = best_elves.unwrap().first().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*best_elves.unwrap().first().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: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:14:31 [INFO] [stdout] | [INFO] [stdout] 14 | ("A", "Z") => 0 + 3, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:15:31 [INFO] [stdout] | [INFO] [stdout] 15 | ("B", "X") => 0 + 1, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:19:31 [INFO] [stdout] | [INFO] [stdout] 19 | ("C", "Y") => 0 + 2, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:36:31 [INFO] [stdout] | [INFO] [stdout] 36 | ("A", "X") => 0 + 3, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:39:31 [INFO] [stdout] | [INFO] [stdout] 39 | ("B", "X") => 0 + 1, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_02.rs:42:31 [INFO] [stdout] | [INFO] [stdout] 42 | ("C", "X") => 0 + 2, [INFO] [stdout] | ^^^^^ help: consider reducing it to: `2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_03.rs:56:33 [INFO] [stdout] | [INFO] [stdout] 56 | count += get_score_char(&int2.next().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `int2.next().unwrap()` [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/aoc_05.rs:13:44 [INFO] [stdout] | [INFO] [stdout] 13 | for (idx, cap) in re.captures_iter(&line).enumerate() { [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/aoc_05.rs:66:28 [INFO] [stdout] | [INFO] [stdout] 66 | fn get_last_crates(crates: &Vec>) -> 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 66 - fn get_last_crates(crates: &Vec>) -> String { [INFO] [stdout] 66 + fn get_last_crates(crates: &[Vec]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/aoc_05.rs:105:30 [INFO] [stdout] | [INFO] [stdout] 105 | let mut idx: usize = origin_stack.len().into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `origin_stack.len()` [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: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/aoc_06.rs:6:42 [INFO] [stdout] | [INFO] [stdout] 6 | let uniq_chars: HashSet<&char> = (&chars[i..i + length]).iter().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `chars[i..i + length]` [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: length comparison to zero [INFO] [stdout] --> src/aoc_07/commands.rs:21:16 [INFO] [stdout] | [INFO] [stdout] 21 | if ls_output.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ls_output.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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/aoc_07/commands.rs:39:38 [INFO] [stdout] | [INFO] [stdout] 39 | let file_size: u32 = line.split(" ").nth(0)?.parse().ok()?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `line.split(" ").next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/aoc_07/commands.rs:45:8 [INFO] [stdout] | [INFO] [stdout] 45 | if ls_output.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ls_output.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_07/directories.rs:52:48 [INFO] [stdout] | [INFO] [stdout] 52 | .map(|d| d.get_total_of_dirs_below(&max)) [INFO] [stdout] | ^^^^ help: change this to: `max` [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/aoc_07/directories.rs:76:65 [INFO] [stdout] | [INFO] [stdout] 76 | .filter_map(|d| d.get_smallest_dir_greater_than_min(&min)) [INFO] [stdout] | ^^^^ help: change this to: `min` [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: using `clone` on type `u32` which implements the `Copy` trait [INFO] [stdout] --> src/aoc_07.rs:47:50 [INFO] [stdout] | [INFO] [stdout] 47 | ... current.add_file(size.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*size` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/aoc_08.rs:7:31 [INFO] [stdout] | [INFO] [stdout] 7 | fn blocking_tree_north(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 7 - fn blocking_tree_north(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] 7 + fn blocking_tree_north(trees: &[Vec], i: usize, j: usize) -> Option<(usize, usize)> { [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/aoc_08.rs:19:30 [INFO] [stdout] | [INFO] [stdout] 19 | fn blocking_tree_west(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 19 - fn blocking_tree_west(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] 19 + fn blocking_tree_west(trees: &[Vec], i: usize, j: usize) -> Option<(usize, usize)> { [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/aoc_08.rs:31:31 [INFO] [stdout] | [INFO] [stdout] 31 | fn blocking_tree_south(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 31 - fn blocking_tree_south(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] 31 + fn blocking_tree_south(trees: &[Vec], i: usize, j: usize) -> Option<(usize, usize)> { [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/aoc_08.rs:44:30 [INFO] [stdout] | [INFO] [stdout] 44 | fn blocking_tree_east(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - fn blocking_tree_east(trees: &Vec>, i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] 44 + fn blocking_tree_east(trees: &[Vec], i: usize, j: usize) -> Option<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_09.rs:74:43 [INFO] [stdout] | [INFO] [stdout] 74 | let displacement = other.distance(&self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_09.rs:100:39 [INFO] [stdout] | [INFO] [stdout] 100 | self.head = self.head.add(&direction); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `direction` [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: calls to `push` immediately after creation [INFO] [stdout] --> src/aoc_10.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | / let mut history = Vec::new(); [INFO] [stdout] 35 | | history.push(1); [INFO] [stdout] | |________________________^ help: consider using the `vec![]` macro: `let history = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/aoc_10.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | result.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `result.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_11/monkeys.rs:105:17 [INFO] [stdout] | [INFO] [stdout] 105 | item = item / 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `item /= 3` [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: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_11/monkeys.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | item = item % modulo; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `item %= modulo` [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 `.is_multiple_of()` [INFO] [stdout] --> src/aoc_11/monkeys.rs:112:31 [INFO] [stdout] | [INFO] [stdout] 112 | let test_result = item % self.test_divisor == 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `item.is_multiple_of(self.test_divisor)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_11.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | monkey_business = monkey_business * inspection_counts.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `monkey_business *= inspection_counts.pop().unwrap()` [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/aoc_11.rs:46:5 [INFO] [stdout] | [INFO] [stdout] 46 | monkey_business = monkey_business * inspection_counts.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `monkey_business *= inspection_counts.pop().unwrap()` [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/aoc_12.rs:13:32 [INFO] [stdout] | [INFO] [stdout] 13 | fn get_neighbours(heights: &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] 13 - fn get_neighbours(heights: &Vec>) -> Vec>> { [INFO] [stdout] 13 + fn get_neighbours(heights: &[Vec]) -> Vec>> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/aoc_12.rs:89:36 [INFO] [stdout] | [INFO] [stdout] 89 | locations_to_try.push_back(self.end.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.end` [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: binary comparison to literal `Option::None` [INFO] [stdout] --> src/aoc_12.rs:99:20 [INFO] [stdout] | [INFO] [stdout] 99 | if distances[*p][*q] == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `distances[*p][*q].is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/aoc_13/signal.rs:11:19 [INFO] [stdout] | [INFO] [stdout] 11 | fn parse_next<'a>(s: &'a str) -> Option<(SignalToken, &'a str)> { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 11 - fn parse_next<'a>(s: &'a str) -> Option<(SignalToken, &'a str)> { [INFO] [stdout] 11 + fn parse_next(s: &str) -> Option<(SignalToken, &str)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/aoc_13/signal.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 12 | if s.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/aoc_13/signal.rs:21:27 [INFO] [stdout] | [INFO] [stdout] 21 | .find(|x| x == '[' || x == ']' || x == ',') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']', ',']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/aoc_13/signal.rs:23:32 [INFO] [stdout] | [INFO] [stdout] 23 | let int: u32 = (&s[0..idx]).parse().ok()?; [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `s[0..idx]` [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: length comparison to zero [INFO] [stdout] --> src/aoc_13/signal.rs:35:15 [INFO] [stdout] | [INFO] [stdout] 35 | while s.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_13/signal.rs:282:9 [INFO] [stdout] | [INFO] [stdout] 282 | assert_eq!(x < y, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 282 - assert_eq!(x < y, true); [INFO] [stdout] 282 + assert!(x < y); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_13/signal.rs:283:9 [INFO] [stdout] | [INFO] [stdout] 283 | assert_eq!(y < x, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 283 - assert_eq!(y < x, false); [INFO] [stdout] 283 + assert!(!(y < x)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_13/signal.rs:290:9 [INFO] [stdout] | [INFO] [stdout] 290 | assert_eq!(x < y, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 290 - assert_eq!(x < y, true); [INFO] [stdout] 290 + assert!(x < y); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_13/signal.rs:291:9 [INFO] [stdout] | [INFO] [stdout] 291 | assert_eq!(y < x, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 291 - assert_eq!(y < x, false); [INFO] [stdout] 291 + assert!(!(y < x)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_13/signal.rs:298:9 [INFO] [stdout] | [INFO] [stdout] 298 | assert_eq!(x < y, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 298 - assert_eq!(x < y, true); [INFO] [stdout] 298 + assert!(x < y); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_13/signal.rs:299:9 [INFO] [stdout] | [INFO] [stdout] 299 | assert_eq!(y < x, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 299 - assert_eq!(y < x, false); [INFO] [stdout] 299 + assert!(!(y < x)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_13/signal.rs:306:9 [INFO] [stdout] | [INFO] [stdout] 306 | assert_eq!(x < y, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 306 - assert_eq!(x < y, true); [INFO] [stdout] 306 + assert!(x < y); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_13/signal.rs:307:9 [INFO] [stdout] | [INFO] [stdout] 307 | assert_eq!(y < x, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 307 - assert_eq!(y < x, false); [INFO] [stdout] 307 + assert!(!(y < x)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/aoc_13.rs:32:21 [INFO] [stdout] | [INFO] [stdout] 32 | .filter(|x| x != "") [INFO] [stdout] | ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_14.rs:83:9 [INFO] [stdout] | [INFO] [stdout] 83 | return None; [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] 83 - return None; [INFO] [stdout] 83 + None [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/aoc_15.rs:39:44 [INFO] [stdout] | [INFO] [stdout] 39 | fn count_beaconless_in_row(sensor_beacons: &Vec, row: i32) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - fn count_beaconless_in_row(sensor_beacons: &Vec, row: i32) -> usize { [INFO] [stdout] 39 + fn count_beaconless_in_row(sensor_beacons: &[Sensor], row: i32) -> usize { [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/aoc_15.rs:66:43 [INFO] [stdout] | [INFO] [stdout] 66 | fn find_beaconless_in_row(sensor_beacons: &Vec, row: i32, max: i32) -> 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] 66 - fn find_beaconless_in_row(sensor_beacons: &Vec, row: i32, max: i32) -> Option { [INFO] [stdout] 66 + fn find_beaconless_in_row(sensor_beacons: &[Sensor], row: i32, max: i32) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `idx` is only used to index `ranges_in_row` [INFO] [stdout] --> src/aoc_15.rs:81:16 [INFO] [stdout] | [INFO] [stdout] 81 | for idx in 1..last_idx { [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] 81 - for idx in 1..last_idx { [INFO] [stdout] 81 + for in ranges_in_row.iter().take(last_idx).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_15.rs:92:51 [INFO] [stdout] | [INFO] [stdout] 92 | if let Some(col) = find_beaconless_in_row(&sensors, row, max) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `sensors` [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/aoc_15.rs:156:29 [INFO] [stdout] | [INFO] [stdout] 156 | .map(|x| parse_line(&x).unwrap()) [INFO] [stdout] | ^^ help: change this to: `x` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/aoc_16/volcano.rs:61:6 [INFO] [stdout] | [INFO] [stdout] 61 | ) -> Result<(HashMap, HashMap>), Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/aoc_16/volcano.rs:89:20 [INFO] [stdout] | [INFO] [stdout] 89 | if distance_to_start_map.get(neighbour) == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `distance_to_start_map.get(neighbour).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/aoc_16/volcano.rs:131:52 [INFO] [stdout] | [INFO] [stdout] 131 | let non_trivial_nodes = HashSet::from_iter(non_trivial_flows.keys().map(|x| *x)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `non_trivial_flows.keys().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_17.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | self.coords[idx].0 = self.coords[idx].0 + direction.0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.coords[idx].0 += direction.0` [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/aoc_17.rs:92:13 [INFO] [stdout] | [INFO] [stdout] 92 | self.coords[idx].1 = self.coords[idx].1 + direction.1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.coords[idx].1 += direction.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: empty string literal in `println!` [INFO] [stdout] --> src/aoc_17.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_17.rs:175:9 [INFO] [stdout] | [INFO] [stdout] 175 | return height_gained; [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] 175 - return height_gained; [INFO] [stdout] 175 + height_gained [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/aoc_17.rs:240:30 [INFO] [stdout] | [INFO] [stdout] 240 | let mut chamber_history: Vec<(usize, usize, HashSet<(i32, i32)>, i32)> = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/aoc_17.rs:251:35 [INFO] [stdout] | [INFO] [stdout] 251 | last_occurrence.3.try_into().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `i32` to `i64` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 251 - last_occurrence.3.try_into().unwrap(), [INFO] [stdout] 251 + last_occurrence.3.into(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/aoc_17.rs:252:33 [INFO] [stdout] | [INFO] [stdout] 252 | chamber.highest.try_into().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `i32` to `i64` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 252 - chamber.highest.try_into().unwrap(), [INFO] [stdout] 252 + chamber.highest.into(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | Coord(&self.0 + 1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:29:45 [INFO] [stdout] | [INFO] [stdout] 29 | Coord(&self.0 + 1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/aoc_18.rs:30:19 [INFO] [stdout] | [INFO] [stdout] 30 | Coord(&self.0 + -1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | -------^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:30:33 [INFO] [stdout] | [INFO] [stdout] 30 | Coord(&self.0 + -1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:30:46 [INFO] [stdout] | [INFO] [stdout] 30 | Coord(&self.0 + -1, &self.1 + 0, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:31:19 [INFO] [stdout] | [INFO] [stdout] 31 | Coord(&self.0 + 0, &self.1 + 1, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:31:45 [INFO] [stdout] | [INFO] [stdout] 31 | Coord(&self.0 + 0, &self.1 + 1, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:32:19 [INFO] [stdout] | [INFO] [stdout] 32 | Coord(&self.0 + 0, &self.1 + -1, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/aoc_18.rs:32:32 [INFO] [stdout] | [INFO] [stdout] 32 | Coord(&self.0 + 0, &self.1 + -1, &self.2 + 0), [INFO] [stdout] | -------^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:32:46 [INFO] [stdout] | [INFO] [stdout] 32 | Coord(&self.0 + 0, &self.1 + -1, &self.2 + 0), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:33:19 [INFO] [stdout] | [INFO] [stdout] 33 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + 1), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:33:32 [INFO] [stdout] | [INFO] [stdout] 33 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + 1), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:34:19 [INFO] [stdout] | [INFO] [stdout] 34 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + -1), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/aoc_18.rs:34:32 [INFO] [stdout] | [INFO] [stdout] 34 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + -1), [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `self.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> src/aoc_18.rs:34:45 [INFO] [stdout] | [INFO] [stdout] 34 | Coord(&self.0 + 0, &self.1 + 0, &self.2 + -1), [INFO] [stdout] | -------^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `self.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/aoc_19/blueprint.rs:18:34 [INFO] [stdout] | [INFO] [stdout] 18 | let material = match caps.name("material").and_then(|x| Some(x.as_str())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `caps.name("material").map(|x| x.as_str())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/aoc_19/factory_state.rs:19:24 [INFO] [stdout] | [INFO] [stdout] 19 | str_.push_str(&format!("Resources:\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Resources:\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/aoc_19/factory_state.rs:24:24 [INFO] [stdout] | [INFO] [stdout] 24 | str_.push_str(&format!("Robots:\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Robots:\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/aoc_19/factory_state.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | let required_turns_for_resource: usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `required_turns_for_resource` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 59 ~ [INFO] [stdout] 60 | let missing_resources = cost_amount - &self.resources[&cost_material]; [INFO] [stdout] ... [INFO] [stdout] 65 | } [INFO] [stdout] 66 ~ let required_turns_for_resource: usize = if missing_resources <= 0 { [INFO] [stdout] 67 ~ 0 [INFO] [stdout] 68 | } else { [INFO] [stdout] 69 ~ (missing_resources / production_rate [INFO] [stdout] 70 | + (if missing_resources % production_rate != 0 { [INFO] [stdout] ... [INFO] [stdout] 73 | 0 [INFO] [stdout] 74 ~ })) as usize [INFO] [stdout] 75 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/aoc_19/factory_state.rs:60:37 [INFO] [stdout] | [INFO] [stdout] 60 | let missing_resources = cost_amount - &self.resources[&cost_material]; [INFO] [stdout] | ^^^^^^^^^^^^^^------------------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `self.resources[&cost_material]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_19/factory_state.rs:60:67 [INFO] [stdout] | [INFO] [stdout] 60 | let missing_resources = cost_amount - &self.resources[&cost_material]; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `cost_material` [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/aoc_19/factory_state.rs:61:47 [INFO] [stdout] | [INFO] [stdout] 61 | let production_rate = self.robots[&cost_material]; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `cost_material` [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/aoc_19/factory_state.rs:86:74 [INFO] [stdout] | [INFO] [stdout] 86 | let material_cost = new_factory.blueprint.robot_costs[robot][&robot_material]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `robot_material` [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/aoc_19/factory_state.rs:88:35 [INFO] [stdout] | [INFO] [stdout] 88 | new_factory.resources[&robot_material] += [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `robot_material` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_19/factory_state.rs:124:9 [INFO] [stdout] | [INFO] [stdout] 124 | return state.resources[&Material::Geode] + self.robots[&Material::Geode]; [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] 124 - return state.resources[&Material::Geode] + self.robots[&Material::Geode]; [INFO] [stdout] 124 + state.resources[&Material::Geode] + self.robots[&Material::Geode] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/aoc_19/factory_state.rs:129:76 [INFO] [stdout] | [INFO] [stdout] 129 | self.resources[&Material::Geode] + self.robots[&Material::Geode] * remaining_turns as i32 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `remaining_turns` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_19.rs:24:74 [INFO] [stdout] | [INFO] [stdout] 24 | if let Some(next_state) = factory_states[l - 1].build_next_robot(&material) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `material` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/aoc_20.rs:5:19 [INFO] [stdout] | [INFO] [stdout] 5 | fn shift(numbers: &mut Vec<(usize, i64)>, og_idx: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - fn shift(numbers: &mut Vec<(usize, i64)>, og_idx: usize) { [INFO] [stdout] 5 + fn shift(numbers: &mut [(usize, i64)], og_idx: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_21.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | return Some(instruction.parse().expect("Could not parse integer")); [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] 72 - return Some(instruction.parse().expect("Could not parse integer")); [INFO] [stdout] 72 + Some(instruction.parse().expect("Could not parse integer")) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/aoc_21.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | *self.call.borrow() != None [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `(*self.call.borrow()).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/aoc_21.rs:93:9 [INFO] [stdout] | [INFO] [stdout] 93 | / return Monkey { [INFO] [stdout] 94 | | name: name.into(), [INFO] [stdout] 95 | | instruction, [INFO] [stdout] 96 | | call: RefCell::new(call), [INFO] [stdout] 97 | | }; [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] 93 ~ Monkey { [INFO] [stdout] 94 + name: name.into(), [INFO] [stdout] 95 + instruction, [INFO] [stdout] 96 + call: RefCell::new(call), [INFO] [stdout] 97 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/aoc_21.rs:134:32 [INFO] [stdout] | [INFO] [stdout] 134 | monkey.resolve(match op { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 135 | | &Operation::Add => monkey_1.value() + monkey_2.value(), [INFO] [stdout] 136 | | &Operation::Subtract => monkey_1.value() - monkey_2.value(), [INFO] [stdout] 137 | | &Operation::Multiply => monkey_1.value() * monkey_2.value(), [INFO] [stdout] 138 | | &Operation::Divide => monkey_1.value() / monkey_2.value(), [INFO] [stdout] 139 | | }); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 134 ~ monkey.resolve(match *op { [INFO] [stdout] 135 ~ Operation::Add => monkey_1.value() + monkey_2.value(), [INFO] [stdout] 136 ~ Operation::Subtract => monkey_1.value() - monkey_2.value(), [INFO] [stdout] 137 ~ Operation::Multiply => monkey_1.value() * monkey_2.value(), [INFO] [stdout] 138 ~ Operation::Divide => monkey_1.value() / monkey_2.value(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/aoc_21.rs:209:17 [INFO] [stdout] | [INFO] [stdout] 209 | required_value = required_value * other_monkey_value; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `required_value *= other_monkey_value` [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/aoc_22/cubic_map.rs:27:26 [INFO] [stdout] | [INFO] [stdout] 27 | fn get_face_coords(grid: &Vec>) -> (Vec<(usize, usize, Position)>, usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 27 - fn get_face_coords(grid: &Vec>) -> (Vec<(usize, usize, Position)>, usize) { [INFO] [stdout] 27 + fn get_face_coords(grid: &[Vec]) -> (Vec<(usize, usize, Position)>, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to both the expression and the patterns [INFO] [stdout] --> src/aoc_22/cubic_map.rs:229:48 [INFO] [stdout] | [INFO] [stdout] 229 | let distance_from_corner_on_left = match &orientation { [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 230 | | &NORTH => position.1 - origin_face_top_left.1, [INFO] [stdout] 231 | | &EAST => position.0 - origin_face_top_left.0, [INFO] [stdout] 232 | | &SOUTH => self.face_width - 1 - (position.1 - origin_face_top_left.1), [INFO] [stdout] 233 | | &WEST => self.face_width - 1 - (position.0 - origin_face_top_left.0), [INFO] [stdout] 234 | | _ => panic!("Unexpected direction"), [INFO] [stdout] 235 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 229 ~ let distance_from_corner_on_left = match orientation { [INFO] [stdout] 230 ~ NORTH => position.1 - origin_face_top_left.1, [INFO] [stdout] 231 ~ EAST => position.0 - origin_face_top_left.0, [INFO] [stdout] 232 ~ SOUTH => self.face_width - 1 - (position.1 - origin_face_top_left.1), [INFO] [stdout] 233 ~ WEST => self.face_width - 1 - (position.0 - origin_face_top_left.0), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/aoc_22/cubic_map.rs:242:29 [INFO] [stdout] | [INFO] [stdout] 242 | next_position = match destination_orientation { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 243 | | &NORTH => Position( [INFO] [stdout] 244 | | destination_face_top_left.0 + self.face_width - 1, [INFO] [stdout] 245 | | destination_face_top_left.1 + distance_from_corner_on_left, [INFO] [stdout] ... | [INFO] [stdout] 263 | | _ => panic!("Unexpected direction"), [INFO] [stdout] 264 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 242 ~ next_position = match *destination_orientation { [INFO] [stdout] 243 ~ NORTH => Position( [INFO] [stdout] 244 | destination_face_top_left.0 + self.face_width - 1, [INFO] [stdout] 245 | destination_face_top_left.1 + distance_from_corner_on_left, [INFO] [stdout] 246 | ), [INFO] [stdout] 247 ~ EAST => Position( [INFO] [stdout] 248 | destination_face_top_left.0 + distance_from_corner_on_left, [INFO] [stdout] 249 | destination_face_top_left.1, [INFO] [stdout] 250 | ), [INFO] [stdout] 251 ~ SOUTH => Position( [INFO] [stdout] 252 | destination_face_top_left.0, [INFO] [stdout] ... [INFO] [stdout] 256 | ), [INFO] [stdout] 257 ~ WEST => Position( [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/aoc_22/cubic_map.rs:277:32 [INFO] [stdout] | [INFO] [stdout] 277 | print_grid(&self.grid, &position); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `position` [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: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/cubic_map.rs:310:22: 310:25}>` [INFO] [stdout] --> src/aoc_22/cubic_map.rs:308:13 [INFO] [stdout] | [INFO] [stdout] 308 | / Vec::from(TINY_MAP) [INFO] [stdout] 309 | | .iter() [INFO] [stdout] 310 | | .map(|x| String::from(*x)) [INFO] [stdout] 311 | | .into_iter(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 308 ~ Vec::from(TINY_MAP) [INFO] [stdout] 309 + .iter() [INFO] [stdout] 310 ~ .map(|x| String::from(*x)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/cubic_map.rs:333:22: 333:25}>` [INFO] [stdout] --> src/aoc_22/cubic_map.rs:331:13 [INFO] [stdout] | [INFO] [stdout] 331 | / Vec::from(SMALL_MAP) [INFO] [stdout] 332 | | .iter() [INFO] [stdout] 333 | | .map(|x| String::from(*x)) [INFO] [stdout] 334 | | .into_iter(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 331 ~ Vec::from(SMALL_MAP) [INFO] [stdout] 332 + .iter() [INFO] [stdout] 333 ~ .map(|x| String::from(*x)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/cubic_map.rs:427:22: 427:25}>` [INFO] [stdout] --> src/aoc_22/cubic_map.rs:425:13 [INFO] [stdout] | [INFO] [stdout] 425 | / Vec::from(SMALL_MAP) [INFO] [stdout] 426 | | .iter() [INFO] [stdout] 427 | | .map(|x| String::from(*x)) [INFO] [stdout] 428 | | .into_iter(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 425 ~ Vec::from(SMALL_MAP) [INFO] [stdout] 426 + .iter() [INFO] [stdout] 427 ~ .map(|x| String::from(*x)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/cubic_map.rs:454:22: 454:25}>` [INFO] [stdout] --> src/aoc_22/cubic_map.rs:452:13 [INFO] [stdout] | [INFO] [stdout] 452 | / Vec::from(SMALL_MAP) [INFO] [stdout] 453 | | .iter() [INFO] [stdout] 454 | | .map(|x| String::from(*x)) [INFO] [stdout] 455 | | .into_iter(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 452 ~ Vec::from(SMALL_MAP) [INFO] [stdout] 453 + .iter() [INFO] [stdout] 454 ~ .map(|x| String::from(*x)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/cubic_map.rs:481:22: 481:25}>` [INFO] [stdout] --> src/aoc_22/cubic_map.rs:479:13 [INFO] [stdout] | [INFO] [stdout] 479 | / Vec::from(SMALL_MAP) [INFO] [stdout] 480 | | .iter() [INFO] [stdout] 481 | | .map(|x| String::from(*x)) [INFO] [stdout] 482 | | .into_iter(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 479 ~ Vec::from(SMALL_MAP) [INFO] [stdout] 480 + .iter() [INFO] [stdout] 481 ~ .map(|x| String::from(*x)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/cubic_map.rs:508:22: 508:25}>` [INFO] [stdout] --> src/aoc_22/cubic_map.rs:506:13 [INFO] [stdout] | [INFO] [stdout] 506 | / Vec::from(SMALL_MAP) [INFO] [stdout] 507 | | .iter() [INFO] [stdout] 508 | | .map(|x| String::from(*x)) [INFO] [stdout] 509 | | .into_iter(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 506 ~ Vec::from(SMALL_MAP) [INFO] [stdout] 507 + .iter() [INFO] [stdout] 508 ~ .map(|x| String::from(*x)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/cubic_map.rs:535:22: 535:25}>` [INFO] [stdout] --> src/aoc_22/cubic_map.rs:533:13 [INFO] [stdout] | [INFO] [stdout] 533 | / Vec::from(SMALL_MAP) [INFO] [stdout] 534 | | .iter() [INFO] [stdout] 535 | | .map(|x| String::from(*x)) [INFO] [stdout] 536 | | .into_iter(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 533 ~ Vec::from(SMALL_MAP) [INFO] [stdout] 534 + .iter() [INFO] [stdout] 535 ~ .map(|x| String::from(*x)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/cubic_map.rs:562:22: 562:25}>` [INFO] [stdout] --> src/aoc_22/cubic_map.rs:560:13 [INFO] [stdout] | [INFO] [stdout] 560 | / Vec::from(SMALL_MAP) [INFO] [stdout] 561 | | .iter() [INFO] [stdout] 562 | | .map(|x| String::from(*x)) [INFO] [stdout] 563 | | .into_iter(), [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 560 ~ Vec::from(SMALL_MAP) [INFO] [stdout] 561 + .iter() [INFO] [stdout] 562 ~ .map(|x| String::from(*x)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `grid` [INFO] [stdout] --> src/aoc_22/grid.rs:30:14 [INFO] [stdout] | [INFO] [stdout] 30 | 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] 30 - for i in 0..grid.len() { [INFO] [stdout] 30 + for in &mut grid { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/aoc_22/grid.rs:32:15 [INFO] [stdout] | [INFO] [stdout] 32 | while &grid[i].len() < &max_row_length { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 32 - while &grid[i].len() < &max_row_length { [INFO] [stdout] 32 + while grid[i].len() < max_row_length { [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/aoc_22/grid.rs:39:24 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn get_start(grid: &Vec>) -> Position { [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] 39 - pub fn get_start(grid: &Vec>) -> Position { [INFO] [stdout] 39 + pub fn get_start(grid: &[Vec]) -> Position { [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/aoc_22/grid.rs:45:25 [INFO] [stdout] | [INFO] [stdout] 45 | pub fn print_grid(grid: &Vec>, position: &Position) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 45 - pub fn print_grid(grid: &Vec>, position: &Position) { [INFO] [stdout] 45 + pub fn print_grid(grid: &[Vec], position: &Position) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/aoc_22/grid.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 61 - print!("\n"); [INFO] [stdout] 61 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22/grid.rs:86:57: 86:60}>` [INFO] [stdout] --> src/aoc_22/grid.rs:86:31 [INFO] [stdout] | [INFO] [stdout] 86 | let grid = parse_grid(Vec::from(MAP).iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `Vec::from(MAP).iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/aoc_22/instruction.rs:22:27 [INFO] [stdout] | [INFO] [stdout] 22 | .find(|c| c == 'L' || c == 'R') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['L', 'R']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/aoc_22/instruction.rs:21:27 [INFO] [stdout] | [INFO] [stdout] 21 | let end = (&input[idx..]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `input[idx..]` [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/aoc_22/toroidal_map.rs:44:32 [INFO] [stdout] | [INFO] [stdout] 44 | print_grid(&self.grid, &position); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `position` [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: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22.rs:122:57: 122:60}>` [INFO] [stdout] --> src/aoc_22.rs:122:31 [INFO] [stdout] | [INFO] [stdout] 122 | let grid = parse_grid(Vec::from(MAP).iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `Vec::from(MAP).iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22.rs:134:57: 134:60}>` [INFO] [stdout] --> src/aoc_22.rs:134:31 [INFO] [stdout] | [INFO] [stdout] 134 | let grid = parse_grid(Vec::from(MAP).iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `Vec::from(MAP).iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22.rs:146:57: 146:60}>` [INFO] [stdout] --> src/aoc_22.rs:146:31 [INFO] [stdout] | [INFO] [stdout] 146 | let grid = parse_grid(Vec::from(MAP).iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `Vec::from(MAP).iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22.rs:158:57: 158:60}>` [INFO] [stdout] --> src/aoc_22.rs:158:31 [INFO] [stdout] | [INFO] [stdout] 158 | let grid = parse_grid(Vec::from(MAP).iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `Vec::from(MAP).iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22.rs:170:57: 170:60}>` [INFO] [stdout] --> src/aoc_22.rs:170:31 [INFO] [stdout] | [INFO] [stdout] 170 | let grid = parse_grid(Vec::from(MAP).iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `Vec::from(MAP).iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_22.rs:184:47: 184:50}>` [INFO] [stdout] --> src/aoc_22.rs:184:30 [INFO] [stdout] | [INFO] [stdout] 184 | let result = solve_a(input.iter().map(|x| String::from(*x)).into_iter()).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `input.iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/aoc_23.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 87 - print!("\n"); [INFO] [stdout] 87 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/aoc_23.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 89 - print!("\n"); [INFO] [stdout] 89 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/aoc_23.rs:103:13 [INFO] [stdout] | [INFO] [stdout] 103 | / !ALL_DIRECTIONS [INFO] [stdout] 104 | | .into_iter() [INFO] [stdout] 105 | | .find(|d| self.elves.contains(&(**elf + *d))) [INFO] [stdout] 106 | | .is_none() [INFO] [stdout] | |__________________________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 103 ~ ALL_DIRECTIONS [INFO] [stdout] 104 + .into_iter() [INFO] [stdout] 105 + .find(|d| self.elves.contains(&(**elf + *d))).is_some() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/aoc_23.rs:120:17 [INFO] [stdout] | [INFO] [stdout] 120 | / if inverse_elf_intentions.contains_key(&elf_intention) { [INFO] [stdout] 121 | | // There's more than one elf trying to go to the same position; remove the existing one. [INFO] [stdout] 122 | | let elf = inverse_elf_intentions.remove(&elf_intention).unwrap(); [INFO] [stdout] 123 | | elf_intentions.remove(elf); [INFO] [stdout] ... | [INFO] [stdout] 126 | | inverse_elf_intentions.insert(elf_intention, elf); [INFO] [stdout] 127 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 120 ~ if let std::collections::hash_map::Entry::Vacant(e) = inverse_elf_intentions.entry(elf_intention) { [INFO] [stdout] 121 + elf_intentions.insert(elf, elf_intention); [INFO] [stdout] 122 + e.insert(elf); [INFO] [stdout] 123 + } else { [INFO] [stdout] 124 + // There's more than one elf trying to go to the same position; remove the existing one. [INFO] [stdout] 125 + let elf = inverse_elf_intentions.remove(&elf_intention).unwrap(); [INFO] [stdout] 126 + elf_intentions.remove(elf); [INFO] [stdout] 127 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_23.rs:193:54: 193:57}>` [INFO] [stdout] --> src/aoc_23.rs:193:34 [INFO] [stdout] | [INFO] [stdout] 193 | ElfCollection::parse(TINY_MAP.iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `TINY_MAP.iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_23.rs:209:54: 209:57}>` [INFO] [stdout] --> src/aoc_23.rs:209:34 [INFO] [stdout] | [INFO] [stdout] 209 | ElfCollection::parse(TINY_MAP.iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `TINY_MAP.iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_23.rs:226:54: 226:57}>` [INFO] [stdout] --> src/aoc_23.rs:226:34 [INFO] [stdout] | [INFO] [stdout] 226 | ElfCollection::parse(TINY_MAP.iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `TINY_MAP.iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_23.rs:244:54: 244:57}>` [INFO] [stdout] --> src/aoc_23.rs:244:34 [INFO] [stdout] | [INFO] [stdout] 244 | ElfCollection::parse(TINY_MAP.iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `TINY_MAP.iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::iter::Map, {closure@src/aoc_23.rs:263:54: 263:57}>` [INFO] [stdout] --> src/aoc_23.rs:263:34 [INFO] [stdout] | [INFO] [stdout] 263 | ElfCollection::parse(TINY_MAP.iter().map(|x| String::from(*x)).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `TINY_MAP.iter().map(|x| String::from(*x))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | assert_eq!(blizzard_history.has_blizzard_at(0, &Position(2, 2)), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 214 - assert_eq!(blizzard_history.has_blizzard_at(0, &Position(2, 2)), false); [INFO] [stdout] 214 + assert!(!blizzard_history.has_blizzard_at(0, &Position(2, 2))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:215:9 [INFO] [stdout] | [INFO] [stdout] 215 | assert_eq!(blizzard_history.has_blizzard_at(0, &Position(2, 3)), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 215 - assert_eq!(blizzard_history.has_blizzard_at(0, &Position(2, 3)), true); [INFO] [stdout] 215 + assert!(blizzard_history.has_blizzard_at(0, &Position(2, 3))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:216:9 [INFO] [stdout] | [INFO] [stdout] 216 | assert_eq!(blizzard_history.has_blizzard_at(0, &Position(2, 4)), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 216 - assert_eq!(blizzard_history.has_blizzard_at(0, &Position(2, 4)), true); [INFO] [stdout] 216 + assert!(blizzard_history.has_blizzard_at(0, &Position(2, 4))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:217:9 [INFO] [stdout] | [INFO] [stdout] 217 | assert_eq!(blizzard_history.has_blizzard_at(0, &Position(2, 5)), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 217 - assert_eq!(blizzard_history.has_blizzard_at(0, &Position(2, 5)), false); [INFO] [stdout] 217 + assert!(!blizzard_history.has_blizzard_at(0, &Position(2, 5))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:228:9 [INFO] [stdout] | [INFO] [stdout] 228 | assert_eq!(blizzard_history.has_blizzard_at(2, &Position(1, 4)), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 228 - assert_eq!(blizzard_history.has_blizzard_at(2, &Position(1, 4)), true); [INFO] [stdout] 228 + assert!(blizzard_history.has_blizzard_at(2, &Position(1, 4))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | assert_eq!(blizzard_history.has_blizzard_at(2, &Position(1, 5)), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 229 - assert_eq!(blizzard_history.has_blizzard_at(2, &Position(1, 5)), false); [INFO] [stdout] 229 + assert!(!blizzard_history.has_blizzard_at(2, &Position(1, 5))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:230:9 [INFO] [stdout] | [INFO] [stdout] 230 | assert_eq!(blizzard_history.has_blizzard_at(2, &Position(5, 3)), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 230 - assert_eq!(blizzard_history.has_blizzard_at(2, &Position(5, 3)), true); [INFO] [stdout] 230 + assert!(blizzard_history.has_blizzard_at(2, &Position(5, 3))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:231:9 [INFO] [stdout] | [INFO] [stdout] 231 | assert_eq!(blizzard_history.has_blizzard_at(2, &Position(5, 4)), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 231 - assert_eq!(blizzard_history.has_blizzard_at(2, &Position(5, 4)), false); [INFO] [stdout] 231 + assert!(!blizzard_history.has_blizzard_at(2, &Position(5, 4))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/aoc_24/blizzard.rs:232:9 [INFO] [stdout] | [INFO] [stdout] 232 | assert_eq!(blizzard_history.has_blizzard_at(2, &Position(5, 5)), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 232 - assert_eq!(blizzard_history.has_blizzard_at(2, &Position(5, 5)), true); [INFO] [stdout] 232 + assert!(blizzard_history.has_blizzard_at(2, &Position(5, 5))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/aoc_25.rs:45:55 [INFO] [stdout] | [INFO] [stdout] 45 | let str = String::from_iter(self.0.iter().map(|s| char::from(s))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `char::from` [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/aoc_25.rs:58:42 [INFO] [stdout] | [INFO] [stdout] 58 | String::from_iter(s.0.iter().map(|d| char::from(d))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `char::from` [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: useless use of `vec!` [INFO] [stdout] --> src/aoc_07/directories.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | vec![dir_size_greater_than_min, smallest_subdir_greater_than_min] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[dir_size_greater_than_min, smallest_subdir_greater_than_min]` [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/aoc_13/signal.rs:189:42 [INFO] [stdout] | [INFO] [stdout] 189 | Signal::find_closing_bracket(&vec![ [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 190 | | SignalToken::OpenBracket, [INFO] [stdout] 191 | | SignalToken::Int(1), [INFO] [stdout] 192 | | SignalToken::CloseBracket, [INFO] [stdout] ... | [INFO] [stdout] 195 | | SignalToken::CloseBracket, [INFO] [stdout] 196 | | ]) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use a slice directly [INFO] [stdout] | [INFO] [stdout] 189 ~ Signal::find_closing_bracket(&[SignalToken::OpenBracket, [INFO] [stdout] 190 + SignalToken::Int(1), [INFO] [stdout] 191 + SignalToken::CloseBracket, [INFO] [stdout] 192 + SignalToken::Int(2), [INFO] [stdout] 193 + SignalToken::Int(3), [INFO] [stdout] 194 ~ SignalToken::CloseBracket]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/aoc_13/signal.rs:205:42 [INFO] [stdout] | [INFO] [stdout] 205 | Signal::find_closing_bracket(&vec![ [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 206 | | SignalToken::OpenBracket, [INFO] [stdout] 207 | | SignalToken::Int(1), [INFO] [stdout] 208 | | SignalToken::Int(2), [INFO] [stdout] 209 | | SignalToken::Int(3), [INFO] [stdout] 210 | | ]), [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use a slice directly [INFO] [stdout] | [INFO] [stdout] 205 ~ Signal::find_closing_bracket(&[SignalToken::OpenBracket, [INFO] [stdout] 206 + SignalToken::Int(1), [INFO] [stdout] 207 + SignalToken::Int(2), [INFO] [stdout] 208 ~ SignalToken::Int(3)]), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: for loop over an `Option`. This is more readably written as an `if let` statement [INFO] [stdout] --> src/aoc_02.rs:6:29 [INFO] [stdout] | [INFO] [stdout] 6 | for (str1, str2) in line.split_once(" ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(for_loops_over_fallibles)]` on by default [INFO] [stdout] help: to check pattern in a loop use `while let` [INFO] [stdout] | [INFO] [stdout] 6 - for (str1, str2) in line.split_once(" ") { [INFO] [stdout] 6 + while let Some((str1, str2)) = line.split_once(" ") { [INFO] [stdout] | [INFO] [stdout] help: consider using `if let` to clear intent [INFO] [stdout] | [INFO] [stdout] 6 - for (str1, str2) in line.split_once(" ") { [INFO] [stdout] 6 + if let Some((str1, str2)) = line.split_once(" ") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: for loop over an `Option`. This is more readably written as an `if let` statement [INFO] [stdout] --> src/aoc_02.rs:32:29 [INFO] [stdout] | [INFO] [stdout] 32 | for (str1, str2) in line.split_once(" ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: to check pattern in a loop use `while let` [INFO] [stdout] | [INFO] [stdout] 32 - for (str1, str2) in line.split_once(" ") { [INFO] [stdout] 32 + while let Some((str1, str2)) = line.split_once(" ") { [INFO] [stdout] | [INFO] [stdout] help: consider using `if let` to clear intent [INFO] [stdout] | [INFO] [stdout] 32 - for (str1, str2) in line.split_once(" ") { [INFO] [stdout] 32 + if let Some((str1, str2)) = line.split_once(" ") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.45s [INFO] running `Command { std: "docker" "inspect" "0e49c544badda8b434343f124c772ec5d6787e4f08ec61f637d97f44695390d3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0e49c544badda8b434343f124c772ec5d6787e4f08ec61f637d97f44695390d3", kill_on_drop: false }` [INFO] [stdout] 0e49c544badda8b434343f124c772ec5d6787e4f08ec61f637d97f44695390d3