[INFO] cloning repository https://github.com/thepycoder/aoc_2022 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/thepycoder/aoc_2022" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fthepycoder%2Faoc_2022", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fthepycoder%2Faoc_2022'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 072e65912285c60c371891d76b8f2f827da5f942 [INFO] linting thepycoder/aoc_2022 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fthepycoder%2Faoc_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/thepycoder/aoc_2022 [INFO] finished tweaking git repo https://github.com/thepycoder/aoc_2022 [INFO] tweaked toml for git repo https://github.com/thepycoder/aoc_2022 written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/thepycoder/aoc_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/thepycoder/aoc_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] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded trees v0.4.2 [INFO] [stderr] Downloaded snowflake v1.3.0 [INFO] [stderr] Downloaded ndarray-stats v0.5.1 [INFO] [stderr] Downloaded noisy_float v0.2.0 [INFO] [stderr] Downloaded slab_tree v0.3.2 [INFO] [stderr] Downloaded ndarray v0.15.6 [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] 489c46809f8b716aae8faaadcbcbbe2296bc27d168e3a8148daf392655168b28 [INFO] running `Command { std: "docker" "start" "-a" "489c46809f8b716aae8faaadcbcbbe2296bc27d168e3a8148daf392655168b28", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "489c46809f8b716aae8faaadcbcbbe2296bc27d168e3a8148daf392655168b28", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "489c46809f8b716aae8faaadcbcbbe2296bc27d168e3a8148daf392655168b28", kill_on_drop: false }` [INFO] [stdout] 489c46809f8b716aae8faaadcbcbbe2296bc27d168e3a8148daf392655168b28 [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] d5a2cd20fe8421df1340698e6213e2b9c7a24303320b68ba87e73eb6b3fe5a55 [INFO] running `Command { std: "docker" "start" "-a" "d5a2cd20fe8421df1340698e6213e2b9c7a24303320b68ba87e73eb6b3fe5a55", kill_on_drop: false }` [INFO] [stderr] Compiling num-traits v0.2.15 [INFO] [stderr] Compiling libc v0.2.138 [INFO] [stderr] Compiling num-integer v0.1.45 [INFO] [stderr] Compiling indexmap v1.9.2 [INFO] [stderr] Checking rawpointer v0.2.1 [INFO] [stderr] Checking snowflake v1.3.0 [INFO] [stderr] Checking trees v0.4.2 [INFO] [stderr] Checking matrixmultiply v0.3.2 [INFO] [stderr] Checking slab_tree v0.3.2 [INFO] [stderr] Checking getrandom v0.2.8 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking num-complex v0.4.2 [INFO] [stderr] Checking noisy_float v0.2.0 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking ndarray v0.15.6 [INFO] [stderr] Checking ndarray-stats v0.5.1 [INFO] [stderr] Checking aoc_2022 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `thread::current` [INFO] [stdout] --> src/day11.rs:37:15 [INFO] [stdout] | [INFO] [stdout] 37 | use std::{fs, thread::current}; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Ix2` [INFO] [stdout] --> src/day12.rs:1:29 [INFO] [stdout] | [INFO] [stdout] 1 | use ndarray::{Array2, Axis, Ix2}; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `collections::HashSet` [INFO] [stdout] --> src/day20.rs:1:15 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{fs, collections::HashSet}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around pattern [INFO] [stdout] --> src/day20.rs:9:15 [INFO] [stdout] | [INFO] [stdout] 9 | .map(|(e)| e.parse::().unwrap()) [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] 9 - .map(|(e)| e.parse::().unwrap()) [INFO] [stdout] 9 + .map(|e | e.parse::().unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around pattern [INFO] [stdout] --> src/day20.rs:65:15 [INFO] [stdout] | [INFO] [stdout] 65 | .map(|(e)| e.parse::().unwrap() * 811589153) [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 65 - .map(|(e)| e.parse::().unwrap() * 811589153) [INFO] [stdout] 65 + .map(|e | e.parse::().unwrap() * 811589153) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `thread::current` [INFO] [stdout] --> src/day11.rs:37:15 [INFO] [stdout] | [INFO] [stdout] 37 | use std::{fs, thread::current}; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Ix2` [INFO] [stdout] --> src/day12.rs:1:29 [INFO] [stdout] | [INFO] [stdout] 1 | use ndarray::{Array2, Axis, Ix2}; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `collections::HashSet` [INFO] [stdout] --> src/day20.rs:1:15 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{fs, collections::HashSet}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around pattern [INFO] [stdout] --> src/day20.rs:9:15 [INFO] [stdout] | [INFO] [stdout] 9 | .map(|(e)| e.parse::().unwrap()) [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] 9 - .map(|(e)| e.parse::().unwrap()) [INFO] [stdout] 9 + .map(|e | e.parse::().unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around pattern [INFO] [stdout] --> src/day20.rs:65:15 [INFO] [stdout] | [INFO] [stdout] 65 | .map(|(e)| e.parse::().unwrap() * 811589153) [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 65 - .map(|(e)| e.parse::().unwrap() * 811589153) [INFO] [stdout] 65 + .map(|e | e.parse::().unwrap() * 811589153) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day7.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | let mut folder = node.data(); [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day10.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | let mut instructions_vec: Vec> = instructions [INFO] [stdout] | ----^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `loops` is never read [INFO] [stdout] --> src/day10.rs:23:25 [INFO] [stdout] | [INFO] [stdout] 23 | let mut loops = 0; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day7.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | let mut folder = node.data(); [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `from_id` [INFO] [stdout] --> src/day11.rs:178:18 [INFO] [stdout] | [INFO] [stdout] 178 | for (from_id, to_id, value) in to_move { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_from_id` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `starting_position` [INFO] [stdout] --> src/day12.rs:87:16 [INFO] [stdout] | [INFO] [stdout] 87 | let (grid, starting_position, ending_position) = read_grid(filepath); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_starting_position` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_smaller_number` is never used [INFO] [stdout] --> src/day11.rs:52:4 [INFO] [stdout] | [INFO] [stdout] 52 | fn get_smaller_number(input: u64, modulo: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `day13_1` is never used [INFO] [stdout] --> src/day13.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn day13_1(filepath: &str) -> Result { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/day1.rs:10:41 [INFO] [stdout] | [INFO] [stdout] 10 | for (_index, line) in reader.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 10 - for (_index, line) in reader.lines().enumerate() { [INFO] [stdout] 10 + for line in reader.lines() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/day1.rs:32:41 [INFO] [stdout] | [INFO] [stdout] 32 | for (_index, line) in reader.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 32 - for (_index, line) in reader.lines().enumerate() { [INFO] [stdout] 32 + for line in reader.lines() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day10.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | let mut instructions_vec: Vec> = instructions [INFO] [stdout] | ----^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `loops` is never read [INFO] [stdout] --> src/day10.rs:23:25 [INFO] [stdout] | [INFO] [stdout] 23 | let mut loops = 0; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day3.rs:9:52 [INFO] [stdout] | [INFO] [stdout] 9 | let difference: Vec<_> = byte_half_tuple.0.into_iter().filter(|item| byte_half_tuple.1.contains(item)).collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day3.rs:28:14 [INFO] [stdout] | [INFO] [stdout] 28 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day4.rs:20:89 [INFO] [stdout] | [INFO] [stdout] 20 | if elf_1_parsed[0] <= elf_2_parsed[0] && elf_1_parsed[1] >= elf_2_parsed[1] { [INFO] [stdout] | _________________________________________________________________________________________^ [INFO] [stdout] 21 | | total += 1; [INFO] [stdout] 22 | | // dbg!("Added"); [INFO] [stdout] 23 | | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day4.rs:23:96 [INFO] [stdout] | [INFO] [stdout] 23 | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | ________________________________________________________________________________________________^ [INFO] [stdout] 24 | | total += 1; [INFO] [stdout] 25 | | // dbg!("Added"); [INFO] [stdout] 26 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day4.rs:47:89 [INFO] [stdout] | [INFO] [stdout] 47 | if elf_1_parsed[0] <= elf_2_parsed[0] && elf_1_parsed[1] >= elf_2_parsed[1] { [INFO] [stdout] | _________________________________________________________________________________________^ [INFO] [stdout] 48 | | total += 1; [INFO] [stdout] 49 | | // dbg!("Added"); [INFO] [stdout] 50 | | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day4.rs:50:96 [INFO] [stdout] | [INFO] [stdout] 50 | ... } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | __________________________________________________________________________________________^ [INFO] [stdout] 51 | | ... total += 1; [INFO] [stdout] 52 | | ... // dbg!("Added"); [INFO] [stdout] 53 | | ... } else if elf_1_parsed[0] <= elf_2_parsed[0] && elf_2_parsed[0] <= elf_1_parsed[1] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | |_______^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day4.rs:53:134 [INFO] [stdout] | [INFO] [stdout] 53 | } else if elf_1_parsed[0] <= elf_2_parsed[0] && elf_2_parsed[0] <= elf_1_parsed[1] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | ______________________________________________________________________________________________________________________________________^ [INFO] [stdout] 54 | | total += 1; [INFO] [stdout] 55 | | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[0] <= elf_2_parsed[1] && elf_1_parsed[1] >= elf_2_parsed[1] { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day4.rs:55:134 [INFO] [stdout] | [INFO] [stdout] 55 | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[0] <= elf_2_parsed[1] && elf_1_parsed[1] >= elf_2_parsed[1] { [INFO] [stdout] | ______________________________________________________________________________________________________________________________________^ [INFO] [stdout] 56 | | total += 1; [INFO] [stdout] 57 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `from_id` [INFO] [stdout] --> src/day11.rs:178:18 [INFO] [stdout] | [INFO] [stdout] 178 | for (from_id, to_id, value) in to_move { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_from_id` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/day5.rs:7:46 [INFO] [stdout] | [INFO] [stdout] 7 | for (_, stack_row) in split_stacks.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 7 - for (_, stack_row) in split_stacks.iter().enumerate() { [INFO] [stdout] 7 + for stack_row in split_stacks.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `starting_position` [INFO] [stdout] --> src/day12.rs:87:16 [INFO] [stdout] | [INFO] [stdout] 87 | let (grid, starting_position, ending_position) = read_grid(filepath); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_starting_position` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day8.rs:12:10 [INFO] [stdout] | [INFO] [stdout] 12 | .map(|treeline| { [INFO] [stdout] | __________^ [INFO] [stdout] 13 | | size = treeline.len(); [INFO] [stdout] 14 | | treeline [INFO] [stdout] 15 | | .chars() [INFO] [stdout] ... | [INFO] [stdout] 18 | | }) [INFO] [stdout] 19 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 12 ~ .flat_map(|treeline| { [INFO] [stdout] 13 + size = treeline.len(); [INFO] [stdout] 14 + treeline [INFO] [stdout] 15 + .chars() [INFO] [stdout] 16 + .map(|tree| tree.to_digit(10).unwrap() as i32) [INFO] [stdout] 17 + .collect::>() [INFO] [stdout] 18 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day8.rs:52:10 [INFO] [stdout] | [INFO] [stdout] 52 | .map(|treeline| { [INFO] [stdout] | __________^ [INFO] [stdout] 53 | | size = treeline.len(); [INFO] [stdout] 54 | | treeline [INFO] [stdout] 55 | | .chars() [INFO] [stdout] ... | [INFO] [stdout] 58 | | }) [INFO] [stdout] 59 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 52 ~ .flat_map(|treeline| { [INFO] [stdout] 53 + size = treeline.len(); [INFO] [stdout] 54 + treeline [INFO] [stdout] 55 + .chars() [INFO] [stdout] 56 + .map(|tree| tree.to_digit(10).unwrap() as i32) [INFO] [stdout] 57 + .collect::>() [INFO] [stdout] 58 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `parse_score` doesn't need a mutable reference [INFO] [stdout] --> src/day8.rs:68:21 [INFO] [stdout] | [INFO] [stdout] 68 | parse_score(&mut row, &mut score); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 68 - parse_score(&mut row, &mut score); [INFO] [stdout] 68 + parse_score(&row, &mut score); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `parse_score` doesn't need a mutable reference [INFO] [stdout] --> src/day8.rs:69:21 [INFO] [stdout] | [INFO] [stdout] 69 | parse_score(&mut row.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 69 - parse_score(&mut row.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] 69 + parse_score(&row.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `parse_score` doesn't need a mutable reference [INFO] [stdout] --> src/day8.rs:73:21 [INFO] [stdout] | [INFO] [stdout] 73 | parse_score(&mut col, &mut score); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 73 - parse_score(&mut col, &mut score); [INFO] [stdout] 73 + parse_score(&col, &mut score); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `parse_score` doesn't need a mutable reference [INFO] [stdout] --> src/day8.rs:74:21 [INFO] [stdout] | [INFO] [stdout] 74 | parse_score(&mut col.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 74 - parse_score(&mut col.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] 74 + parse_score(&col.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/day8.rs:86:161 [INFO] [stdout] | [INFO] [stdout] 86 | ...se, Dim<[usize; 1]>>) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/day8.rs:96:148 [INFO] [stdout] | [INFO] [stdout] 96 | ...se, Dim<[usize; 1]>>) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/day8.rs:104:29 [INFO] [stdout] | [INFO] [stdout] 104 | while cursor > 0 && &row.slice(s![cursor]).into_scalar() < &tree { [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] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 104 - while cursor > 0 && &row.slice(s![cursor]).into_scalar() < &tree { [INFO] [stdout] 104 + while cursor > 0 && row.slice(s![cursor]).into_scalar() < tree { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day9.rs:66:10 [INFO] [stdout] | [INFO] [stdout] 66 | .map(|command| { [INFO] [stdout] | __________^ [INFO] [stdout] 67 | | let amount = command[1].parse::().unwrap(); [INFO] [stdout] 68 | | let mut tail_positions: Vec = Vec::new(); [INFO] [stdout] 69 | | for _ in 0..amount { [INFO] [stdout] ... | [INFO] [stdout] 89 | | }) [INFO] [stdout] 90 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 66 ~ .flat_map(|command| { [INFO] [stdout] 67 + let amount = command[1].parse::().unwrap(); [INFO] [stdout] 68 + let mut tail_positions: Vec = Vec::new(); [INFO] [stdout] 69 + for _ in 0..amount { [INFO] [stdout] 70 + match command[0] { [INFO] [stdout] 71 + "U" => head.y -= 1, [INFO] [stdout] 72 + "D" => head.y += 1, [INFO] [stdout] 73 + "L" => head.x -= 1, [INFO] [stdout] 74 + "R" => head.x += 1, [INFO] [stdout] 75 + _ => panic!("This should not happen!") [INFO] [stdout] 76 + } [INFO] [stdout] 77 + // dbg!(head); [INFO] [stdout] 78 + if !check_touching(head, tail) { [INFO] [stdout] 79 + tail = last_head_position; [INFO] [stdout] 80 + tail_positions.push(tail); // return tail so the map iterator can become a Vec with the tail history in it. [INFO] [stdout] 81 + } [INFO] [stdout] 82 + last_head_position = head; [INFO] [stdout] 83 + // display_grid(&vec![head, tail]); [INFO] [stdout] 84 + // dbg!(head); [INFO] [stdout] 85 + // dbg!(tail); [INFO] [stdout] 86 + // println!("=====") [INFO] [stdout] 87 + } [INFO] [stdout] 88 + tail_positions [INFO] [stdout] 89 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().count()` on a `Vec` [INFO] [stdout] --> src/day9.rs:98:8 [INFO] [stdout] | [INFO] [stdout] 98 | Ok(result.iter().count()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `result.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count [INFO] [stdout] = note: `#[warn(clippy::iter_count)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day9.rs:110:10 [INFO] [stdout] | [INFO] [stdout] 110 | .map(|command| { [INFO] [stdout] | __________^ [INFO] [stdout] 111 | | let amount = command[1].parse::().unwrap(); [INFO] [stdout] 112 | | let mut tail_positions: Vec = Vec::new(); [INFO] [stdout] 113 | | let scope_tails: &mut Vec = &mut tails; [INFO] [stdout] ... | [INFO] [stdout] 133 | | }) [INFO] [stdout] 134 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 110 ~ .flat_map(|command| { [INFO] [stdout] 111 + let amount = command[1].parse::().unwrap(); [INFO] [stdout] 112 + let mut tail_positions: Vec = Vec::new(); [INFO] [stdout] 113 + let scope_tails: &mut Vec = &mut tails; [INFO] [stdout] 114 + for _ in 0..amount { [INFO] [stdout] 115 + match command[0] { [INFO] [stdout] 116 + "U" => scope_tails[0].y -= 1, [INFO] [stdout] 117 + "D" => scope_tails[0].y += 1, [INFO] [stdout] 118 + "L" => scope_tails[0].x -= 1, [INFO] [stdout] 119 + "R" => scope_tails[0].x += 1, [INFO] [stdout] 120 + _ => panic!("This should not happen!") [INFO] [stdout] 121 + } [INFO] [stdout] 122 + for i in 0..scope_tails.len() - 1 { [INFO] [stdout] 123 + let new_tail_position = update_tail(scope_tails[i], scope_tails[i+1]); [INFO] [stdout] 124 + last_positions[i+1] = scope_tails[i+1]; [INFO] [stdout] 125 + scope_tails[i+1] = new_tail_position; [INFO] [stdout] 126 + if i == scope_tails.len() - 2 { [INFO] [stdout] 127 + tail_positions.push(new_tail_position); [INFO] [stdout] 128 + } [INFO] [stdout] 129 + } [INFO] [stdout] 130 + last_positions[0] = scope_tails[0]; [INFO] [stdout] 131 + } [INFO] [stdout] 132 + tail_positions [INFO] [stdout] 133 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().count()` on a `Vec` [INFO] [stdout] --> src/day9.rs:143:8 [INFO] [stdout] | [INFO] [stdout] 143 | Ok(result.iter().count()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `result.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_smaller_number` is never used [INFO] [stdout] --> src/day11.rs:52:4 [INFO] [stdout] | [INFO] [stdout] 52 | fn get_smaller_number(input: u64, modulo: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/day1.rs:10:41 [INFO] [stdout] | [INFO] [stdout] 10 | for (_index, line) in reader.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 10 - for (_index, line) in reader.lines().enumerate() { [INFO] [stdout] 10 + for line in reader.lines() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/day1.rs:32:41 [INFO] [stdout] | [INFO] [stdout] 32 | for (_index, line) in reader.lines().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 32 - for (_index, line) in reader.lines().enumerate() { [INFO] [stdout] 32 + for line in reader.lines() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day11.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | return input; [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] 61 - return input; [INFO] [stdout] 61 + input [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day11.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | return input % result; [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] 63 - return input % result; [INFO] [stdout] 63 + input % result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day11.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | return input; [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] 65 - return input; [INFO] [stdout] 65 + input [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/day11.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | &monkies.push(monkey); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `monkies.push(monkey);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `current_monkey_items.get(0)` [INFO] [stdout] --> src/day11.rs:137:35 [INFO] [stdout] | [INFO] [stdout] 137 | let worry_level = current_monkey_items.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `current_monkey_items.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day11.rs:154:21 [INFO] [stdout] | [INFO] [stdout] 154 | new_worry_level = new_worry_level / 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `new_worry_level /= 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: unneeded late initialization [INFO] [stdout] --> src/day11.rs:164:17 [INFO] [stdout] | [INFO] [stdout] 164 | let new_monkey_id; [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 `new_monkey_id` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 164 ~ [INFO] [stdout] 165 ~ let new_monkey_id = if new_worry_level % current_monkey.test_divisible == 0 { [INFO] [stdout] 166 ~ current_monkey.if_true [INFO] [stdout] 167 | } else { [INFO] [stdout] 168 ~ current_monkey.if_false [INFO] [stdout] 169 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day11.rs:165:20 [INFO] [stdout] | [INFO] [stdout] 165 | if new_worry_level % current_monkey.test_divisible == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `new_worry_level.is_multiple_of(current_monkey.test_divisible)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day3.rs:9:52 [INFO] [stdout] | [INFO] [stdout] 9 | let difference: Vec<_> = byte_half_tuple.0.into_iter().filter(|item| byte_half_tuple.1.contains(item)).collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day3.rs:28:14 [INFO] [stdout] | [INFO] [stdout] 28 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day12.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 52 | if !starting_col_option.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `starting_col_option.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day12.rs:58:12 [INFO] [stdout] | [INFO] [stdout] 58 | if !ending_col_option.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ending_col_option.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `starting_col_option` after checking its variant with `is_none` [INFO] [stdout] --> src/day12.rs:53:49 [INFO] [stdout] | [INFO] [stdout] 52 | if !starting_col_option.is_none() { [INFO] [stdout] | ----------------------------- the check is happening here [INFO] [stdout] 53 | starting_position = Coord {x: i, y: starting_col_option.unwrap(), value: 'a' as u8}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `starting_col_option` after checking its variant with `is_none` [INFO] [stdout] --> src/day12.rs:54:19 [INFO] [stdout] | [INFO] [stdout] 52 | if !starting_col_option.is_none() { [INFO] [stdout] | ----------------------------- the check is happening here [INFO] [stdout] 53 | starting_position = Coord {x: i, y: starting_col_option.unwrap(), value: 'a' as u8}; [INFO] [stdout] 54 | chars[starting_col_option.unwrap()] = 'a' as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `ending_col_option` after checking its variant with `is_none` [INFO] [stdout] --> src/day12.rs:59:47 [INFO] [stdout] | [INFO] [stdout] 58 | if !ending_col_option.is_none() { [INFO] [stdout] | --------------------------- the check is happening here [INFO] [stdout] 59 | ending_position = Coord {x: i, y: ending_col_option.unwrap(), value: 'z' as u8}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `ending_col_option` after checking its variant with `is_none` [INFO] [stdout] --> src/day12.rs:60:19 [INFO] [stdout] | [INFO] [stdout] 58 | if !ending_col_option.is_none() { [INFO] [stdout] | --------------------------- the check is happening here [INFO] [stdout] 59 | ending_position = Coord {x: i, y: ending_col_option.unwrap(), value: 'z' as u8}; [INFO] [stdout] 60 | chars[ending_col_option.unwrap()] = 'z' as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:53:86 [INFO] [stdout] | [INFO] [stdout] 53 | starting_position = Coord {x: i, y: starting_col_option.unwrap(), value: 'a' as u8}; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day4.rs:20:89 [INFO] [stdout] | [INFO] [stdout] 20 | if elf_1_parsed[0] <= elf_2_parsed[0] && elf_1_parsed[1] >= elf_2_parsed[1] { [INFO] [stdout] | _________________________________________________________________________________________^ [INFO] [stdout] 21 | | total += 1; [INFO] [stdout] 22 | | // dbg!("Added"); [INFO] [stdout] 23 | | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day4.rs:23:96 [INFO] [stdout] | [INFO] [stdout] 23 | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | ________________________________________________________________________________________________^ [INFO] [stdout] 24 | | total += 1; [INFO] [stdout] 25 | | // dbg!("Added"); [INFO] [stdout] 26 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:54:51 [INFO] [stdout] | [INFO] [stdout] 54 | chars[starting_col_option.unwrap()] = 'a' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:59:82 [INFO] [stdout] | [INFO] [stdout] 59 | ending_position = Coord {x: i, y: ending_col_option.unwrap(), value: 'z' as u8}; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:60:49 [INFO] [stdout] | [INFO] [stdout] 60 | chars[ending_col_option.unwrap()] = 'z' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/day12.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 81 | let result = solve(starting_position, &grid, ending_position); [INFO] [stdout] | -------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 82 | result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 81 ~ [INFO] [stdout] 82 ~ solve(starting_position, &grid, ending_position) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day4.rs:47:89 [INFO] [stdout] | [INFO] [stdout] 47 | if elf_1_parsed[0] <= elf_2_parsed[0] && elf_1_parsed[1] >= elf_2_parsed[1] { [INFO] [stdout] | _________________________________________________________________________________________^ [INFO] [stdout] 48 | | total += 1; [INFO] [stdout] 49 | | // dbg!("Added"); [INFO] [stdout] 50 | | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day4.rs:50:96 [INFO] [stdout] | [INFO] [stdout] 50 | ... } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | __________________________________________________________________________________________^ [INFO] [stdout] 51 | | ... total += 1; [INFO] [stdout] 52 | | ... // dbg!("Added"); [INFO] [stdout] 53 | | ... } else if elf_1_parsed[0] <= elf_2_parsed[0] && elf_2_parsed[0] <= elf_1_parsed[1] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | |_______^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day4.rs:53:134 [INFO] [stdout] | [INFO] [stdout] 53 | } else if elf_1_parsed[0] <= elf_2_parsed[0] && elf_2_parsed[0] <= elf_1_parsed[1] && elf_1_parsed[1] <= elf_2_parsed[1] { [INFO] [stdout] | ______________________________________________________________________________________________________________________________________^ [INFO] [stdout] 54 | | total += 1; [INFO] [stdout] 55 | | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[0] <= elf_2_parsed[1] && elf_1_parsed[1] >= elf_2_parsed[1] { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day4.rs:55:134 [INFO] [stdout] | [INFO] [stdout] 55 | } else if elf_1_parsed[0] >= elf_2_parsed[0] && elf_1_parsed[0] <= elf_2_parsed[1] && elf_1_parsed[1] >= elf_2_parsed[1] { [INFO] [stdout] | ______________________________________________________________________________________________________________________________________^ [INFO] [stdout] 56 | | total += 1; [INFO] [stdout] 57 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day12.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | return results.first().copied(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 104 - return results.first().copied(); [INFO] [stdout] 104 + results.first().copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:91:20 [INFO] [stdout] | [INFO] [stdout] 91 | if val == &('a' as u8) { [INFO] [stdout] | ^^^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:119:39 [INFO] [stdout] | [INFO] [stdout] 119 | let neighbors = get_neighbors(&grid, ¤t_coord); [INFO] [stdout] | ^^^^^ help: change this to: `grid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:140:32 [INFO] [stdout] | [INFO] [stdout] 140 | let cf = came_from.get(¤t); [INFO] [stdout] | ^^^^^^^^ help: change this to: `current` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/day5.rs:7:46 [INFO] [stdout] | [INFO] [stdout] 7 | for (_, stack_row) in split_stacks.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 7 - for (_, stack_row) in split_stacks.iter().enumerate() { [INFO] [stdout] 7 + for stack_row in split_stacks.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> src/day20.rs:20:59 [INFO] [stdout] | [INFO] [stdout] 20 | let modified_index = modified.iter().position(|r| *r == original_value as *const i32).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(*r, original_value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] = note: `#[warn(clippy::ptr_eq)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> src/day20.rs:77:63 [INFO] [stdout] | [INFO] [stdout] 77 | let modified_index = modified.iter().position(|r| *r == original_value as *const i64).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(*r, original_value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day8.rs:12:10 [INFO] [stdout] | [INFO] [stdout] 12 | .map(|treeline| { [INFO] [stdout] | __________^ [INFO] [stdout] 13 | | size = treeline.len(); [INFO] [stdout] 14 | | treeline [INFO] [stdout] 15 | | .chars() [INFO] [stdout] ... | [INFO] [stdout] 18 | | }) [INFO] [stdout] 19 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 12 ~ .flat_map(|treeline| { [INFO] [stdout] 13 + size = treeline.len(); [INFO] [stdout] 14 + treeline [INFO] [stdout] 15 + .chars() [INFO] [stdout] 16 + .map(|tree| tree.to_digit(10).unwrap() as i32) [INFO] [stdout] 17 + .collect::>() [INFO] [stdout] 18 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day8.rs:52:10 [INFO] [stdout] | [INFO] [stdout] 52 | .map(|treeline| { [INFO] [stdout] | __________^ [INFO] [stdout] 53 | | size = treeline.len(); [INFO] [stdout] 54 | | treeline [INFO] [stdout] 55 | | .chars() [INFO] [stdout] ... | [INFO] [stdout] 58 | | }) [INFO] [stdout] 59 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 52 ~ .flat_map(|treeline| { [INFO] [stdout] 53 + size = treeline.len(); [INFO] [stdout] 54 + treeline [INFO] [stdout] 55 + .chars() [INFO] [stdout] 56 + .map(|tree| tree.to_digit(10).unwrap() as i32) [INFO] [stdout] 57 + .collect::>() [INFO] [stdout] 58 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `parse_score` doesn't need a mutable reference [INFO] [stdout] --> src/day8.rs:68:21 [INFO] [stdout] | [INFO] [stdout] 68 | parse_score(&mut row, &mut score); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 68 - parse_score(&mut row, &mut score); [INFO] [stdout] 68 + parse_score(&row, &mut score); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `parse_score` doesn't need a mutable reference [INFO] [stdout] --> src/day8.rs:69:21 [INFO] [stdout] | [INFO] [stdout] 69 | parse_score(&mut row.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 69 - parse_score(&mut row.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] 69 + parse_score(&row.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `parse_score` doesn't need a mutable reference [INFO] [stdout] --> src/day8.rs:73:21 [INFO] [stdout] | [INFO] [stdout] 73 | parse_score(&mut col, &mut score); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 73 - parse_score(&mut col, &mut score); [INFO] [stdout] 73 + parse_score(&col, &mut score); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/main.rs:20:16 [INFO] [stdout] | [INFO] [stdout] 20 | let days = vec![20]; [INFO] [stdout] | ^^^^^^^^ help: you can use an array directly: `[20]` [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: the function `parse_score` doesn't need a mutable reference [INFO] [stdout] --> src/day8.rs:74:21 [INFO] [stdout] | [INFO] [stdout] 74 | parse_score(&mut col.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 74 - parse_score(&mut col.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] 74 + parse_score(&col.slice_mut(s![..;-1]), &mut score.slice_mut(s![..;-1])); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/day8.rs:86:161 [INFO] [stdout] | [INFO] [stdout] 86 | ...se, Dim<[usize; 1]>>) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day20.rs:48:14 [INFO] [stdout] | [INFO] [stdout] 48 | for x in vec![1000, 2000, 3000] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1000, 2000, 3000]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day20.rs:107:14 [INFO] [stdout] | [INFO] [stdout] 107 | for x in vec![1000, 2000, 3000] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1000, 2000, 3000]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/day11.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | &monkies.push(monkey); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 113 | let _ = &monkies.push(monkey); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/day8.rs:96:148 [INFO] [stdout] | [INFO] [stdout] 96 | ...se, Dim<[usize; 1]>>) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/day8.rs:104:29 [INFO] [stdout] | [INFO] [stdout] 104 | while cursor > 0 && &row.slice(s![cursor]).into_scalar() < &tree { [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] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 104 - while cursor > 0 && &row.slice(s![cursor]).into_scalar() < &tree { [INFO] [stdout] 104 + while cursor > 0 && row.slice(s![cursor]).into_scalar() < tree { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day9.rs:66:10 [INFO] [stdout] | [INFO] [stdout] 66 | .map(|command| { [INFO] [stdout] | __________^ [INFO] [stdout] 67 | | let amount = command[1].parse::().unwrap(); [INFO] [stdout] 68 | | let mut tail_positions: Vec = Vec::new(); [INFO] [stdout] 69 | | for _ in 0..amount { [INFO] [stdout] ... | [INFO] [stdout] 89 | | }) [INFO] [stdout] 90 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 66 ~ .flat_map(|command| { [INFO] [stdout] 67 + let amount = command[1].parse::().unwrap(); [INFO] [stdout] 68 + let mut tail_positions: Vec = Vec::new(); [INFO] [stdout] 69 + for _ in 0..amount { [INFO] [stdout] 70 + match command[0] { [INFO] [stdout] 71 + "U" => head.y -= 1, [INFO] [stdout] 72 + "D" => head.y += 1, [INFO] [stdout] 73 + "L" => head.x -= 1, [INFO] [stdout] 74 + "R" => head.x += 1, [INFO] [stdout] 75 + _ => panic!("This should not happen!") [INFO] [stdout] 76 + } [INFO] [stdout] 77 + // dbg!(head); [INFO] [stdout] 78 + if !check_touching(head, tail) { [INFO] [stdout] 79 + tail = last_head_position; [INFO] [stdout] 80 + tail_positions.push(tail); // return tail so the map iterator can become a Vec with the tail history in it. [INFO] [stdout] 81 + } [INFO] [stdout] 82 + last_head_position = head; [INFO] [stdout] 83 + // display_grid(&vec![head, tail]); [INFO] [stdout] 84 + // dbg!(head); [INFO] [stdout] 85 + // dbg!(tail); [INFO] [stdout] 86 + // println!("=====") [INFO] [stdout] 87 + } [INFO] [stdout] 88 + tail_positions [INFO] [stdout] 89 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().count()` on a `Vec` [INFO] [stdout] --> src/day9.rs:98:8 [INFO] [stdout] | [INFO] [stdout] 98 | Ok(result.iter().count()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `result.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count [INFO] [stdout] = note: `#[warn(clippy::iter_count)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/day9.rs:110:10 [INFO] [stdout] | [INFO] [stdout] 110 | .map(|command| { [INFO] [stdout] | __________^ [INFO] [stdout] 111 | | let amount = command[1].parse::().unwrap(); [INFO] [stdout] 112 | | let mut tail_positions: Vec = Vec::new(); [INFO] [stdout] 113 | | let scope_tails: &mut Vec = &mut tails; [INFO] [stdout] ... | [INFO] [stdout] 133 | | }) [INFO] [stdout] 134 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 110 ~ .flat_map(|command| { [INFO] [stdout] 111 + let amount = command[1].parse::().unwrap(); [INFO] [stdout] 112 + let mut tail_positions: Vec = Vec::new(); [INFO] [stdout] 113 + let scope_tails: &mut Vec = &mut tails; [INFO] [stdout] 114 + for _ in 0..amount { [INFO] [stdout] 115 + match command[0] { [INFO] [stdout] 116 + "U" => scope_tails[0].y -= 1, [INFO] [stdout] 117 + "D" => scope_tails[0].y += 1, [INFO] [stdout] 118 + "L" => scope_tails[0].x -= 1, [INFO] [stdout] 119 + "R" => scope_tails[0].x += 1, [INFO] [stdout] 120 + _ => panic!("This should not happen!") [INFO] [stdout] 121 + } [INFO] [stdout] 122 + for i in 0..scope_tails.len() - 1 { [INFO] [stdout] 123 + let new_tail_position = update_tail(scope_tails[i], scope_tails[i+1]); [INFO] [stdout] 124 + last_positions[i+1] = scope_tails[i+1]; [INFO] [stdout] 125 + scope_tails[i+1] = new_tail_position; [INFO] [stdout] 126 + if i == scope_tails.len() - 2 { [INFO] [stdout] 127 + tail_positions.push(new_tail_position); [INFO] [stdout] 128 + } [INFO] [stdout] 129 + } [INFO] [stdout] 130 + last_positions[0] = scope_tails[0]; [INFO] [stdout] 131 + } [INFO] [stdout] 132 + tail_positions [INFO] [stdout] 133 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().count()` on a `Vec` [INFO] [stdout] --> src/day9.rs:143:8 [INFO] [stdout] | [INFO] [stdout] 143 | Ok(result.iter().count()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `result.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_count [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day11.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | return input; [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] 61 - return input; [INFO] [stdout] 61 + input [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day11.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | return input % result; [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] 63 - return input % result; [INFO] [stdout] 63 + input % result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day11.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | return input; [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] 65 - return input; [INFO] [stdout] 65 + input [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/day11.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | &monkies.push(monkey); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `monkies.push(monkey);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `current_monkey_items.get(0)` [INFO] [stdout] --> src/day11.rs:137:35 [INFO] [stdout] | [INFO] [stdout] 137 | let worry_level = current_monkey_items.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `current_monkey_items.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day11.rs:154:21 [INFO] [stdout] | [INFO] [stdout] 154 | new_worry_level = new_worry_level / 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `new_worry_level /= 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: unneeded late initialization [INFO] [stdout] --> src/day11.rs:164:17 [INFO] [stdout] | [INFO] [stdout] 164 | let new_monkey_id; [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 `new_monkey_id` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 164 ~ [INFO] [stdout] 165 ~ let new_monkey_id = if new_worry_level % current_monkey.test_divisible == 0 { [INFO] [stdout] 166 ~ current_monkey.if_true [INFO] [stdout] 167 | } else { [INFO] [stdout] 168 ~ current_monkey.if_false [INFO] [stdout] 169 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/day11.rs:165:20 [INFO] [stdout] | [INFO] [stdout] 165 | if new_worry_level % current_monkey.test_divisible == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `new_worry_level.is_multiple_of(current_monkey.test_divisible)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day12.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 52 | if !starting_col_option.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `starting_col_option.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day12.rs:58:12 [INFO] [stdout] | [INFO] [stdout] 58 | if !ending_col_option.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ending_col_option.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `starting_col_option` after checking its variant with `is_none` [INFO] [stdout] --> src/day12.rs:53:49 [INFO] [stdout] | [INFO] [stdout] 52 | if !starting_col_option.is_none() { [INFO] [stdout] | ----------------------------- the check is happening here [INFO] [stdout] 53 | starting_position = Coord {x: i, y: starting_col_option.unwrap(), value: 'a' as u8}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `starting_col_option` after checking its variant with `is_none` [INFO] [stdout] --> src/day12.rs:54:19 [INFO] [stdout] | [INFO] [stdout] 52 | if !starting_col_option.is_none() { [INFO] [stdout] | ----------------------------- the check is happening here [INFO] [stdout] 53 | starting_position = Coord {x: i, y: starting_col_option.unwrap(), value: 'a' as u8}; [INFO] [stdout] 54 | chars[starting_col_option.unwrap()] = 'a' as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `ending_col_option` after checking its variant with `is_none` [INFO] [stdout] --> src/day12.rs:59:47 [INFO] [stdout] | [INFO] [stdout] 58 | if !ending_col_option.is_none() { [INFO] [stdout] | --------------------------- the check is happening here [INFO] [stdout] 59 | ending_position = Coord {x: i, y: ending_col_option.unwrap(), value: 'z' as u8}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `ending_col_option` after checking its variant with `is_none` [INFO] [stdout] --> src/day12.rs:60:19 [INFO] [stdout] | [INFO] [stdout] 58 | if !ending_col_option.is_none() { [INFO] [stdout] | --------------------------- the check is happening here [INFO] [stdout] 59 | ending_position = Coord {x: i, y: ending_col_option.unwrap(), value: 'z' as u8}; [INFO] [stdout] 60 | chars[ending_col_option.unwrap()] = 'z' as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:53:86 [INFO] [stdout] | [INFO] [stdout] 53 | starting_position = Coord {x: i, y: starting_col_option.unwrap(), value: 'a' as u8}; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:54:51 [INFO] [stdout] | [INFO] [stdout] 54 | chars[starting_col_option.unwrap()] = 'a' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:59:82 [INFO] [stdout] | [INFO] [stdout] 59 | ending_position = Coord {x: i, y: ending_col_option.unwrap(), value: 'z' as u8}; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:60:49 [INFO] [stdout] | [INFO] [stdout] 60 | chars[ending_col_option.unwrap()] = 'z' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/day12.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 81 | let result = solve(starting_position, &grid, ending_position); [INFO] [stdout] | -------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 82 | result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 81 ~ [INFO] [stdout] 82 ~ solve(starting_position, &grid, ending_position) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day12.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | return results.first().copied(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 104 - return results.first().copied(); [INFO] [stdout] 104 + results.first().copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day12.rs:91:20 [INFO] [stdout] | [INFO] [stdout] 91 | if val == &('a' as u8) { [INFO] [stdout] | ^^^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:119:39 [INFO] [stdout] | [INFO] [stdout] 119 | let neighbors = get_neighbors(&grid, ¤t_coord); [INFO] [stdout] | ^^^^^ help: change this to: `grid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:140:32 [INFO] [stdout] | [INFO] [stdout] 140 | let cf = came_from.get(¤t); [INFO] [stdout] | ^^^^^^^^ help: change this to: `current` [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: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> src/day20.rs:20:59 [INFO] [stdout] | [INFO] [stdout] 20 | let modified_index = modified.iter().position(|r| *r == original_value as *const i32).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(*r, original_value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] = note: `#[warn(clippy::ptr_eq)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> src/day20.rs:77:63 [INFO] [stdout] | [INFO] [stdout] 77 | let modified_index = modified.iter().position(|r| *r == original_value as *const i64).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(*r, original_value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/main.rs:20:16 [INFO] [stdout] | [INFO] [stdout] 20 | let days = vec![20]; [INFO] [stdout] | ^^^^^^^^ help: you can use an array directly: `[20]` [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/day20.rs:48:14 [INFO] [stdout] | [INFO] [stdout] 48 | for x in vec![1000, 2000, 3000] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1000, 2000, 3000]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day20.rs:107:14 [INFO] [stdout] | [INFO] [stdout] 107 | for x in vec![1000, 2000, 3000] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1000, 2000, 3000]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/day11.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | &monkies.push(monkey); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 113 | let _ = &monkies.push(monkey); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.90s [INFO] running `Command { std: "docker" "inspect" "d5a2cd20fe8421df1340698e6213e2b9c7a24303320b68ba87e73eb6b3fe5a55", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d5a2cd20fe8421df1340698e6213e2b9c7a24303320b68ba87e73eb6b3fe5a55", kill_on_drop: false }` [INFO] [stdout] d5a2cd20fe8421df1340698e6213e2b9c7a24303320b68ba87e73eb6b3fe5a55