[INFO] cloning repository https://github.com/IiroP/AdventOfCode2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/IiroP/AdventOfCode2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIiroP%2FAdventOfCode2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIiroP%2FAdventOfCode2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 8d00253123f18bd826303aca7b2d0236cd788ae6 [INFO] linting IiroP/AdventOfCode2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIiroP%2FAdventOfCode2024" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/IiroP/AdventOfCode2024 [INFO] finished tweaking git repo https://github.com/IiroP/AdventOfCode2024 [INFO] tweaked toml for git repo https://github.com/IiroP/AdventOfCode2024 written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/IiroP/AdventOfCode2024 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/IiroP/AdventOfCode2024 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded cauchy v0.4.0 [INFO] [stderr] Downloaded openblas-src v0.10.10 [INFO] [stderr] Downloaded thiserror v2.0.6 [INFO] [stderr] Downloaded thiserror-impl v2.0.6 [INFO] [stderr] Downloaded openblas-build v0.10.10 [INFO] [stderr] Downloaded lax v0.16.0 [INFO] [stderr] Downloaded ndarray-linalg v0.16.0 [INFO] [stderr] Downloaded cblas-sys v0.1.4 [INFO] [stderr] Downloaded rustix v0.38.38 [INFO] [stderr] Downloaded katexit v0.1.4 [INFO] [stderr] Downloaded tar v0.4.43 [INFO] [stderr] Downloaded lapack-sys v0.14.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 888b404c635dd8323b523f7b94fc739563e2523bd40210fc676f0201ca61e26b [INFO] running `Command { std: "docker" "start" "-a" "888b404c635dd8323b523f7b94fc739563e2523bd40210fc676f0201ca61e26b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "888b404c635dd8323b523f7b94fc739563e2523bd40210fc676f0201ca61e26b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "888b404c635dd8323b523f7b94fc739563e2523bd40210fc676f0201ca61e26b", kill_on_drop: false }` [INFO] [stdout] 888b404c635dd8323b523f7b94fc739563e2523bd40210fc676f0201ca61e26b [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 8b03ea388d9a9eb41b7149d41a350b4ba63622426d731bd442270b7ffca5f86b [INFO] running `Command { std: "docker" "start" "-a" "8b03ea388d9a9eb41b7149d41a350b4ba63622426d731bd442270b7ffca5f86b", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.168 [INFO] [stderr] Compiling openssl v0.10.68 [INFO] [stderr] Compiling rustix v0.38.38 [INFO] [stderr] Compiling openssl-probe v0.1.5 [INFO] [stderr] Compiling cc v1.1.31 [INFO] [stderr] Compiling tinyvec v1.8.0 [INFO] [stderr] Compiling linux-raw-sys v0.4.14 [INFO] [stderr] Compiling once_cell v1.20.2 [INFO] [stderr] Compiling unicode-bidi v0.3.17 [INFO] [stderr] Compiling rustls-pki-types v1.10.0 [INFO] [stderr] Compiling miniz_oxide v0.8.0 [INFO] [stderr] Compiling anyhow v1.0.91 [INFO] [stderr] Compiling syn v2.0.90 [INFO] [stderr] Compiling thiserror v2.0.6 [INFO] [stderr] Compiling serde v1.0.216 [INFO] [stderr] Compiling option-ext v0.2.0 [INFO] [stderr] Compiling matrixmultiply v0.3.9 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking rawpointer v0.2.1 [INFO] [stderr] Checking approx v0.4.0 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Compiling rustls-pemfile v2.2.0 [INFO] [stderr] Compiling flate2 v1.0.34 [INFO] [stderr] Compiling rustls-native-certs v0.7.3 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking cblas-sys v0.1.4 [INFO] [stderr] Checking lapack-sys v0.14.0 [INFO] [stderr] Compiling unicode-normalization v0.1.24 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling filetime v0.2.23 [INFO] [stderr] Compiling dirs-sys v0.4.1 [INFO] [stderr] Compiling dirs v5.0.1 [INFO] [stderr] Compiling openssl-sys v0.9.104 [INFO] [stderr] Compiling idna v0.5.0 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Compiling url v2.5.2 [INFO] [stderr] Compiling native-tls v0.2.12 [INFO] [stderr] Compiling katexit v0.1.4 [INFO] [stderr] Compiling xattr v1.3.1 [INFO] [stderr] Compiling tar v0.4.43 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Compiling thiserror-impl v2.0.6 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking ppv-lite86 v0.2.20 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking num-complex v0.4.6 [INFO] [stderr] Checking cauchy v0.4.0 [INFO] [stderr] Checking ndarray v0.15.6 [INFO] [stderr] Compiling ureq v2.12.1 [INFO] [stderr] Compiling openblas-build v0.10.10 [INFO] [stderr] Compiling openblas-src v0.10.10 [INFO] [stderr] Checking lax v0.16.0 [INFO] [stderr] Checking ndarray-linalg v0.16.0 [INFO] [stderr] Checking aoc2024 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:16:41 [INFO] [stdout] | [INFO] [stdout] 16 | fn process_input(input: Vec) -> ((i32, i32), HashSet<(i32, i32)>, Vec) { [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: the loop variable `y` is used to index `input` [INFO] [stdout] --> src/bin/day06.rs:21:14 [INFO] [stdout] | [INFO] [stdout] 21 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 21 - for y in 0..height { [INFO] [stdout] 21 + for (y, ) in input.iter().enumerate().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:36:23 [INFO] [stdout] | [INFO] [stdout] 36 | fn _sample_input() -> ((i32, i32), HashSet<(i32, i32)>, Vec) { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:54:19 [INFO] [stdout] | [INFO] [stdout] 54 | fn day_input() -> ((i32, i32), HashSet<(i32, i32)>, Vec) { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:107:17 [INFO] [stdout] | [INFO] [stdout] 107 | fn part1(input: &((i32, i32), HashSet<(i32, i32)>, Vec)) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | fn part2(input: &((i32, i32), HashSet<(i32, i32)>, Vec)) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day06.rs:175:64 [INFO] [stdout] | [INFO] [stdout] 175 | let stone = move_guard_stateless(current.0, current.1, &obstacles).0; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `obstacles` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day06.rs:177:45 [INFO] [stdout] | [INFO] [stdout] 177 | if check_loop(current.0, current.1, &obstacles, width, height, &visited) { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `obstacles` [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/bin/day07.rs:54:36 [INFO] [stdout] | [INFO] [stdout] 54 | fn total_calibration_result(input: &Vec<(i64, Vec)>, operations: Vec<&str>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn total_calibration_result(input: &Vec<(i64, Vec)>, operations: Vec<&str>) -> i64 { [INFO] [stdout] 54 + fn total_calibration_result(input: &[(i64, Vec)], operations: Vec<&str>) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `bool::then` in `filter_map` [INFO] [stdout] --> src/bin/day07.rs:57:10 [INFO] [stdout] | [INFO] [stdout] 57 | .filter_map(|(target, values)| { [INFO] [stdout] | __________^ [INFO] [stdout] 58 | | (0..values.len()) [INFO] [stdout] 59 | | .map(|_| &operations) [INFO] [stdout] 60 | | .multi_cartesian_product() [INFO] [stdout] ... | [INFO] [stdout] 75 | | .then(|| target) [INFO] [stdout] 76 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_bool_then [INFO] [stdout] = note: `#[warn(clippy::filter_map_bool_then)]` on by default [INFO] [stdout] help: use `filter` then `map` instead [INFO] [stdout] | [INFO] [stdout] 57 ~ .filter(|&(target, values)| (0..values.len()) [INFO] [stdout] 58 + .map(|_| &operations) [INFO] [stdout] 59 + .multi_cartesian_product() [INFO] [stdout] 60 + .any(|i| { [INFO] [stdout] 61 + let mut iter = i.iter(); [INFO] [stdout] 62 + let result = values [INFO] [stdout] 63 + .iter() [INFO] [stdout] 64 + .copied() [INFO] [stdout] 65 + .reduce(|total, next| match **iter.next().unwrap() { [INFO] [stdout] 66 + "add" => total + next, [INFO] [stdout] 67 + "mul" => total * next, [INFO] [stdout] 68 + "cat" => format!("{total}{next}").parse().unwrap(), [INFO] [stdout] 69 + _ => panic!("Unknown operation"), [INFO] [stdout] 70 + }) [INFO] [stdout] 71 + .unwrap(); [INFO] [stdout] 72 + result == *target [INFO] [stdout] 73 + })).map(|(target, values)| target) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/bin/day07.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / (0..values.len()) [INFO] [stdout] 59 | | .map(|_| &operations) [INFO] [stdout] 60 | | .multi_cartesian_product() [INFO] [stdout] 61 | | .any(|i| { [INFO] [stdout] ... | [INFO] [stdout] 74 | | }) [INFO] [stdout] 75 | | .then(|| target) [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 75 - .then(|| target) [INFO] [stdout] 75 + .then_some(target) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day02.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | fn check_report(v: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 48 - fn check_report(v: &Vec) -> bool { [INFO] [stdout] 48 + fn check_report(v: &[i64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day02.rs:52:17 [INFO] [stdout] | [INFO] [stdout] 52 | fn part1(input: &Vec>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 52 - fn part1(input: &Vec>) -> i64 { [INFO] [stdout] 52 + fn part1(input: &[Vec]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day02.rs:69:17 [INFO] [stdout] | [INFO] [stdout] 69 | fn part2(input: &Vec>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 69 - fn part2(input: &Vec>) -> i64 { [INFO] [stdout] 69 + fn part2(input: &[Vec]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day02.rs:71:25 [INFO] [stdout] | [INFO] [stdout] 71 | fn check_removed(v: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 ~ fn check_removed(v: &[i64]) -> bool { [INFO] [stdout] 72 | for i in 0..v.len() { [INFO] [stdout] 73 ~ let mut v = v.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/day02.rs:84:28 [INFO] [stdout] | [INFO] [stdout] 84 | let reversed = v.iter().rev().map(|a| *a).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `v.iter().rev().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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:20:41 [INFO] [stdout] | [INFO] [stdout] 20 | fn process_input(input: Vec) -> (usize, usize, HashMap>) { [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: use of `or_insert` to construct default value [INFO] [stdout] --> src/bin/day08.rs:27:35 [INFO] [stdout] | [INFO] [stdout] 27 | antennas.entry(c).or_insert(Vec::new()).push((x, y)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:35:23 [INFO] [stdout] | [INFO] [stdout] 35 | fn _sample_input() -> (usize, usize, HashMap>) { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:55:19 [INFO] [stdout] | [INFO] [stdout] 55 | fn day_input() -> (usize, usize, HashMap>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day08.rs:59:24 [INFO] [stdout] | [INFO] [stdout] 59 | fn antinodes(antennas: &Vec<(usize, usize)>, width: i32, height: i32) -> HashSet<(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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn antinodes(antennas: &Vec<(usize, usize)>, width: i32, height: i32) -> HashSet<(usize, usize)> { [INFO] [stdout] 59 + fn antinodes(antennas: &[(usize, usize)], width: i32, height: i32) -> HashSet<(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/bin/day08.rs:76:25 [INFO] [stdout] | [INFO] [stdout] 76 | fn antinodes2(antennas: &Vec<(usize, usize)>, width: i32, height: i32) -> HashSet<(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] 76 - fn antinodes2(antennas: &Vec<(usize, usize)>, width: i32, height: i32) -> HashSet<(usize, usize)> { [INFO] [stdout] 76 + fn antinodes2(antennas: &[(usize, usize)], width: i32, height: i32) -> HashSet<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:102:17 [INFO] [stdout] | [INFO] [stdout] 102 | fn part1(input: &(usize, usize, HashMap>)) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/bin/day08.rs:105:27 [INFO] [stdout] | [INFO] [stdout] 105 | for (_, positions) in antennas { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 105 - for (_, positions) in antennas { [INFO] [stdout] 105 + for positions in antennas.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:111:17 [INFO] [stdout] | [INFO] [stdout] 111 | fn part2(input: &(usize, usize, HashMap>)) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/bin/day08.rs:114:27 [INFO] [stdout] | [INFO] [stdout] 114 | for (_, positions) in antennas { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 114 - for (_, positions) in antennas { [INFO] [stdout] 114 + for positions in antennas.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day15.rs:28:12 [INFO] [stdout] | [INFO] [stdout] 28 | if chars.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `chars.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:97:12 [INFO] [stdout] | [INFO] [stdout] 97 | walls: &Vec<(i64, i64)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 97 - walls: &Vec<(i64, i64)>, [INFO] [stdout] 97 + walls: &[(i64, i64)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:233:20 [INFO] [stdout] | [INFO] [stdout] 233 | fn draw_map(boxes: &Vec<(i64, i64)>, walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 233 - fn draw_map(boxes: &Vec<(i64, i64)>, walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] 233 + fn draw_map(boxes: &[(i64, i64)], walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:233:45 [INFO] [stdout] | [INFO] [stdout] 233 | fn draw_map(boxes: &Vec<(i64, i64)>, walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 233 - fn draw_map(boxes: &Vec<(i64, i64)>, walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] 233 + fn draw_map(boxes: &Vec<(i64, i64)>, walls: &[(i64, i64)], robot: (i64, i64)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day04.rs:43:21 [INFO] [stdout] | [INFO] [stdout] 43 | fn transpose(input: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 43 - fn transpose(input: &Vec) -> Vec { [INFO] [stdout] 43 + fn transpose(input: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `input` [INFO] [stdout] --> src/bin/day04.rs:47:18 [INFO] [stdout] | [INFO] [stdout] 47 | for j in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 47 - for j in 0..input.len() { [INFO] [stdout] 47 + for in &input { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day04.rs:56:21 [INFO] [stdout] | [INFO] [stdout] 56 | fn diagonals(input: &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] 56 - fn diagonals(input: &Vec) -> Vec { [INFO] [stdout] 56 + fn diagonals(input: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `input` [INFO] [stdout] --> src/bin/day04.rs:61:18 [INFO] [stdout] | [INFO] [stdout] 61 | for y in 0..(input.len() - x) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 61 - for y in 0..(input.len() - x) { [INFO] [stdout] 61 + for (y, ) in input.iter().enumerate().take((input.len() - x)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `input` [INFO] [stdout] --> src/bin/day04.rs:69:18 [INFO] [stdout] | [INFO] [stdout] 69 | for y in 0..(x + 1) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 69 - for y in 0..(x + 1) { [INFO] [stdout] 69 + for (y, ) in input.iter().enumerate().take((x + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day18.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | return (dist, prev); [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] 96 - return (dist, prev); [INFO] [stdout] 96 + (dist, prev) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day15.rs:28:12 [INFO] [stdout] | [INFO] [stdout] 28 | if chars.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `chars.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day04.rs:100:33 [INFO] [stdout] | [INFO] [stdout] 100 | fn count_occurences(source: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - fn count_occurences(source: &Vec) -> i64 { [INFO] [stdout] 100 + fn count_occurences(source: &[String]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day04.rs:115:17 [INFO] [stdout] | [INFO] [stdout] 115 | fn part2(input: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 115 - fn part2(input: &Vec) -> i64 { [INFO] [stdout] 115 + fn part2(input: &[String]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:68:15 [INFO] [stdout] | [INFO] [stdout] 68 | vertices: &Vec<(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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 68 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 68 + vertices: &[(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/bin/day18.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | neighbors: &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] 69 - neighbors: &Vec>, [INFO] [stdout] 69 + neighbors: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day18.rs:76:11 [INFO] [stdout] | [INFO] [stdout] 76 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.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: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day04.rs:123:58 [INFO] [stdout] | [INFO] [stdout] 123 | .fold(String::new(), |t, y1| t + &input[y1][x..x + 3].to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&input[y1][x..x + 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:97:12 [INFO] [stdout] | [INFO] [stdout] 97 | walls: &Vec<(i64, i64)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 97 - walls: &Vec<(i64, i64)>, [INFO] [stdout] 97 + walls: &[(i64, i64)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:100:15 [INFO] [stdout] | [INFO] [stdout] 100 | vertices: &Vec<(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] 100 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 100 + vertices: &[(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/bin/day18.rs:101:13 [INFO] [stdout] | [INFO] [stdout] 101 | stones: &Vec<(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] 101 - stones: &Vec<(usize, usize)>, [INFO] [stdout] 101 + stones: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day18.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | return (dist, prev); [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] 96 - return (dist, prev); [INFO] [stdout] 96 + (dist, prev) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:68:15 [INFO] [stdout] | [INFO] [stdout] 68 | vertices: &Vec<(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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 68 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 68 + vertices: &[(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/bin/day18.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | neighbors: &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] 69 - neighbors: &Vec>, [INFO] [stdout] 69 + neighbors: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day18.rs:76:11 [INFO] [stdout] | [INFO] [stdout] 76 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:130:17 [INFO] [stdout] | [INFO] [stdout] 130 | fn part1(input: &Vec<(usize, usize)>, test: bool) -> u64 { [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] 130 - fn part1(input: &Vec<(usize, usize)>, test: bool) -> u64 { [INFO] [stdout] 130 + fn part1(input: &[(usize, usize)], test: bool) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:140:17 [INFO] [stdout] | [INFO] [stdout] 140 | fn part2(input: &Vec<(usize, usize)>, test: bool) -> (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] 140 - fn part2(input: &Vec<(usize, usize)>, test: bool) -> (usize, usize) { [INFO] [stdout] 140 + fn part2(input: &[(usize, usize)], test: bool) -> (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/bin/day15.rs:233:20 [INFO] [stdout] | [INFO] [stdout] 233 | fn draw_map(boxes: &Vec<(i64, i64)>, walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 233 - fn draw_map(boxes: &Vec<(i64, i64)>, walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] 233 + fn draw_map(boxes: &[(i64, i64)], walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:100:15 [INFO] [stdout] | [INFO] [stdout] 100 | vertices: &Vec<(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] 100 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 100 + vertices: &[(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/bin/day18.rs:101:13 [INFO] [stdout] | [INFO] [stdout] 101 | stones: &Vec<(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] 101 - stones: &Vec<(usize, usize)>, [INFO] [stdout] 101 + stones: &[(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/bin/day18.rs:130:17 [INFO] [stdout] | [INFO] [stdout] 130 | fn part1(input: &Vec<(usize, usize)>, test: bool) -> u64 { [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] 130 - fn part1(input: &Vec<(usize, usize)>, test: bool) -> u64 { [INFO] [stdout] 130 + fn part1(input: &[(usize, usize)], test: bool) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:140:17 [INFO] [stdout] | [INFO] [stdout] 140 | fn part2(input: &Vec<(usize, usize)>, test: bool) -> (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] 140 - fn part2(input: &Vec<(usize, usize)>, test: bool) -> (usize, usize) { [INFO] [stdout] 140 + fn part2(input: &[(usize, usize)], test: bool) -> (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/bin/day15.rs:233:45 [INFO] [stdout] | [INFO] [stdout] 233 | fn draw_map(boxes: &Vec<(i64, i64)>, walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 233 - fn draw_map(boxes: &Vec<(i64, i64)>, walls: &Vec<(i64, i64)>, robot: (i64, i64)) { [INFO] [stdout] 233 + fn draw_map(boxes: &Vec<(i64, i64)>, walls: &[(i64, i64)], robot: (i64, i64)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/bin/day05.rs:17:52 [INFO] [stdout] | [INFO] [stdout] 17 | let splitted: Vec<&[String]> = input.split(|v| v == "").collect(); [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `v.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day05.rs:117:32 [INFO] [stdout] | [INFO] [stdout] 117 | if !remaining.contains(&n) { [INFO] [stdout] | ^^ help: change this to: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day05.rs:120:36 [INFO] [stdout] | [INFO] [stdout] 120 | } else if visited.contains(&n) { [INFO] [stdout] | ^^ help: change this to: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day05.rs:130:26 [INFO] [stdout] | [INFO] [stdout] 130 | remaining.remove(&n); [INFO] [stdout] | ^^ help: change this to: `n` [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: importing legacy numeric constants [INFO] [stdout] --> src/bin/day23.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, usize}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day09.rs:81:36 [INFO] [stdout] | [INFO] [stdout] 81 | fn generate_numbers_rev(files: &Vec<(i64, i64)>) -> impl Iterator + '_ { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 81 - fn generate_numbers_rev(files: &Vec<(i64, i64)>) -> impl Iterator + '_ { [INFO] [stdout] 81 + fn generate_numbers_rev(files: &[(i64, i64)]) -> impl Iterator + '_ { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/bin/day09.rs:85:40 [INFO] [stdout] | [INFO] [stdout] 85 | .flat_map(|&(number, len)| repeat(number).take(len as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(number, len as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` 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/bin/day23.rs:21:28 [INFO] [stdout] | [INFO] [stdout] 21 | let value_tuple = (value.chars().nth(0).unwrap(), value.chars().nth(1).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `value.chars().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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day09.rs:129:54 [INFO] [stdout] | [INFO] [stdout] 129 | fn move_file(file: &(i64, i64, i64, i64), files: &mut Vec<(i64, i64, i64, i64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 129 - fn move_file(file: &(i64, i64, i64, i64), files: &mut Vec<(i64, i64, i64, i64)>) { [INFO] [stdout] 129 + fn move_file(file: &(i64, i64, i64, i64), files: &mut [(i64, i64, i64, i64)]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day23.rs:97:24 [INFO] [stdout] | [INFO] [stdout] 97 | fn find_cliques(edges: &Vec<(usize, usize)>) -> Vec<[usize; 3]> { [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] 97 - fn find_cliques(edges: &Vec<(usize, usize)>) -> Vec<[usize; 3]> { [INFO] [stdout] 97 + fn find_cliques(edges: &[(usize, usize)]) -> Vec<[usize; 3]> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/bin/day09.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | files.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 151 - files.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] 151 + files.sort_by_key(|a| a.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day23.rs:118:14 [INFO] [stdout] | [INFO] [stdout] 118 | current: &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] 118 - current: &Vec, [INFO] [stdout] 118 + current: &[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/bin/day23.rs:119:15 [INFO] [stdout] | [INFO] [stdout] 119 | vertices: &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] 119 - vertices: &Vec, [INFO] [stdout] 119 + vertices: &[Vertex], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day23.rs:120:12 [INFO] [stdout] | [INFO] [stdout] 120 | edges: &Vec<(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] 120 - edges: &Vec<(usize, usize)>, [INFO] [stdout] 120 + edges: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/day11.rs:41:8 [INFO] [stdout] | [INFO] [stdout] 41 | if value_text.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `value_text.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day11.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | fn part1(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 63 ~ fn part1(input: &[u64]) -> usize { [INFO] [stdout] 64 ~ let mut current = input.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/day11.rs:66:34 [INFO] [stdout] | [INFO] [stdout] 66 | current = current.iter().map(|v| update_stone(*v)).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|v| update_stone(*v))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day11.rs:71:17 [INFO] [stdout] | [INFO] [stdout] 71 | fn part2(input: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - fn part2(input: &Vec) -> u64 { [INFO] [stdout] 71 + fn part2(input: &[u64]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/bin/day11.rs:87:37 [INFO] [stdout] | [INFO] [stdout] 87 | current.iter().map(|(_, count)| *count as u64).sum() [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `*count` [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: comparison to empty slice [INFO] [stdout] --> src/bin/day05.rs:17:52 [INFO] [stdout] | [INFO] [stdout] 17 | let splitted: Vec<&[String]> = input.split(|v| v == "").collect(); [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `v.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day05.rs:117:32 [INFO] [stdout] | [INFO] [stdout] 117 | if !remaining.contains(&n) { [INFO] [stdout] | ^^ help: change this to: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day05.rs:120:36 [INFO] [stdout] | [INFO] [stdout] 120 | } else if visited.contains(&n) { [INFO] [stdout] | ^^ help: change this to: `n` [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::str::Chars<'_>` [INFO] [stdout] --> src/bin/day21.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / s.chars() [INFO] [stdout] 219 | | .into_iter() [INFO] [stdout] | |________________________________^ help: consider removing `.into_iter()`: `s.chars()` [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 creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day05.rs:130:26 [INFO] [stdout] | [INFO] [stdout] 130 | remaining.remove(&n); [INFO] [stdout] | ^^ help: change this to: `n` [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 `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day21.rs:256:11 [INFO] [stdout] | [INFO] [stdout] 256 | line: &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] 256 - line: &String, [INFO] [stdout] 256 + line: &str, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day21.rs:276:32 [INFO] [stdout] | [INFO] [stdout] 276 | fn calculate_keypresses(input: &Vec, directional_robots: usize) -> u64 { [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] 276 - fn calculate_keypresses(input: &Vec, directional_robots: usize) -> u64 { [INFO] [stdout] 276 + fn calculate_keypresses(input: &[String], directional_robots: usize) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/bin/day21.rs:289:21 [INFO] [stdout] | [INFO] [stdout] 289 | / choice [INFO] [stdout] 290 | | .chars() [INFO] [stdout] 291 | | .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] 289 ~ choice [INFO] [stdout] 290 + .chars() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day25.rs:19:16 [INFO] [stdout] | [INFO] [stdout] 19 | input: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 19 - input: &Vec, [INFO] [stdout] 19 + input: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `counts` [INFO] [stdout] --> src/bin/day25.rs:26:24 [INFO] [stdout] | [INFO] [stdout] 26 | for col in 0..5 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 26 - for col in 0..5 { [INFO] [stdout] 26 + for (col, ) in counts.iter_mut().enumerate().take(5) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `counts` [INFO] [stdout] --> src/bin/day25.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 35 | for i in 0..5 { [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] 35 - for i in 0..5 { [INFO] [stdout] 35 + for in counts.iter_mut().take(5) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day07.rs:54:36 [INFO] [stdout] | [INFO] [stdout] 54 | fn total_calibration_result(input: &Vec<(i64, Vec)>, operations: Vec<&str>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn total_calibration_result(input: &Vec<(i64, Vec)>, operations: Vec<&str>) -> i64 { [INFO] [stdout] 54 + fn total_calibration_result(input: &[(i64, Vec)], operations: Vec<&str>) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `bool::then` in `filter_map` [INFO] [stdout] --> src/bin/day07.rs:57:10 [INFO] [stdout] | [INFO] [stdout] 57 | .filter_map(|(target, values)| { [INFO] [stdout] | __________^ [INFO] [stdout] 58 | | (0..values.len()) [INFO] [stdout] 59 | | .map(|_| &operations) [INFO] [stdout] 60 | | .multi_cartesian_product() [INFO] [stdout] ... | [INFO] [stdout] 75 | | .then(|| target) [INFO] [stdout] 76 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_bool_then [INFO] [stdout] = note: `#[warn(clippy::filter_map_bool_then)]` on by default [INFO] [stdout] help: use `filter` then `map` instead [INFO] [stdout] | [INFO] [stdout] 57 ~ .filter(|&(target, values)| (0..values.len()) [INFO] [stdout] 58 + .map(|_| &operations) [INFO] [stdout] 59 + .multi_cartesian_product() [INFO] [stdout] 60 + .any(|i| { [INFO] [stdout] 61 + let mut iter = i.iter(); [INFO] [stdout] 62 + let result = values [INFO] [stdout] 63 + .iter() [INFO] [stdout] 64 + .copied() [INFO] [stdout] 65 + .reduce(|total, next| match **iter.next().unwrap() { [INFO] [stdout] 66 + "add" => total + next, [INFO] [stdout] 67 + "mul" => total * next, [INFO] [stdout] 68 + "cat" => format!("{total}{next}").parse().unwrap(), [INFO] [stdout] 69 + _ => panic!("Unknown operation"), [INFO] [stdout] 70 + }) [INFO] [stdout] 71 + .unwrap(); [INFO] [stdout] 72 + result == *target [INFO] [stdout] 73 + })).map(|(target, values)| target) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/bin/day07.rs:58:13 [INFO] [stdout] | [INFO] [stdout] 58 | / (0..values.len()) [INFO] [stdout] 59 | | .map(|_| &operations) [INFO] [stdout] 60 | | .multi_cartesian_product() [INFO] [stdout] 61 | | .any(|i| { [INFO] [stdout] ... | [INFO] [stdout] 74 | | }) [INFO] [stdout] 75 | | .then(|| target) [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 75 - .then(|| target) [INFO] [stdout] 75 + .then_some(target) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day19.rs:77:8 [INFO] [stdout] | [INFO] [stdout] 77 | if pattern.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `pattern.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: length comparison to zero [INFO] [stdout] --> src/bin/day19.rs:108:8 [INFO] [stdout] | [INFO] [stdout] 108 | if pattern.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `pattern.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day25.rs:19:16 [INFO] [stdout] | [INFO] [stdout] 19 | input: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 19 - input: &Vec, [INFO] [stdout] 19 + input: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `counts` [INFO] [stdout] --> src/bin/day25.rs:26:24 [INFO] [stdout] | [INFO] [stdout] 26 | for col in 0..5 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 26 - for col in 0..5 { [INFO] [stdout] 26 + for (col, ) in counts.iter_mut().enumerate().take(5) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `counts` [INFO] [stdout] --> src/bin/day25.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 35 | for i in 0..5 { [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] 35 - for i in 0..5 { [INFO] [stdout] 35 + for in counts.iter_mut().take(5) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day02.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | fn check_report(v: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 48 - fn check_report(v: &Vec) -> bool { [INFO] [stdout] 48 + fn check_report(v: &[i64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day02.rs:52:17 [INFO] [stdout] | [INFO] [stdout] 52 | fn part1(input: &Vec>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 52 - fn part1(input: &Vec>) -> i64 { [INFO] [stdout] 52 + fn part1(input: &[Vec]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day02.rs:69:17 [INFO] [stdout] | [INFO] [stdout] 69 | fn part2(input: &Vec>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 69 - fn part2(input: &Vec>) -> i64 { [INFO] [stdout] 69 + fn part2(input: &[Vec]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day02.rs:71:25 [INFO] [stdout] | [INFO] [stdout] 71 | fn check_removed(v: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 ~ fn check_removed(v: &[i64]) -> bool { [INFO] [stdout] 72 | for i in 0..v.len() { [INFO] [stdout] 73 ~ let mut v = v.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/day02.rs:84:28 [INFO] [stdout] | [INFO] [stdout] 84 | let reversed = v.iter().rev().map(|a| *a).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `v.iter().rev().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day24.rs:32:50 [INFO] [stdout] | [INFO] [stdout] 32 | if let Some(captures) = initial.captures(&line) { [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] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day24.rs:43:60 [INFO] [stdout] | [INFO] [stdout] 43 | } else if let Some(captures) = connection.captures(&line) { [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/bin/day24.rs:100:24 [INFO] [stdout] | [INFO] [stdout] 100 | fn evaluate_all(gates: &Vec, map: &mut HashMap<[char; 3], bool>) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - fn evaluate_all(gates: &Vec, map: &mut HashMap<[char; 3], bool>) { [INFO] [stdout] 100 + fn evaluate_all(gates: &[Gate], map: &mut HashMap<[char; 3], bool>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day24.rs:118:22 [INFO] [stdout] | [INFO] [stdout] 118 | fn name_gates(gates: &Vec) -> HashMap<[char; 3], String> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 118 - fn name_gates(gates: &Vec) -> HashMap<[char; 3], String> { [INFO] [stdout] 118 + fn name_gates(gates: &[Gate]) -> HashMap<[char; 3], String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:136:58 [INFO] [stdout] | [INFO] [stdout] 136 | names.insert(g.target, format!("c{:02}", &left[1..])); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:135:13 [INFO] [stdout] | [INFO] [stdout] 135 | if left.starts_with('A') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 135 ~ if let Some() = left.strip_prefix('A') { [INFO] [stdout] 136 ~ names.insert(g.target, format!("c{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `input` [INFO] [stdout] --> src/bin/day20.rs:29:14 [INFO] [stdout] | [INFO] [stdout] 29 | for y in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 29 - for y in 0..input.len() { [INFO] [stdout] 29 + for (y, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:138:58 [INFO] [stdout] | [INFO] [stdout] 138 | names.insert(g.target, format!("c{:02}", &right[1..])); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:137:20 [INFO] [stdout] | [INFO] [stdout] 137 | } else if right.starts_with('A') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 137 ~ } else if let Some() = right.strip_prefix('A') { [INFO] [stdout] 138 ~ names.insert(g.target, format!("c{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day20.rs:107:5 [INFO] [stdout] | [INFO] [stdout] 107 | return (dist, prev); [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] 107 - return (dist, prev); [INFO] [stdout] 107 + (dist, prev) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:140:58 [INFO] [stdout] | [INFO] [stdout] 140 | names.insert(g.target, format!("c{:02}", &left[1..])); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:139:20 [INFO] [stdout] | [INFO] [stdout] 139 | } else if left.starts_with('d') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 139 ~ } else if let Some() = left.strip_prefix('d') { [INFO] [stdout] 140 ~ names.insert(g.target, format!("c{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:142:58 [INFO] [stdout] | [INFO] [stdout] 142 | names.insert(g.target, format!("c{:02}", &right[1..])); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:141:20 [INFO] [stdout] | [INFO] [stdout] 141 | } else if right.starts_with('d') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 141 ~ } else if let Some() = right.strip_prefix('d') { [INFO] [stdout] 142 ~ names.insert(g.target, format!("c{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:146:58 [INFO] [stdout] | [INFO] [stdout] 146 | names.insert(g.target, format!("d{:02}", &left[1..])); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | if left.starts_with('X') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 145 ~ if let Some() = left.strip_prefix('X') { [INFO] [stdout] 146 ~ names.insert(g.target, format!("d{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day12.rs:20:35 [INFO] [stdout] | [INFO] [stdout] 20 | .filter(|row: &Vec| row.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!row.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day12.rs:53:12 [INFO] [stdout] | [INFO] [stdout] 53 | input: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 53 - input: &Vec>, [INFO] [stdout] 53 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:148:58 [INFO] [stdout] | [INFO] [stdout] 148 | names.insert(g.target, format!("d{:02}", &right[1..])); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:147:20 [INFO] [stdout] | [INFO] [stdout] 147 | } else if right.starts_with('X') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 147 ~ } else if let Some() = right.strip_prefix('X') { [INFO] [stdout] 148 ~ names.insert(g.target, format!("d{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:152:40 [INFO] [stdout] | [INFO] [stdout] 152 | format!("d{:02}", &left[1..].parse::().unwrap() + 1), [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:149:20 [INFO] [stdout] | [INFO] [stdout] 149 | } else if left.starts_with('c') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 149 ~ } else if let Some() = left.strip_prefix('c') { [INFO] [stdout] 150 | names.insert( [INFO] [stdout] 151 | g.target, [INFO] [stdout] 152 ~ format!("d{:02}", &.parse::().unwrap() + 1), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:79:15 [INFO] [stdout] | [INFO] [stdout] 79 | vertices: &Vec<(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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 79 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 79 + vertices: &[(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/bin/day20.rs:80:16 [INFO] [stdout] | [INFO] [stdout] 80 | neighbors: &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] 80 - neighbors: &Vec>, [INFO] [stdout] 80 + neighbors: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day20.rs:87:11 [INFO] [stdout] | [INFO] [stdout] 87 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.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: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:157:40 [INFO] [stdout] | [INFO] [stdout] 157 | format!("d{:02}", &right[1..].parse::().unwrap() + 1), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:154:20 [INFO] [stdout] | [INFO] [stdout] 154 | } else if right.starts_with('c') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 154 ~ } else if let Some() = right.strip_prefix('c') { [INFO] [stdout] 155 | names.insert( [INFO] [stdout] 156 | g.target, [INFO] [stdout] 157 ~ format!("d{:02}", &.parse::().unwrap() + 1), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:111:15 [INFO] [stdout] | [INFO] [stdout] 111 | vertices: &Vec<(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] 111 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 111 + vertices: &[(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/bin/day20.rs:112:12 [INFO] [stdout] | [INFO] [stdout] 112 | walls: &Vec<(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] 112 - walls: &Vec<(usize, usize)>, [INFO] [stdout] 112 + walls: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:162:58 [INFO] [stdout] | [INFO] [stdout] 162 | names.insert(g.target, format!("z{:02}", &right[1..])); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:161:13 [INFO] [stdout] | [INFO] [stdout] 161 | if right.starts_with('X') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 161 ~ if let Some() = right.strip_prefix('X') { [INFO] [stdout] 162 ~ names.insert(g.target, format!("z{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:164:58 [INFO] [stdout] | [INFO] [stdout] 164 | names.insert(g.target, format!("z{:02}", &left[1..])); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:163:20 [INFO] [stdout] | [INFO] [stdout] 163 | } else if left.starts_with('X') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 163 ~ } else if let Some() = left.strip_prefix('X') { [INFO] [stdout] 164 ~ names.insert(g.target, format!("z{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:142:15 [INFO] [stdout] | [INFO] [stdout] 142 | vertices: &Vec<(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] 142 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 142 + vertices: &[(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/bin/day20.rs:143:12 [INFO] [stdout] | [INFO] [stdout] 143 | walls: &Vec<(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] 143 - walls: &Vec<(usize, usize)>, [INFO] [stdout] 143 + walls: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:170:40 [INFO] [stdout] | [INFO] [stdout] 170 | format!("z{:02}", &left[1..].parse::().unwrap() + 1), [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:167:20 [INFO] [stdout] | [INFO] [stdout] 167 | } else if left.starts_with('c') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 167 ~ } else if let Some() = left.strip_prefix('c') { [INFO] [stdout] 168 | names.insert( [INFO] [stdout] 169 | g.target, [INFO] [stdout] 170 ~ format!("z{:02}", &.parse::().unwrap() + 1), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:173:15 [INFO] [stdout] | [INFO] [stdout] 173 | vertices: &Vec<(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] 173 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 173 + vertices: &[(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/bin/day20.rs:174:12 [INFO] [stdout] | [INFO] [stdout] 174 | walls: &Vec<(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] 174 - walls: &Vec<(usize, usize)>, [INFO] [stdout] 174 + walls: &[(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/bin/day12.rs:77:68 [INFO] [stdout] | [INFO] [stdout] 77 | fn corners(x: usize, y: usize, width: usize, height: usize, input: &Vec>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 77 - fn corners(x: usize, y: usize, width: usize, height: usize, input: &Vec>) -> u64 { [INFO] [stdout] 77 + fn corners(x: usize, y: usize, width: usize, height: usize, input: &[Vec]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:211:15 [INFO] [stdout] | [INFO] [stdout] 211 | possible: &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] 211 - possible: &Vec>, [INFO] [stdout] 211 + possible: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:212:11 [INFO] [stdout] | [INFO] [stdout] 212 | dist: &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] 212 - dist: &Vec, [INFO] [stdout] 212 + dist: &[u64], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to u64 [INFO] [stdout] --> src/bin/day20.rs:226:34 [INFO] [stdout] | [INFO] [stdout] 226 | let change = (start.0 as i64 - end.0 as i64).abs() as u64 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(start.0 as i64 - end.0 as i64).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to u64 [INFO] [stdout] --> src/bin/day20.rs:227:27 [INFO] [stdout] | [INFO] [stdout] 227 | + (start.1 as i64 - end.1 as i64).abs() as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(start.1 as i64 - end.1 as i64).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:175:40 [INFO] [stdout] | [INFO] [stdout] 175 | format!("z{:02}", &right[1..].parse::().unwrap() + 1), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:172:20 [INFO] [stdout] | [INFO] [stdout] 172 | } else if right.starts_with('c') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 172 ~ } else if let Some() = right.strip_prefix('c') { [INFO] [stdout] 173 | names.insert( [INFO] [stdout] 174 | g.target, [INFO] [stdout] 175 ~ format!("z{:02}", &.parse::().unwrap() + 1), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day24.rs:224:17 [INFO] [stdout] | [INFO] [stdout] 224 | format!("{:02}", i).chars().nth(0).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `format!("{:02}", i).chars().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/bin/day24.rs:230:12 [INFO] [stdout] | [INFO] [stdout] 230 | if real_name.len() > 0 && i > 0 && format!("z{:02}", i) != *real_name { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!real_name.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:16:41 [INFO] [stdout] | [INFO] [stdout] 16 | fn process_input(input: Vec) -> ((i32, i32), HashSet<(i32, i32)>, Vec) { [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: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/day17.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if *a != 0 { [INFO] [stdout] 83 | | return Some(instr as usize); [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 80 ~ 3 [INFO] [stdout] 81 | // jnz [INFO] [stdout] 82 ~ if *a != 0 => { [INFO] [stdout] 83 | return Some(instr as usize); [INFO] [stdout] 84 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | *a = *a / (2 as u64).pow(combo(instr, a, b, c).try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*a /= (2 as u64).pow(combo(instr, a, b, c).try_into().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] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/bin/day17.rs:70:23 [INFO] [stdout] | [INFO] [stdout] 70 | *a = *a / (2 as u64).pow(combo(instr, a, b, c).try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 74 | *b = *b ^ instr; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `*b ^= instr` [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/bin/day17.rs:88:13 [INFO] [stdout] | [INFO] [stdout] 88 | *b = *b ^ *c; [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `*b ^= *c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/bin/day17.rs:96:23 [INFO] [stdout] | [INFO] [stdout] 96 | *b = *a / (2 as u64).pow(combo(instr, a, b, c).try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/bin/day17.rs:100:23 [INFO] [stdout] | [INFO] [stdout] 100 | *c = *a / (2 as u64).pow(combo(instr, a, b, c).try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17.rs:107:38 [INFO] [stdout] | [INFO] [stdout] 107 | fn simulate(initial_a: u64, program: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 107 - fn simulate(initial_a: u64, program: &Vec) -> Vec { [INFO] [stdout] 107 + fn simulate(initial_a: u64, program: &[u64]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `input` [INFO] [stdout] --> src/bin/day06.rs:21:14 [INFO] [stdout] | [INFO] [stdout] 21 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 21 - for y in 0..height { [INFO] [stdout] 21 + for (y, ) in input.iter().enumerate().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:36:23 [INFO] [stdout] | [INFO] [stdout] 36 | fn _sample_input() -> ((i32, i32), HashSet<(i32, i32)>, Vec) { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:54:19 [INFO] [stdout] | [INFO] [stdout] 54 | fn day_input() -> ((i32, i32), HashSet<(i32, i32)>, Vec) { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:107:17 [INFO] [stdout] | [INFO] [stdout] 107 | fn part1(input: &((i32, i32), HashSet<(i32, i32)>, Vec)) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day06.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | fn part2(input: &((i32, i32), HashSet<(i32, i32)>, Vec)) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day06.rs:175:64 [INFO] [stdout] | [INFO] [stdout] 175 | let stone = move_guard_stateless(current.0, current.1, &obstacles).0; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `obstacles` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day06.rs:177:45 [INFO] [stdout] | [INFO] [stdout] 177 | if check_loop(current.0, current.1, &obstacles, width, height, &visited) { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `obstacles` [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/bin/day22.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | fn part1(input: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn part1(input: &Vec) -> i64 { [INFO] [stdout] 54 + fn part1(input: &[i64]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day22.rs:93:17 [INFO] [stdout] | [INFO] [stdout] 93 | fn part2(input: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 93 - fn part2(input: &Vec) -> i64 { [INFO] [stdout] 93 + fn part2(input: &[i64]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/day22.rs:97:10 [INFO] [stdout] | [INFO] [stdout] 97 | .map(|v| pattern_values(*v)) [INFO] [stdout] | __________^ [INFO] [stdout] 98 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|v| pattern_values(*v))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i64` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day22.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | result_map.values().max().unwrap().clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*result_map.values().max().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 boolean expression can be simplified [INFO] [stdout] --> src/bin/day16.rs:87:48 [INFO] [stdout] | [INFO] [stdout] 87 | .position(|&(v, h)| v == (x, y) && h == !horizontal) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `h != horizontal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day16.rs:181:5 [INFO] [stdout] | [INFO] [stdout] 181 | return (dist, prev); [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] 181 - return (dist, prev); [INFO] [stdout] 181 + (dist, prev) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:144:15 [INFO] [stdout] | [INFO] [stdout] 144 | vertices: &Vec<((usize, usize), bool)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 144 - vertices: &Vec<((usize, usize), bool)>, [INFO] [stdout] 144 + vertices: &[((usize, usize), bool)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:145:12 [INFO] [stdout] | [INFO] [stdout] 145 | edges: &Vec<(usize, usize, u64)>, [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] 145 - edges: &Vec<(usize, usize, u64)>, [INFO] [stdout] 145 + edges: &[(usize, usize, u64)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day16.rs:161:11 [INFO] [stdout] | [INFO] [stdout] 161 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:188:15 [INFO] [stdout] | [INFO] [stdout] 188 | vertices: &Vec<((usize, usize), bool)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 188 - vertices: &Vec<((usize, usize), bool)>, [INFO] [stdout] 188 + vertices: &[((usize, usize), bool)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day16.rs:87:48 [INFO] [stdout] | [INFO] [stdout] 87 | .position(|&(v, h)| v == (x, y) && h == !horizontal) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `h != horizontal` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day16.rs:181:5 [INFO] [stdout] | [INFO] [stdout] 181 | return (dist, prev); [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] 181 - return (dist, prev); [INFO] [stdout] 181 + (dist, prev) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:144:15 [INFO] [stdout] | [INFO] [stdout] 144 | vertices: &Vec<((usize, usize), bool)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 144 - vertices: &Vec<((usize, usize), bool)>, [INFO] [stdout] 144 + vertices: &[((usize, usize), bool)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:145:12 [INFO] [stdout] | [INFO] [stdout] 145 | edges: &Vec<(usize, usize, u64)>, [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] 145 - edges: &Vec<(usize, usize, u64)>, [INFO] [stdout] 145 + edges: &[(usize, usize, u64)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day16.rs:249:11 [INFO] [stdout] | [INFO] [stdout] 249 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.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: length comparison to zero [INFO] [stdout] --> src/bin/day16.rs:161:11 [INFO] [stdout] | [INFO] [stdout] 161 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:188:15 [INFO] [stdout] | [INFO] [stdout] 188 | vertices: &Vec<((usize, usize), bool)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 188 - vertices: &Vec<((usize, usize), bool)>, [INFO] [stdout] 188 + vertices: &[((usize, usize), bool)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day13.rs:44:53 [INFO] [stdout] | [INFO] [stdout] 44 | if let Some(caps) = button_a_regex.captures(&line) { [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] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day13.rs:47:60 [INFO] [stdout] | [INFO] [stdout] 47 | } else if let Some(caps) = button_b_regex.captures(&line) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day13.rs:50:57 [INFO] [stdout] | [INFO] [stdout] 50 | } else if let Some(caps) = prize_regex.captures(&line) { [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: length comparison to zero [INFO] [stdout] --> src/bin/day16.rs:249:11 [INFO] [stdout] | [INFO] [stdout] 249 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day13.rs:119:17 [INFO] [stdout] | [INFO] [stdout] 119 | fn part1(input: &Vec) -> u64 { [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] 119 - fn part1(input: &Vec) -> u64 { [INFO] [stdout] 119 + fn part1(input: &[Machine]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day13.rs:123:17 [INFO] [stdout] | [INFO] [stdout] 123 | fn part2(input: &Vec) -> u64 { [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] 123 - fn part2(input: &Vec) -> u64 { [INFO] [stdout] 123 + fn part2(input: &[Machine]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day04.rs:43:21 [INFO] [stdout] | [INFO] [stdout] 43 | fn transpose(input: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 43 - fn transpose(input: &Vec) -> Vec { [INFO] [stdout] 43 + fn transpose(input: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `input` [INFO] [stdout] --> src/bin/day04.rs:47:18 [INFO] [stdout] | [INFO] [stdout] 47 | for j in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 47 - for j in 0..input.len() { [INFO] [stdout] 47 + for in &input { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day04.rs:56:21 [INFO] [stdout] | [INFO] [stdout] 56 | fn diagonals(input: &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] 56 - fn diagonals(input: &Vec) -> Vec { [INFO] [stdout] 56 + fn diagonals(input: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `input` [INFO] [stdout] --> src/bin/day04.rs:61:18 [INFO] [stdout] | [INFO] [stdout] 61 | for y in 0..(input.len() - x) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 61 - for y in 0..(input.len() - x) { [INFO] [stdout] 61 + for (y, ) in input.iter().enumerate().take((input.len() - x)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `input` [INFO] [stdout] --> src/bin/day04.rs:69:18 [INFO] [stdout] | [INFO] [stdout] 69 | for y in 0..(x + 1) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 69 - for y in 0..(x + 1) { [INFO] [stdout] 69 + for (y, ) in input.iter().enumerate().take((x + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day04.rs:100:33 [INFO] [stdout] | [INFO] [stdout] 100 | fn count_occurences(source: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - fn count_occurences(source: &Vec) -> i64 { [INFO] [stdout] 100 + fn count_occurences(source: &[String]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day04.rs:115:17 [INFO] [stdout] | [INFO] [stdout] 115 | fn part2(input: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 115 - fn part2(input: &Vec) -> i64 { [INFO] [stdout] 115 + fn part2(input: &[String]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day04.rs:123:58 [INFO] [stdout] | [INFO] [stdout] 123 | .fold(String::new(), |t, y1| t + &input[y1][x..x + 3].to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&input[y1][x..x + 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day12.rs:20:35 [INFO] [stdout] | [INFO] [stdout] 20 | .filter(|row: &Vec| row.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!row.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day12.rs:53:12 [INFO] [stdout] | [INFO] [stdout] 53 | input: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 53 - input: &Vec>, [INFO] [stdout] 53 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day12.rs:77:68 [INFO] [stdout] | [INFO] [stdout] 77 | fn corners(x: usize, y: usize, width: usize, height: usize, input: &Vec>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 77 - fn corners(x: usize, y: usize, width: usize, height: usize, input: &Vec>) -> u64 { [INFO] [stdout] 77 + fn corners(x: usize, y: usize, width: usize, height: usize, input: &[Vec]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:116:17 [INFO] [stdout] | [INFO] [stdout] 116 | fn part1(input: &Vec, test: bool) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 116 - fn part1(input: &Vec, test: bool) -> i64 { [INFO] [stdout] 116 + fn part1(input: &[Robot], test: bool) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | fn part2(input: &Vec, test: bool) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 132 - fn part2(input: &Vec, test: bool) -> i64 { [INFO] [stdout] 132 + fn part2(input: &[Robot], test: bool) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day24.rs:32:50 [INFO] [stdout] | [INFO] [stdout] 32 | if let Some(captures) = initial.captures(&line) { [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] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day24.rs:43:60 [INFO] [stdout] | [INFO] [stdout] 43 | } else if let Some(captures) = connection.captures(&line) { [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/bin/day24.rs:100:24 [INFO] [stdout] | [INFO] [stdout] 100 | fn evaluate_all(gates: &Vec, map: &mut HashMap<[char; 3], bool>) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - fn evaluate_all(gates: &Vec, map: &mut HashMap<[char; 3], bool>) { [INFO] [stdout] 100 + fn evaluate_all(gates: &[Gate], map: &mut HashMap<[char; 3], bool>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day24.rs:118:22 [INFO] [stdout] | [INFO] [stdout] 118 | fn name_gates(gates: &Vec) -> HashMap<[char; 3], String> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 118 - fn name_gates(gates: &Vec) -> HashMap<[char; 3], String> { [INFO] [stdout] 118 + fn name_gates(gates: &[Gate]) -> HashMap<[char; 3], String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:136:58 [INFO] [stdout] | [INFO] [stdout] 136 | names.insert(g.target, format!("c{:02}", &left[1..])); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:135:13 [INFO] [stdout] | [INFO] [stdout] 135 | if left.starts_with('A') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 135 ~ if let Some() = left.strip_prefix('A') { [INFO] [stdout] 136 ~ names.insert(g.target, format!("c{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:138:58 [INFO] [stdout] | [INFO] [stdout] 138 | names.insert(g.target, format!("c{:02}", &right[1..])); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:137:20 [INFO] [stdout] | [INFO] [stdout] 137 | } else if right.starts_with('A') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 137 ~ } else if let Some() = right.strip_prefix('A') { [INFO] [stdout] 138 ~ names.insert(g.target, format!("c{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:140:58 [INFO] [stdout] | [INFO] [stdout] 140 | names.insert(g.target, format!("c{:02}", &left[1..])); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:139:20 [INFO] [stdout] | [INFO] [stdout] 139 | } else if left.starts_with('d') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 139 ~ } else if let Some() = left.strip_prefix('d') { [INFO] [stdout] 140 ~ names.insert(g.target, format!("c{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:142:58 [INFO] [stdout] | [INFO] [stdout] 142 | names.insert(g.target, format!("c{:02}", &right[1..])); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:141:20 [INFO] [stdout] | [INFO] [stdout] 141 | } else if right.starts_with('d') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 141 ~ } else if let Some() = right.strip_prefix('d') { [INFO] [stdout] 142 ~ names.insert(g.target, format!("c{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:146:58 [INFO] [stdout] | [INFO] [stdout] 146 | names.insert(g.target, format!("d{:02}", &left[1..])); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | if left.starts_with('X') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 145 ~ if let Some() = left.strip_prefix('X') { [INFO] [stdout] 146 ~ names.insert(g.target, format!("d{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:148:58 [INFO] [stdout] | [INFO] [stdout] 148 | names.insert(g.target, format!("d{:02}", &right[1..])); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:147:20 [INFO] [stdout] | [INFO] [stdout] 147 | } else if right.starts_with('X') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 147 ~ } else if let Some() = right.strip_prefix('X') { [INFO] [stdout] 148 ~ names.insert(g.target, format!("d{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:152:40 [INFO] [stdout] | [INFO] [stdout] 152 | format!("d{:02}", &left[1..].parse::().unwrap() + 1), [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:149:20 [INFO] [stdout] | [INFO] [stdout] 149 | } else if left.starts_with('c') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 149 ~ } else if let Some() = left.strip_prefix('c') { [INFO] [stdout] 150 | names.insert( [INFO] [stdout] 151 | g.target, [INFO] [stdout] 152 ~ format!("d{:02}", &.parse::().unwrap() + 1), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:157:40 [INFO] [stdout] | [INFO] [stdout] 157 | format!("d{:02}", &right[1..].parse::().unwrap() + 1), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:154:20 [INFO] [stdout] | [INFO] [stdout] 154 | } else if right.starts_with('c') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 154 ~ } else if let Some() = right.strip_prefix('c') { [INFO] [stdout] 155 | names.insert( [INFO] [stdout] 156 | g.target, [INFO] [stdout] 157 ~ format!("d{:02}", &.parse::().unwrap() + 1), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:162:58 [INFO] [stdout] | [INFO] [stdout] 162 | names.insert(g.target, format!("z{:02}", &right[1..])); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:161:13 [INFO] [stdout] | [INFO] [stdout] 161 | if right.starts_with('X') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 161 ~ if let Some() = right.strip_prefix('X') { [INFO] [stdout] 162 ~ names.insert(g.target, format!("z{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:164:58 [INFO] [stdout] | [INFO] [stdout] 164 | names.insert(g.target, format!("z{:02}", &left[1..])); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:163:20 [INFO] [stdout] | [INFO] [stdout] 163 | } else if left.starts_with('X') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 163 ~ } else if let Some() = left.strip_prefix('X') { [INFO] [stdout] 164 ~ names.insert(g.target, format!("z{:02}", )); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:170:40 [INFO] [stdout] | [INFO] [stdout] 170 | format!("z{:02}", &left[1..].parse::().unwrap() + 1), [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:167:20 [INFO] [stdout] | [INFO] [stdout] 167 | } else if left.starts_with('c') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 167 ~ } else if let Some() = left.strip_prefix('c') { [INFO] [stdout] 168 | names.insert( [INFO] [stdout] 169 | g.target, [INFO] [stdout] 170 ~ format!("z{:02}", &.parse::().unwrap() + 1), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/bin/day24.rs:175:40 [INFO] [stdout] | [INFO] [stdout] 175 | format!("z{:02}", &right[1..].parse::().unwrap() + 1), [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/day24.rs:172:20 [INFO] [stdout] | [INFO] [stdout] 172 | } else if right.starts_with('c') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 172 ~ } else if let Some() = right.strip_prefix('c') { [INFO] [stdout] 173 | names.insert( [INFO] [stdout] 174 | g.target, [INFO] [stdout] 175 ~ format!("z{:02}", &.parse::().unwrap() + 1), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day24.rs:224:17 [INFO] [stdout] | [INFO] [stdout] 224 | format!("{:02}", i).chars().nth(0).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `format!("{:02}", i).chars().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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day13.rs:44:53 [INFO] [stdout] | [INFO] [stdout] 44 | if let Some(caps) = button_a_regex.captures(&line) { [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] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day13.rs:47:60 [INFO] [stdout] | [INFO] [stdout] 47 | } else if let Some(caps) = button_b_regex.captures(&line) { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day13.rs:50:57 [INFO] [stdout] | [INFO] [stdout] 50 | } else if let Some(caps) = prize_regex.captures(&line) { [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/bin/day13.rs:119:17 [INFO] [stdout] | [INFO] [stdout] 119 | fn part1(input: &Vec) -> u64 { [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] 119 - fn part1(input: &Vec) -> u64 { [INFO] [stdout] 119 + fn part1(input: &[Machine]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day24.rs:230:12 [INFO] [stdout] | [INFO] [stdout] 230 | if real_name.len() > 0 && i > 0 && format!("z{:02}", i) != *real_name { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!real_name.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: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/day17.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | / if *a != 0 { [INFO] [stdout] 83 | | return Some(instr as usize); [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 80 ~ 3 [INFO] [stdout] 81 | // jnz [INFO] [stdout] 82 ~ if *a != 0 => { [INFO] [stdout] 83 | return Some(instr as usize); [INFO] [stdout] 84 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | *a = *a / (2 as u64).pow(combo(instr, a, b, c).try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*a /= (2 as u64).pow(combo(instr, a, b, c).try_into().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] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/bin/day17.rs:70:23 [INFO] [stdout] | [INFO] [stdout] 70 | *a = *a / (2 as u64).pow(combo(instr, a, b, c).try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 74 | *b = *b ^ instr; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `*b ^= instr` [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/bin/day17.rs:88:13 [INFO] [stdout] | [INFO] [stdout] 88 | *b = *b ^ *c; [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `*b ^= *c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/bin/day17.rs:96:23 [INFO] [stdout] | [INFO] [stdout] 96 | *b = *a / (2 as u64).pow(combo(instr, a, b, c).try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/bin/day17.rs:100:23 [INFO] [stdout] | [INFO] [stdout] 100 | *c = *a / (2 as u64).pow(combo(instr, a, b, c).try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17.rs:107:38 [INFO] [stdout] | [INFO] [stdout] 107 | fn simulate(initial_a: u64, program: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 107 - fn simulate(initial_a: u64, program: &Vec) -> Vec { [INFO] [stdout] 107 + fn simulate(initial_a: u64, program: &[u64]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day03.rs:25:25 [INFO] [stdout] | [INFO] [stdout] 25 | fn process_input(input: &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] 25 - fn process_input(input: &Vec) -> String { [INFO] [stdout] 25 + fn process_input(input: &[String]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day03.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | fn part1(input: &String) -> i64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 - fn part1(input: &String) -> i64 { [INFO] [stdout] 30 + fn part1(input: &str) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day03.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | fn part2(input: &String) -> i64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 42 - fn part2(input: &String) -> i64 { [INFO] [stdout] 42 + fn part2(input: &str) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day13.rs:123:17 [INFO] [stdout] | [INFO] [stdout] 123 | fn part2(input: &Vec) -> u64 { [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] 123 - fn part2(input: &Vec) -> u64 { [INFO] [stdout] 123 + fn part2(input: &[Machine]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/day23.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, usize}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day23.rs:21:28 [INFO] [stdout] | [INFO] [stdout] 21 | let value_tuple = (value.chars().nth(0).unwrap(), value.chars().nth(1).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `value.chars().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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day23.rs:97:24 [INFO] [stdout] | [INFO] [stdout] 97 | fn find_cliques(edges: &Vec<(usize, usize)>) -> Vec<[usize; 3]> { [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] 97 - fn find_cliques(edges: &Vec<(usize, usize)>) -> Vec<[usize; 3]> { [INFO] [stdout] 97 + fn find_cliques(edges: &[(usize, usize)]) -> Vec<[usize; 3]> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day23.rs:118:14 [INFO] [stdout] | [INFO] [stdout] 118 | current: &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] 118 - current: &Vec, [INFO] [stdout] 118 + current: &[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/bin/day23.rs:119:15 [INFO] [stdout] | [INFO] [stdout] 119 | vertices: &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] 119 - vertices: &Vec, [INFO] [stdout] 119 + vertices: &[Vertex], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day23.rs:120:12 [INFO] [stdout] | [INFO] [stdout] 120 | edges: &Vec<(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] 120 - edges: &Vec<(usize, usize)>, [INFO] [stdout] 120 + edges: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/bin/day21.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / s.chars() [INFO] [stdout] 219 | | .into_iter() [INFO] [stdout] | |________________________________^ help: consider removing `.into_iter()`: `s.chars()` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day21.rs:256:11 [INFO] [stdout] | [INFO] [stdout] 256 | line: &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] 256 - line: &String, [INFO] [stdout] 256 + line: &str, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day21.rs:276:32 [INFO] [stdout] | [INFO] [stdout] 276 | fn calculate_keypresses(input: &Vec, directional_robots: usize) -> u64 { [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] 276 - fn calculate_keypresses(input: &Vec, directional_robots: usize) -> u64 { [INFO] [stdout] 276 + fn calculate_keypresses(input: &[String], directional_robots: usize) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/bin/day21.rs:289:21 [INFO] [stdout] | [INFO] [stdout] 289 | / choice [INFO] [stdout] 290 | | .chars() [INFO] [stdout] 291 | | .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] 289 ~ choice [INFO] [stdout] 290 + .chars() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `input` [INFO] [stdout] --> src/bin/day20.rs:29:14 [INFO] [stdout] | [INFO] [stdout] 29 | for y in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 29 - for y in 0..input.len() { [INFO] [stdout] 29 + for (y, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/day20.rs:107:5 [INFO] [stdout] | [INFO] [stdout] 107 | return (dist, prev); [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] 107 - return (dist, prev); [INFO] [stdout] 107 + (dist, prev) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:79:15 [INFO] [stdout] | [INFO] [stdout] 79 | vertices: &Vec<(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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 79 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 79 + vertices: &[(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/bin/day20.rs:80:16 [INFO] [stdout] | [INFO] [stdout] 80 | neighbors: &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] 80 - neighbors: &Vec>, [INFO] [stdout] 80 + neighbors: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day20.rs:87:11 [INFO] [stdout] | [INFO] [stdout] 87 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:111:15 [INFO] [stdout] | [INFO] [stdout] 111 | vertices: &Vec<(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] 111 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 111 + vertices: &[(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/bin/day20.rs:112:12 [INFO] [stdout] | [INFO] [stdout] 112 | walls: &Vec<(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] 112 - walls: &Vec<(usize, usize)>, [INFO] [stdout] 112 + walls: &[(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/bin/day20.rs:142:15 [INFO] [stdout] | [INFO] [stdout] 142 | vertices: &Vec<(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] 142 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 142 + vertices: &[(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/bin/day20.rs:143:12 [INFO] [stdout] | [INFO] [stdout] 143 | walls: &Vec<(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] 143 - walls: &Vec<(usize, usize)>, [INFO] [stdout] 143 + walls: &[(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/bin/day20.rs:173:15 [INFO] [stdout] | [INFO] [stdout] 173 | vertices: &Vec<(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] 173 - vertices: &Vec<(usize, usize)>, [INFO] [stdout] 173 + vertices: &[(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/bin/day20.rs:174:12 [INFO] [stdout] | [INFO] [stdout] 174 | walls: &Vec<(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] 174 - walls: &Vec<(usize, usize)>, [INFO] [stdout] 174 + walls: &[(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/bin/day20.rs:211:15 [INFO] [stdout] | [INFO] [stdout] 211 | possible: &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] 211 - possible: &Vec>, [INFO] [stdout] 211 + possible: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day20.rs:212:11 [INFO] [stdout] | [INFO] [stdout] 212 | dist: &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] 212 - dist: &Vec, [INFO] [stdout] 212 + dist: &[u64], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to u64 [INFO] [stdout] --> src/bin/day20.rs:226:34 [INFO] [stdout] | [INFO] [stdout] 226 | let change = (start.0 as i64 - end.0 as i64).abs() as u64 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(start.0 as i64 - end.0 as i64).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to u64 [INFO] [stdout] --> src/bin/day20.rs:227:27 [INFO] [stdout] | [INFO] [stdout] 227 | + (start.1 as i64 - end.1 as i64).abs() as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(start.1 as i64 - end.1 as i64).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/day11.rs:41:8 [INFO] [stdout] | [INFO] [stdout] 41 | if value_text.len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `value_text.len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day11.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | fn part1(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 63 ~ fn part1(input: &[u64]) -> usize { [INFO] [stdout] 64 ~ let mut current = input.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:20:41 [INFO] [stdout] | [INFO] [stdout] 20 | fn process_input(input: Vec) -> (usize, usize, HashMap>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day10.rs:50:12 [INFO] [stdout] | [INFO] [stdout] 50 | input: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 50 - input: &Vec>, [INFO] [stdout] 50 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/day11.rs:66:34 [INFO] [stdout] | [INFO] [stdout] 66 | current = current.iter().map(|v| update_stone(*v)).flatten().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|v| update_stone(*v))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day11.rs:71:17 [INFO] [stdout] | [INFO] [stdout] 71 | fn part2(input: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - fn part2(input: &Vec) -> u64 { [INFO] [stdout] 71 + fn part2(input: &[u64]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/bin/day08.rs:27:35 [INFO] [stdout] | [INFO] [stdout] 27 | antennas.entry(c).or_insert(Vec::new()).push((x, y)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:35:23 [INFO] [stdout] | [INFO] [stdout] 35 | fn _sample_input() -> (usize, usize, HashMap>) { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:55:19 [INFO] [stdout] | [INFO] [stdout] 55 | fn day_input() -> (usize, usize, HashMap>) { [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: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/bin/day11.rs:87:37 [INFO] [stdout] | [INFO] [stdout] 87 | current.iter().map(|(_, count)| *count as u64).sum() [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `*count` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day08.rs:59:24 [INFO] [stdout] | [INFO] [stdout] 59 | fn antinodes(antennas: &Vec<(usize, usize)>, width: i32, height: i32) -> HashSet<(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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn antinodes(antennas: &Vec<(usize, usize)>, width: i32, height: i32) -> HashSet<(usize, usize)> { [INFO] [stdout] 59 + fn antinodes(antennas: &[(usize, usize)], width: i32, height: i32) -> HashSet<(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/bin/day08.rs:76:25 [INFO] [stdout] | [INFO] [stdout] 76 | fn antinodes2(antennas: &Vec<(usize, usize)>, width: i32, height: i32) -> HashSet<(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] 76 - fn antinodes2(antennas: &Vec<(usize, usize)>, width: i32, height: i32) -> HashSet<(usize, usize)> { [INFO] [stdout] 76 + fn antinodes2(antennas: &[(usize, usize)], width: i32, height: i32) -> HashSet<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:102:17 [INFO] [stdout] | [INFO] [stdout] 102 | fn part1(input: &(usize, usize, HashMap>)) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/bin/day08.rs:105:27 [INFO] [stdout] | [INFO] [stdout] 105 | for (_, positions) in antennas { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 105 - for (_, positions) in antennas { [INFO] [stdout] 105 + for positions in antennas.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day08.rs:111:17 [INFO] [stdout] | [INFO] [stdout] 111 | fn part2(input: &(usize, usize, HashMap>)) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/bin/day08.rs:114:27 [INFO] [stdout] | [INFO] [stdout] 114 | for (_, positions) in antennas { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 114 - for (_, positions) in antennas { [INFO] [stdout] 114 + for positions in antennas.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day03.rs:25:25 [INFO] [stdout] | [INFO] [stdout] 25 | fn process_input(input: &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] 25 - fn process_input(input: &Vec) -> String { [INFO] [stdout] 25 + fn process_input(input: &[String]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day03.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | fn part1(input: &String) -> i64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 - fn part1(input: &String) -> i64 { [INFO] [stdout] 30 + fn part1(input: &str) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day03.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | fn part2(input: &String) -> i64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 42 - fn part2(input: &String) -> i64 { [INFO] [stdout] 42 + fn part2(input: &str) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day09.rs:81:36 [INFO] [stdout] | [INFO] [stdout] 81 | fn generate_numbers_rev(files: &Vec<(i64, i64)>) -> impl Iterator + '_ { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 81 - fn generate_numbers_rev(files: &Vec<(i64, i64)>) -> impl Iterator + '_ { [INFO] [stdout] 81 + fn generate_numbers_rev(files: &[(i64, i64)]) -> impl Iterator + '_ { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/bin/day09.rs:85:40 [INFO] [stdout] | [INFO] [stdout] 85 | .flat_map(|&(number, len)| repeat(number).take(len as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(number, len as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:116:17 [INFO] [stdout] | [INFO] [stdout] 116 | fn part1(input: &Vec, test: bool) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 116 - fn part1(input: &Vec, test: bool) -> i64 { [INFO] [stdout] 116 + fn part1(input: &[Robot], test: bool) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day09.rs:129:54 [INFO] [stdout] | [INFO] [stdout] 129 | fn move_file(file: &(i64, i64, i64, i64), files: &mut Vec<(i64, i64, i64, i64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 129 - fn move_file(file: &(i64, i64, i64, i64), files: &mut Vec<(i64, i64, i64, i64)>) { [INFO] [stdout] 129 + fn move_file(file: &(i64, i64, i64, i64), files: &mut [(i64, i64, i64, i64)]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/bin/day09.rs:151:9 [INFO] [stdout] | [INFO] [stdout] 151 | files.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 151 - files.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] 151 + files.sort_by_key(|a| a.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | fn part2(input: &Vec, test: bool) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 132 - fn part2(input: &Vec, test: bool) -> i64 { [INFO] [stdout] 132 + fn part2(input: &[Robot], test: bool) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day10.rs:50:12 [INFO] [stdout] | [INFO] [stdout] 50 | input: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 50 - input: &Vec>, [INFO] [stdout] 50 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day19.rs:77:8 [INFO] [stdout] | [INFO] [stdout] 77 | if pattern.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `pattern.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: length comparison to zero [INFO] [stdout] --> src/bin/day19.rs:108:8 [INFO] [stdout] | [INFO] [stdout] 108 | if pattern.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `pattern.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day22.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | fn part1(input: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn part1(input: &Vec) -> i64 { [INFO] [stdout] 54 + fn part1(input: &[i64]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day22.rs:93:17 [INFO] [stdout] | [INFO] [stdout] 93 | fn part2(input: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 93 - fn part2(input: &Vec) -> i64 { [INFO] [stdout] 93 + fn part2(input: &[i64]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/day22.rs:97:10 [INFO] [stdout] | [INFO] [stdout] 97 | .map(|v| pattern_values(*v)) [INFO] [stdout] | __________^ [INFO] [stdout] 98 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|v| pattern_values(*v))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i64` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day22.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | result_map.values().max().unwrap().clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*result_map.values().max().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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 28.91s [INFO] running `Command { std: "docker" "inspect" "8b03ea388d9a9eb41b7149d41a350b4ba63622426d731bd442270b7ffca5f86b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8b03ea388d9a9eb41b7149d41a350b4ba63622426d731bd442270b7ffca5f86b", kill_on_drop: false }` [INFO] [stdout] 8b03ea388d9a9eb41b7149d41a350b4ba63622426d731bd442270b7ffca5f86b