[INFO] cloning repository https://github.com/voliva/AoC-2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/voliva/AoC-2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fvoliva%2FAoC-2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fvoliva%2FAoC-2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 6d6df406bf6a36c43de1472cf3b2bb3eeb287204 [INFO] linting voliva/AoC-2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fvoliva%2FAoC-2024" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/voliva/AoC-2024 [INFO] finished tweaking git repo https://github.com/voliva/AoC-2024 [INFO] tweaked toml for git repo https://github.com/voliva/AoC-2024 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/voliva/AoC-2024 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/voliva/AoC-2024 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded slab_tree v0.3.2 [INFO] [stderr] Downloaded queues v1.1.0 [INFO] [stderr] Downloaded priority-queue v2.1.1 [INFO] [stderr] Downloaded pathfinding v3.0.14 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 662f32dd31b737816ab0843369df7f8d06bccf89b5ed21cb2153dc81764258de [INFO] running `Command { std: "docker" "start" "-a" "662f32dd31b737816ab0843369df7f8d06bccf89b5ed21cb2153dc81764258de", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "662f32dd31b737816ab0843369df7f8d06bccf89b5ed21cb2153dc81764258de", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "662f32dd31b737816ab0843369df7f8d06bccf89b5ed21cb2153dc81764258de", kill_on_drop: false }` [INFO] [stdout] 662f32dd31b737816ab0843369df7f8d06bccf89b5ed21cb2153dc81764258de [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 81d13a61cbb6c0aeda9c1617ef43572ddea02a0cf1da9f99867f57f0eee186e8 [INFO] running `Command { std: "docker" "start" "-a" "81d13a61cbb6c0aeda9c1617ef43572ddea02a0cf1da9f99867f57f0eee186e8", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.167 [INFO] [stderr] Compiling cc v1.2.2 [INFO] [stderr] Compiling syn v2.0.90 [INFO] [stderr] Compiling openssl v0.10.68 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Checking tracing-core v0.1.33 [INFO] [stderr] Checking bitflags v2.6.0 [INFO] [stderr] Compiling serde v1.0.215 [INFO] [stderr] Checking futures-task v0.3.31 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling matrixmultiply v0.3.9 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Compiling indexmap v1.9.3 [INFO] [stderr] Compiling serde_json v1.0.133 [INFO] [stderr] Compiling slotmap v1.0.7 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking http-body v0.4.6 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking socket2 v0.5.8 [INFO] [stderr] Checking mio v1.0.3 [INFO] [stderr] Checking signal-hook-registry v1.4.2 [INFO] [stderr] Checking num-complex v0.4.6 [INFO] [stderr] Checking clap_lex v0.7.3 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking clap_builder v4.5.21 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking num-rational v0.4.2 [INFO] [stderr] Compiling openssl-sys v0.9.104 [INFO] [stderr] Checking num-iter v0.1.45 [INFO] [stderr] Checking integer-sqrt v0.1.5 [INFO] [stderr] Compiling native-tls v0.2.12 [INFO] [stderr] Checking snowflake v1.3.0 [INFO] [stderr] Checking fixedbitset v0.4.2 [INFO] [stderr] Checking ipnet v2.10.1 [INFO] [stderr] Checking chrono v0.4.38 [INFO] [stderr] Checking ndarray v0.15.6 [INFO] [stderr] Checking slab_tree v0.3.2 [INFO] [stderr] Checking num v0.4.3 [INFO] [stderr] Checking priority-queue v2.1.1 [INFO] [stderr] Checking queues v1.1.0 [INFO] [stderr] Checking auto_ops v0.3.0 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Compiling synstructure v0.13.1 [INFO] [stderr] Compiling zerofrom-derive v0.1.5 [INFO] [stderr] Compiling yoke-derive v0.7.5 [INFO] [stderr] Compiling zerovec-derive v0.10.3 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling icu_provider_macros v1.5.0 [INFO] [stderr] Compiling tokio-macros v2.4.0 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling clap_derive v4.5.18 [INFO] [stderr] Checking tokio v1.41.1 [INFO] [stderr] Checking zerofrom v0.1.5 [INFO] [stderr] Checking yoke v0.7.5 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking pathfinding v3.0.14 [INFO] [stderr] Checking zerovec v0.10.4 [INFO] [stderr] Checking tinystr v0.7.6 [INFO] [stderr] Checking icu_collections v1.5.0 [INFO] [stderr] Checking clap v4.5.21 [INFO] [stderr] Checking icu_locid v1.5.0 [INFO] [stderr] Checking icu_provider v1.5.0 [INFO] [stderr] Checking icu_locid_transform v1.5.0 [INFO] [stderr] Checking icu_properties v1.5.1 [INFO] [stderr] Checking tokio-util v0.7.12 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking icu_normalizer v1.5.0 [INFO] [stderr] Checking idna_adapter v1.2.0 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking hyper v0.14.31 [INFO] [stderr] Checking hyper-tls v0.5.0 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking aoc-2024 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/coordinate.rs:82:23 [INFO] [stdout] | [INFO] [stdout] 82 | pub const CARDINALS: &'static [Direction] = &[ [INFO] [stdout] | -^^^^^^^------------ help: consider removing `'static`: `&[Direction]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/coordinate.rs:82:23 [INFO] [stdout] | [INFO] [stdout] 82 | pub const CARDINALS: &'static [Direction] = &[ [INFO] [stdout] | -^^^^^^^------------ help: consider removing `'static`: `&[Direction]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/solutions/day20.rs:65:13 [INFO] [stdout] | [INFO] [stdout] 65 | fn step(self: &Self, position: &Coordinate) -> Self { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 65 - fn step(self: &Self, position: &Coordinate) -> Self { [INFO] [stdout] 65 + fn step(&self, position: &Coordinate) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/solutions/day20.rs:70:14 [INFO] [stdout] | [INFO] [stdout] 70 | fn cheat(self: &Self, position: &Coordinate) -> Self { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 70 - fn cheat(self: &Self, position: &Coordinate) -> Self { [INFO] [stdout] 70 + fn cheat(&self, position: &Coordinate) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/solutions/day22.rs:10:19 [INFO] [stdout] | [INFO] [stdout] 10 | let secret = (secret * 64 ^ secret) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(secret * 64) ^ secret` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] = note: `#[warn(clippy::precedence)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/solutions/day22.rs:11:19 [INFO] [stdout] | [INFO] [stdout] 11 | let secret = (secret / 32 ^ secret) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(secret / 32) ^ secret` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/solutions/day22.rs:12:6 [INFO] [stdout] | [INFO] [stdout] 12 | (secret * 2048 ^ secret) % 16777216 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(secret * 2048) ^ secret` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/solutions/day20.rs:65:13 [INFO] [stdout] | [INFO] [stdout] 65 | fn step(self: &Self, position: &Coordinate) -> Self { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 65 - fn step(self: &Self, position: &Coordinate) -> Self { [INFO] [stdout] 65 + fn step(&self, position: &Coordinate) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/solutions/day20.rs:70:14 [INFO] [stdout] | [INFO] [stdout] 70 | fn cheat(self: &Self, position: &Coordinate) -> Self { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 70 - fn cheat(self: &Self, position: &Coordinate) -> Self { [INFO] [stdout] 70 + fn cheat(&self, position: &Coordinate) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/solutions/day22.rs:10:19 [INFO] [stdout] | [INFO] [stdout] 10 | let secret = (secret * 64 ^ secret) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(secret * 64) ^ secret` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] = note: `#[warn(clippy::precedence)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/solutions/day22.rs:11:19 [INFO] [stdout] | [INFO] [stdout] 11 | let secret = (secret / 32 ^ secret) % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(secret / 32) ^ secret` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/solutions/day22.rs:12:6 [INFO] [stdout] | [INFO] [stdout] 12 | (secret * 2048 ^ secret) % 16777216 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider parenthesizing your expression: `(secret * 2048) ^ secret` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/coordinate.rs:26:41 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn apply_vec<'a, T>(&self, vec: &'a Vec>) -> Option<&'a T> { [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] 26 - pub fn apply_vec<'a, T>(&self, vec: &'a Vec>) -> Option<&'a T> { [INFO] [stdout] 26 + pub fn apply_vec<'a, T>(&self, vec: &'a [Vec]) -> Option<&'a T> { [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/coordinate.rs:66:39 [INFO] [stdout] | [INFO] [stdout] 66 | pub fn get_coordinates_from(input: &Vec>) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 66 - pub fn get_coordinates_from(input: &Vec>) -> impl Iterator { [INFO] [stdout] 66 + pub fn get_coordinates_from(input: &[Vec]) -> impl Iterator { [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/coordinate.rs:145:37 [INFO] [stdout] | [INFO] [stdout] 145 | pub fn print_grid(grid: &Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 145 - pub fn print_grid(grid: &Vec>) { [INFO] [stdout] 145 + pub fn print_grid(grid: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/many_to_many.rs:49:43 [INFO] [stdout] | [INFO] [stdout] 49 | if let Some(set) = self.0.get_mut(&key) { [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/solutions/day01.rs:42:14 [INFO] [stdout] | [INFO] [stdout] 42 | Ok(a.into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day02.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | return negatives == diffs.len(); [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] 22 - return negatives == diffs.len(); [INFO] [stdout] 22 + negatives == diffs.len() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/solutions/day02.rs:11:10 [INFO] [stdout] | [INFO] [stdout] 11 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/solutions/day02.rs:39:47 [INFO] [stdout] | [INFO] [stdout] 39 | Ok(input.iter().filter(|line| is_safe(*line)).count()) [INFO] [stdout] | ^^^^^ help: try: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day02.rs:50:17 [INFO] [stdout] | [INFO] [stdout] 50 | / return (0..line.len()).any(|idx| { [INFO] [stdout] 51 | | is_safe( [INFO] [stdout] 52 | | &line [INFO] [stdout] 53 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 59 | | }); [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 50 ~ (0..line.len()).any(|idx| { [INFO] [stdout] 51 + is_safe( [INFO] [stdout] 52 + &line [INFO] [stdout] 53 + .iter() [INFO] [stdout] 54 + .enumerate() [INFO] [stdout] 55 + .filter(|(i, _)| *i != idx) [INFO] [stdout] 56 + .map(|(_, v)| *v) [INFO] [stdout] 57 + .collect(), [INFO] [stdout] 58 + ) [INFO] [stdout] 59 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/solutions/day02.rs:46:28 [INFO] [stdout] | [INFO] [stdout] 46 | if is_safe(*line) { [INFO] [stdout] | ^^^^^ help: try: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day04.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 67 - return true; [INFO] [stdout] 67 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/day04.rs:44:12 [INFO] [stdout] | [INFO] [stdout] 44 | 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - input: &Vec>, [INFO] [stdout] 44 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day04.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | / return find_individual(input, "MAS", (start.0 + 2, start.1), (-1, 1)) [INFO] [stdout] 104 | | || find_individual(input, "SAM", (start.0 + 2, start.1), (-1, 1)); [INFO] [stdout] | |_________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 103 ~ find_individual(input, "MAS", (start.0 + 2, start.1), (-1, 1)) [INFO] [stdout] 104 ~ || find_individual(input, "SAM", (start.0 + 2, start.1), (-1, 1)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/day05.rs:29:16 [INFO] [stdout] | [INFO] [stdout] 29 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/day05.rs:47:62 [INFO] [stdout] | [INFO] [stdout] 47 | fn update_is_valid(rules: &ManyToMany, update: &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] 47 - fn update_is_valid(rules: &ManyToMany, update: &Vec) -> bool { [INFO] [stdout] 47 + fn update_is_valid(rules: &ManyToMany, update: &[usize]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day05.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 56 - return result; [INFO] [stdout] 56 + result [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/solutions/day05.rs:61:58 [INFO] [stdout] | [INFO] [stdout] 61 | fn sort_update(rules: &ManyToMany, update: &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] 61 ~ fn sort_update(rules: &ManyToMany, update: &[usize]) -> Vec { [INFO] [stdout] 62 ~ let mut result = update.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day05.rs:93:55 [INFO] [stdout] | [INFO] [stdout] 93 | .filter(|v| update_is_valid(&input.rules, &v)) [INFO] [stdout] | ^^ help: change this to: `v` [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/solutions/day05.rs:102:56 [INFO] [stdout] | [INFO] [stdout] 102 | .filter(|v| !update_is_valid(&input.rules, &v)) [INFO] [stdout] | ^^ help: change this to: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day07.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 39 - return false; [INFO] [stdout] 39 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/solutions/day07.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 21 | if self.result % last == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.result.is_multiple_of(last)` [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: unneeded `return` statement [INFO] [stdout] --> src/solutions/day07.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 78 - return false; [INFO] [stdout] 78 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/solutions/day07.rs:48:12 [INFO] [stdout] | [INFO] [stdout] 48 | if self.result % last == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.result.is_multiple_of(last)` [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] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/day08.rs:21:42 [INFO] [stdout] | [INFO] [stdout] 21 | .map(|line| line.chars().map(|v| String::from(v)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/day08.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | if cell.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `cell.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 `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day09.rs:32:14 [INFO] [stdout] | [INFO] [stdout] 32 | .fold(0, |a, b| a + b); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/solutions/day09.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | .enumerate() [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 30 ~ [INFO] [stdout] 31 ~ .map(|v| *v) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day09.rs:66:14 [INFO] [stdout] | [INFO] [stdout] 66 | .fold(0, |a, b| a + b)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day09.rs:110:14 [INFO] [stdout] | [INFO] [stdout] 110 | .fold(0, |a, b| a + b)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day09.rs:108:22 [INFO] [stdout] | [INFO] [stdout] 108 | .fold(0, |a, b| a + b) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day10.rs:82:10 [INFO] [stdout] | [INFO] [stdout] 82 | .fold(0, |a, b| a + b) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day10.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | return 0; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 80 - return 0; [INFO] [stdout] 80 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day11.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 55 - return result; [INFO] [stdout] 55 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/day11.rs:66:13 [INFO] [stdout] | [INFO] [stdout] 66 | (&formatted[..len / 2]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `formatted[..len / 2]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/day11.rs:67:13 [INFO] [stdout] | [INFO] [stdout] 67 | (&formatted[len / 2..]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `formatted[len / 2..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day13.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | return a_moves * 3 + b_moves; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 44 - return a_moves * 3 + b_moves; [INFO] [stdout] 44 + a_moves * 3 + b_moves [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day14.rs:87:16 [INFO] [stdout] | [INFO] [stdout] 87 | period(self.velocity.0.abs() as usize, W as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.velocity.0.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 `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day14.rs:88:22 [INFO] [stdout] | [INFO] [stdout] 88 | * period(self.velocity.1.abs() as usize, H as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.velocity.1.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: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day14.rs:125:31 [INFO] [stdout] | [INFO] [stdout] 125 | Ok(quadrants.values().fold(1, |a, b| a * b)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/solutions/day15.rs:103:61 [INFO] [stdout] | [INFO] [stdout] 103 | ... .map(|v| left.into_iter().chain(v.into_iter()).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [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] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 103 - .map(|v| left.into_iter().chain(v.into_iter()).collect()) [INFO] [stdout] 103 + .map(|v| left.into_iter().chain(v).collect()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day15.rs:132:27 [INFO] [stdout] | [INFO] [stdout] 132 | max = max.max(&coord); [INFO] [stdout] | ^^^^^^ help: change this to: `coord` [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: comparison to empty slice [INFO] [stdout] --> src/solutions/day15.rs:175:16 [INFO] [stdout] | [INFO] [stdout] 175 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/day16.rs:13:21 [INFO] [stdout] | [INFO] [stdout] 13 | fn find_char(input: &Vec>, needle: char) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 13 - fn find_char(input: &Vec>, needle: char) -> Option { [INFO] [stdout] 13 + fn find_char(input: &[Vec], needle: char) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day17.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | return machine.output[0]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 104 - return machine.output[0]; [INFO] [stdout] 104 + machine.output[0] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day17.rs:130:36 [INFO] [stdout] | [INFO] [stdout] 130 | let dj = simulate_dontjump(&dontjump); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dontjump` [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/solutions/day19.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 19 | if design.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.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/solutions/day19.rs:42:8 [INFO] [stdout] | [INFO] [stdout] 42 | if design.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/day19.rs:72:23 [INFO] [stdout] | [INFO] [stdout] 72 | let designs = (&lines[2..]) [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `lines[2..]` [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: unnecessarily eager cloning of iterator items [INFO] [stdout] --> src/solutions/day20.rs:20:26 [INFO] [stdout] | [INFO] [stdout] 20 | let mut result = self [INFO] [stdout] | __________________________^ [INFO] [stdout] 21 | | .position [INFO] [stdout] 22 | | .cardinals() [INFO] [stdout] 23 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 27 | | pos.is_some() && *pos.unwrap() != '#' [INFO] [stdout] 28 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned [INFO] [stdout] = note: `#[warn(clippy::iter_overeager_cloned)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 23 ~ .iter().filter(|&p| { [INFO] [stdout] 24 + let pos = p.apply_vec(grid); [INFO] [stdout] 25 + pos.is_some() && *pos.unwrap() != '#' [INFO] [stdout] 26 + }).cloned() [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/solutions/day20.rs:196:21 [INFO] [stdout] | [INFO] [stdout] 196 | fn find_char(input: &Vec>, needle: char) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 196 - fn find_char(input: &Vec>, needle: char) -> Option { [INFO] [stdout] 196 + fn find_char(input: &[Vec], needle: char) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day21.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | return Ok(Code { value, code }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 26 - return Ok(Code { value, code }); [INFO] [stdout] 26 + Ok(Code { value, code }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/day21.rs:78:8 [INFO] [stdout] | [INFO] [stdout] 78 | if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 - if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] 78 + if !(r >= 0 || !is_numeric && from == &Coordinate(1, 0)) { [INFO] [stdout] | [INFO] [stdout] 78 - if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] 78 + if (from != &Coordinate(1, 0) || is_numeric) && r < 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/day21.rs:78:17 [INFO] [stdout] | [INFO] [stdout] 78 | if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 - if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] 78 + if r < 0 && !(!is_numeric && from == &Coordinate(1, 0)) { [INFO] [stdout] | [INFO] [stdout] 78 - if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] 78 + if r < 0 && is_numeric || from != &Coordinate(1, 0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/day21.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 - if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] 81 + if !(r <= 0 || is_numeric && from == &Coordinate(2, 0)) { [INFO] [stdout] | [INFO] [stdout] 81 - if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] 81 + if (from != &Coordinate(2, 0) || !is_numeric) && r > 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/day21.rs:81:17 [INFO] [stdout] | [INFO] [stdout] 81 | if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 - if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] 81 + if r > 0 && !(is_numeric && from == &Coordinate(2, 0)) { [INFO] [stdout] | [INFO] [stdout] 81 - if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] 81 + if r > 0 && !is_numeric || from != &Coordinate(2, 0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day21.rs:125:58 [INFO] [stdout] | [INFO] [stdout] 125 | (0, c) => vec![vec![get_horizontal_direction(c); c.abs() as usize]], [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `c.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: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day21.rs:126:56 [INFO] [stdout] | [INFO] [stdout] 126 | (r, 0) => vec![vec![get_vertical_direction(r); r.abs() as usize]], [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `r.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: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day21.rs:139:51 [INFO] [stdout] | [INFO] [stdout] 139 | let mut result = vec![hd.clone(); c.abs() as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `c.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: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day21.rs:148:43 [INFO] [stdout] | [INFO] [stdout] 148 | let mut result = vec![vd; r.abs() as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `r.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: use of `filter_map` with an identity function [INFO] [stdout] --> src/solutions/day21.rs:158:18 [INFO] [stdout] | [INFO] [stdout] 158 | .filter_map(|v| v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day21.rs:221:5 [INFO] [stdout] | [INFO] [stdout] 221 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 221 - return result; [INFO] [stdout] 221 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day21.rs:181:27 [INFO] [stdout] | [INFO] [stdout] 181 | let paths = get_paths(&from, &to, &forbidden); [INFO] [stdout] | ^^^^^ help: change this to: `from` [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/solutions/day21.rs:181:34 [INFO] [stdout] | [INFO] [stdout] 181 | let paths = get_paths(&from, &to, &forbidden); [INFO] [stdout] | ^^^ help: change this to: `to` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/day21.rs:310:47 [INFO] [stdout] | [INFO] [stdout] 310 | (r, c) if r >= 0 && r <= 2 && c >= 0 && c <= 2 => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(0..=2).contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/day21.rs:310:27 [INFO] [stdout] | [INFO] [stdout] 310 | (r, c) if r >= 0 && r <= 2 && c >= 0 && c <= 2 => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(0..=2).contains(&r)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/day21.rs:379:34 [INFO] [stdout] | [INFO] [stdout] 379 | ... .map(|dir| direction_to_pos(dir)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `direction_to_pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day21.rs:431:9 [INFO] [stdout] | [INFO] [stdout] 431 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 431 - return result; [INFO] [stdout] 431 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/solutions/day22.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | / if !result.contains_key(&key) { [INFO] [stdout] 40 | | let bananas = secrets[i + 4] % 10; [INFO] [stdout] 41 | | result.insert(key, bananas); [INFO] [stdout] 42 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 39 ~ result.entry(key).or_insert_with(|| { [INFO] [stdout] 40 + let bananas = secrets[i + 4] % 10; [INFO] [stdout] 41 + bananas [INFO] [stdout] 42 + }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` [INFO] [stdout] --> src/solutions/day23.rs:139:14 [INFO] [stdout] | [INFO] [stdout] 139 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `XOR` contains a capitalized acronym [INFO] [stdout] --> src/solutions/day24.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | XOR(String, String), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Xor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `AND` contains a capitalized acronym [INFO] [stdout] --> src/solutions/day24.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | AND(String, String), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `And` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day24.rs:28:43 [INFO] [stdout] | [INFO] [stdout] 28 | Operation::XOR(l, r) => get_value(&l, ops, values) ^ get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `l` [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/solutions/day24.rs:28:72 [INFO] [stdout] | [INFO] [stdout] 28 | Operation::XOR(l, r) => get_value(&l, ops, values) ^ get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `r` [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/solutions/day24.rs:29:42 [INFO] [stdout] | [INFO] [stdout] 29 | Operation::OR(l, r) => get_value(&l, ops, values) | get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `l` [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/solutions/day24.rs:29:71 [INFO] [stdout] | [INFO] [stdout] 29 | Operation::OR(l, r) => get_value(&l, ops, values) | get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `r` [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/solutions/day24.rs:30:43 [INFO] [stdout] | [INFO] [stdout] 30 | Operation::AND(l, r) => get_value(&l, ops, values) & get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `l` [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/solutions/day24.rs:30:72 [INFO] [stdout] | [INFO] [stdout] 30 | Operation::AND(l, r) => get_value(&l, ops, values) & get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `r` [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: manual implementation of an assign operation [INFO] [stdout] --> src/solutions/day24.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | result = result | ((get_value(&key, ops, values) as usize) << i) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `result |= ((get_value(&key, ops, values) as usize) << i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` 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/solutions/day24.rs:64:26 [INFO] [stdout] | [INFO] [stdout] 64 | if get_value(&key, &ops, &mut HashMap::new()) != x ^ y { [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day24.rs:238:70 [INFO] [stdout] | [INFO] [stdout] 238 | let correct_value = find_half_add(position, ops, &fixed).unwrap(); [INFO] [stdout] | ^^^^^^ help: change this to: `fixed` [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/solutions/day24.rs:263:75 [INFO] [stdout] | [INFO] [stdout] 263 | find_position(position, &prev_value, &prev_carry, &ops, &fixed).unwrap(); [INFO] [stdout] | ^^^^ help: change this to: `ops` [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/solutions/day24.rs:263:81 [INFO] [stdout] | [INFO] [stdout] 263 | find_position(position, &prev_value, &prev_carry, &ops, &fixed).unwrap(); [INFO] [stdout] | ^^^^^^ help: change this to: `fixed` [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/solutions/day24.rs:358:41 [INFO] [stdout] | [INFO] [stdout] 358 | test_position(position, &k, prev_v, prev_c, ops) [INFO] [stdout] | ^^ help: change this to: `k` [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: comparison to empty slice [INFO] [stdout] --> src/solutions/day24.rs:377:16 [INFO] [stdout] | [INFO] [stdout] 377 | if l == "" { [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/day25.rs:25:16 [INFO] [stdout] | [INFO] [stdout] 25 | if l == "" { [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/main.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if let Err(_) = token { [INFO] [stdout] | -------^^^^^^-------- help: try: `if token.is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:83:5 [INFO] [stdout] | [INFO] [stdout] 83 | / return std::fs::copy( [INFO] [stdout] 84 | | "src/solutions/template.rs", [INFO] [stdout] 85 | | format!("src/solutions/day{:02}.rs", selected_day), [INFO] [stdout] 86 | | ); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 83 ~ std::fs::copy( [INFO] [stdout] 84 + "src/solutions/template.rs", [INFO] [stdout] 85 + format!("src/solutions/day{:02}.rs", selected_day), [INFO] [stdout] 86 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | return std::fs::write("src/solutions/mod.rs", contents); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 103 - return std::fs::write("src/solutions/mod.rs", contents); [INFO] [stdout] 103 + std::fs::write("src/solutions/mod.rs", contents) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/day21.rs:229:5 [INFO] [stdout] | [INFO] [stdout] 229 | vec!['A'] [INFO] [stdout] | ^^^^^^^^^ help: you can use an array directly: `['A']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/coordinate.rs:26:41 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn apply_vec<'a, T>(&self, vec: &'a Vec>) -> Option<&'a T> { [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] 26 - pub fn apply_vec<'a, T>(&self, vec: &'a Vec>) -> Option<&'a T> { [INFO] [stdout] 26 + pub fn apply_vec<'a, T>(&self, vec: &'a [Vec]) -> Option<&'a T> { [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/coordinate.rs:66:39 [INFO] [stdout] | [INFO] [stdout] 66 | pub fn get_coordinates_from(input: &Vec>) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 66 - pub fn get_coordinates_from(input: &Vec>) -> impl Iterator { [INFO] [stdout] 66 + pub fn get_coordinates_from(input: &[Vec]) -> impl Iterator { [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/coordinate.rs:145:37 [INFO] [stdout] | [INFO] [stdout] 145 | pub fn print_grid(grid: &Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 145 - pub fn print_grid(grid: &Vec>) { [INFO] [stdout] 145 + pub fn print_grid(grid: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/many_to_many.rs:49:43 [INFO] [stdout] | [INFO] [stdout] 49 | if let Some(set) = self.0.get_mut(&key) { [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/solutions/day01.rs:42:14 [INFO] [stdout] | [INFO] [stdout] 42 | Ok(a.into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day02.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | return negatives == diffs.len(); [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] 22 - return negatives == diffs.len(); [INFO] [stdout] 22 + negatives == diffs.len() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/solutions/day02.rs:11:10 [INFO] [stdout] | [INFO] [stdout] 11 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/solutions/day02.rs:39:47 [INFO] [stdout] | [INFO] [stdout] 39 | Ok(input.iter().filter(|line| is_safe(*line)).count()) [INFO] [stdout] | ^^^^^ help: try: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day02.rs:50:17 [INFO] [stdout] | [INFO] [stdout] 50 | / return (0..line.len()).any(|idx| { [INFO] [stdout] 51 | | is_safe( [INFO] [stdout] 52 | | &line [INFO] [stdout] 53 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 59 | | }); [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 50 ~ (0..line.len()).any(|idx| { [INFO] [stdout] 51 + is_safe( [INFO] [stdout] 52 + &line [INFO] [stdout] 53 + .iter() [INFO] [stdout] 54 + .enumerate() [INFO] [stdout] 55 + .filter(|(i, _)| *i != idx) [INFO] [stdout] 56 + .map(|(_, v)| *v) [INFO] [stdout] 57 + .collect(), [INFO] [stdout] 58 + ) [INFO] [stdout] 59 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/solutions/day02.rs:46:28 [INFO] [stdout] | [INFO] [stdout] 46 | if is_safe(*line) { [INFO] [stdout] | ^^^^^ help: try: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day04.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 67 - return true; [INFO] [stdout] 67 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/day04.rs:44:12 [INFO] [stdout] | [INFO] [stdout] 44 | 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - input: &Vec>, [INFO] [stdout] 44 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day04.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | / return find_individual(input, "MAS", (start.0 + 2, start.1), (-1, 1)) [INFO] [stdout] 104 | | || find_individual(input, "SAM", (start.0 + 2, start.1), (-1, 1)); [INFO] [stdout] | |_________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 103 ~ find_individual(input, "MAS", (start.0 + 2, start.1), (-1, 1)) [INFO] [stdout] 104 ~ || find_individual(input, "SAM", (start.0 + 2, start.1), (-1, 1)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/day05.rs:29:16 [INFO] [stdout] | [INFO] [stdout] 29 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/day05.rs:47:62 [INFO] [stdout] | [INFO] [stdout] 47 | fn update_is_valid(rules: &ManyToMany, update: &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] 47 - fn update_is_valid(rules: &ManyToMany, update: &Vec) -> bool { [INFO] [stdout] 47 + fn update_is_valid(rules: &ManyToMany, update: &[usize]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day05.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 56 - return result; [INFO] [stdout] 56 + result [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/solutions/day05.rs:61:58 [INFO] [stdout] | [INFO] [stdout] 61 | fn sort_update(rules: &ManyToMany, update: &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] 61 ~ fn sort_update(rules: &ManyToMany, update: &[usize]) -> Vec { [INFO] [stdout] 62 ~ let mut result = update.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day05.rs:93:55 [INFO] [stdout] | [INFO] [stdout] 93 | .filter(|v| update_is_valid(&input.rules, &v)) [INFO] [stdout] | ^^ help: change this to: `v` [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/solutions/day05.rs:102:56 [INFO] [stdout] | [INFO] [stdout] 102 | .filter(|v| !update_is_valid(&input.rules, &v)) [INFO] [stdout] | ^^ help: change this to: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day07.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 39 - return false; [INFO] [stdout] 39 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/solutions/day07.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 21 | if self.result % last == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.result.is_multiple_of(last)` [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: unneeded `return` statement [INFO] [stdout] --> src/solutions/day07.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 78 - return false; [INFO] [stdout] 78 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/solutions/day07.rs:48:12 [INFO] [stdout] | [INFO] [stdout] 48 | if self.result % last == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.result.is_multiple_of(last)` [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] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/day08.rs:21:42 [INFO] [stdout] | [INFO] [stdout] 21 | .map(|line| line.chars().map(|v| String::from(v)).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/day08.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | if cell.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `cell.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 `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day09.rs:32:14 [INFO] [stdout] | [INFO] [stdout] 32 | .fold(0, |a, b| a + b); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/solutions/day09.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | .enumerate() [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 30 ~ [INFO] [stdout] 31 ~ .map(|v| *v) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day09.rs:66:14 [INFO] [stdout] | [INFO] [stdout] 66 | .fold(0, |a, b| a + b)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day09.rs:110:14 [INFO] [stdout] | [INFO] [stdout] 110 | .fold(0, |a, b| a + b)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day09.rs:108:22 [INFO] [stdout] | [INFO] [stdout] 108 | .fold(0, |a, b| a + b) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day10.rs:82:10 [INFO] [stdout] | [INFO] [stdout] 82 | .fold(0, |a, b| a + b) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day10.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | return 0; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 80 - return 0; [INFO] [stdout] 80 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day11.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 55 - return result; [INFO] [stdout] 55 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/day11.rs:66:13 [INFO] [stdout] | [INFO] [stdout] 66 | (&formatted[..len / 2]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `formatted[..len / 2]` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/day11.rs:67:13 [INFO] [stdout] | [INFO] [stdout] 67 | (&formatted[len / 2..]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `formatted[len / 2..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day13.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | return a_moves * 3 + b_moves; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 44 - return a_moves * 3 + b_moves; [INFO] [stdout] 44 + a_moves * 3 + b_moves [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day14.rs:87:16 [INFO] [stdout] | [INFO] [stdout] 87 | period(self.velocity.0.abs() as usize, W as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.velocity.0.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 `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day14.rs:88:22 [INFO] [stdout] | [INFO] [stdout] 88 | * period(self.velocity.1.abs() as usize, H as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.velocity.1.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: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/solutions/day14.rs:125:31 [INFO] [stdout] | [INFO] [stdout] 125 | Ok(quadrants.values().fold(1, |a, b| a * b)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/solutions/day15.rs:103:61 [INFO] [stdout] | [INFO] [stdout] 103 | ... .map(|v| left.into_iter().chain(v.into_iter()).collect()) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [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] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 103 - .map(|v| left.into_iter().chain(v.into_iter()).collect()) [INFO] [stdout] 103 + .map(|v| left.into_iter().chain(v).collect()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day15.rs:132:27 [INFO] [stdout] | [INFO] [stdout] 132 | max = max.max(&coord); [INFO] [stdout] | ^^^^^^ help: change this to: `coord` [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: comparison to empty slice [INFO] [stdout] --> src/solutions/day15.rs:175:16 [INFO] [stdout] | [INFO] [stdout] 175 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/day16.rs:13:21 [INFO] [stdout] | [INFO] [stdout] 13 | fn find_char(input: &Vec>, needle: char) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 13 - fn find_char(input: &Vec>, needle: char) -> Option { [INFO] [stdout] 13 + fn find_char(input: &[Vec], needle: char) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day17.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | return machine.output[0]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 104 - return machine.output[0]; [INFO] [stdout] 104 + machine.output[0] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day17.rs:130:36 [INFO] [stdout] | [INFO] [stdout] 130 | let dj = simulate_dontjump(&dontjump); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dontjump` [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/solutions/day19.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 19 | if design.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.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/solutions/day19.rs:42:8 [INFO] [stdout] | [INFO] [stdout] 42 | if design.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/day19.rs:72:23 [INFO] [stdout] | [INFO] [stdout] 72 | let designs = (&lines[2..]) [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `lines[2..]` [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: unnecessarily eager cloning of iterator items [INFO] [stdout] --> src/solutions/day20.rs:20:26 [INFO] [stdout] | [INFO] [stdout] 20 | let mut result = self [INFO] [stdout] | __________________________^ [INFO] [stdout] 21 | | .position [INFO] [stdout] 22 | | .cardinals() [INFO] [stdout] 23 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 27 | | pos.is_some() && *pos.unwrap() != '#' [INFO] [stdout] 28 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned [INFO] [stdout] = note: `#[warn(clippy::iter_overeager_cloned)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 23 ~ .iter().filter(|&p| { [INFO] [stdout] 24 + let pos = p.apply_vec(grid); [INFO] [stdout] 25 + pos.is_some() && *pos.unwrap() != '#' [INFO] [stdout] 26 + }).cloned() [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/solutions/day20.rs:196:21 [INFO] [stdout] | [INFO] [stdout] 196 | fn find_char(input: &Vec>, needle: char) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 196 - fn find_char(input: &Vec>, needle: char) -> Option { [INFO] [stdout] 196 + fn find_char(input: &[Vec], needle: char) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day21.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | return Ok(Code { value, code }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 26 - return Ok(Code { value, code }); [INFO] [stdout] 26 + Ok(Code { value, code }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/day21.rs:78:8 [INFO] [stdout] | [INFO] [stdout] 78 | if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 - if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] 78 + if !(r >= 0 || !is_numeric && from == &Coordinate(1, 0)) { [INFO] [stdout] | [INFO] [stdout] 78 - if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] 78 + if (from != &Coordinate(1, 0) || is_numeric) && r < 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/day21.rs:78:17 [INFO] [stdout] | [INFO] [stdout] 78 | if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 - if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] 78 + if r < 0 && !(!is_numeric && from == &Coordinate(1, 0)) { [INFO] [stdout] | [INFO] [stdout] 78 - if r < 0 && (is_numeric || (!is_numeric && from != &Coordinate(1, 0))) { [INFO] [stdout] 78 + if r < 0 && is_numeric || from != &Coordinate(1, 0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/day21.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 - if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] 81 + if !(r <= 0 || is_numeric && from == &Coordinate(2, 0)) { [INFO] [stdout] | [INFO] [stdout] 81 - if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] 81 + if (from != &Coordinate(2, 0) || !is_numeric) && r > 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/day21.rs:81:17 [INFO] [stdout] | [INFO] [stdout] 81 | if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 - if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] 81 + if r > 0 && !(is_numeric && from == &Coordinate(2, 0)) { [INFO] [stdout] | [INFO] [stdout] 81 - if r > 0 && ((is_numeric && from != &Coordinate(2, 0)) || !is_numeric) { [INFO] [stdout] 81 + if r > 0 && !is_numeric || from != &Coordinate(2, 0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day21.rs:125:58 [INFO] [stdout] | [INFO] [stdout] 125 | (0, c) => vec![vec![get_horizontal_direction(c); c.abs() as usize]], [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `c.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: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day21.rs:126:56 [INFO] [stdout] | [INFO] [stdout] 126 | (r, 0) => vec![vec![get_vertical_direction(r); r.abs() as usize]], [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `r.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: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day21.rs:139:51 [INFO] [stdout] | [INFO] [stdout] 139 | let mut result = vec![hd.clone(); c.abs() as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `c.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: casting the result of `isize::abs()` to usize [INFO] [stdout] --> src/solutions/day21.rs:148:43 [INFO] [stdout] | [INFO] [stdout] 148 | let mut result = vec![vd; r.abs() as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace with: `r.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: use of `filter_map` with an identity function [INFO] [stdout] --> src/solutions/day21.rs:158:18 [INFO] [stdout] | [INFO] [stdout] 158 | .filter_map(|v| v) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day21.rs:221:5 [INFO] [stdout] | [INFO] [stdout] 221 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 221 - return result; [INFO] [stdout] 221 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day21.rs:181:27 [INFO] [stdout] | [INFO] [stdout] 181 | let paths = get_paths(&from, &to, &forbidden); [INFO] [stdout] | ^^^^^ help: change this to: `from` [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/solutions/day21.rs:181:34 [INFO] [stdout] | [INFO] [stdout] 181 | let paths = get_paths(&from, &to, &forbidden); [INFO] [stdout] | ^^^ help: change this to: `to` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/day21.rs:310:47 [INFO] [stdout] | [INFO] [stdout] 310 | (r, c) if r >= 0 && r <= 2 && c >= 0 && c <= 2 => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(0..=2).contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/day21.rs:310:27 [INFO] [stdout] | [INFO] [stdout] 310 | (r, c) if r >= 0 && r <= 2 && c >= 0 && c <= 2 => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(0..=2).contains(&r)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/day21.rs:379:34 [INFO] [stdout] | [INFO] [stdout] 379 | ... .map(|dir| direction_to_pos(dir)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `direction_to_pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/day21.rs:431:9 [INFO] [stdout] | [INFO] [stdout] 431 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 431 - return result; [INFO] [stdout] 431 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/solutions/day22.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | / if !result.contains_key(&key) { [INFO] [stdout] 40 | | let bananas = secrets[i + 4] % 10; [INFO] [stdout] 41 | | result.insert(key, bananas); [INFO] [stdout] 42 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 39 ~ result.entry(key).or_insert_with(|| { [INFO] [stdout] 40 + let bananas = secrets[i + 4] % 10; [INFO] [stdout] 41 + bananas [INFO] [stdout] 42 + }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` [INFO] [stdout] --> src/solutions/day23.rs:139:14 [INFO] [stdout] | [INFO] [stdout] 139 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `XOR` contains a capitalized acronym [INFO] [stdout] --> src/solutions/day24.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | XOR(String, String), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Xor` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `AND` contains a capitalized acronym [INFO] [stdout] --> src/solutions/day24.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | AND(String, String), [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `And` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day24.rs:28:43 [INFO] [stdout] | [INFO] [stdout] 28 | Operation::XOR(l, r) => get_value(&l, ops, values) ^ get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `l` [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/solutions/day24.rs:28:72 [INFO] [stdout] | [INFO] [stdout] 28 | Operation::XOR(l, r) => get_value(&l, ops, values) ^ get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `r` [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/solutions/day24.rs:29:42 [INFO] [stdout] | [INFO] [stdout] 29 | Operation::OR(l, r) => get_value(&l, ops, values) | get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `l` [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/solutions/day24.rs:29:71 [INFO] [stdout] | [INFO] [stdout] 29 | Operation::OR(l, r) => get_value(&l, ops, values) | get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `r` [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/solutions/day24.rs:30:43 [INFO] [stdout] | [INFO] [stdout] 30 | Operation::AND(l, r) => get_value(&l, ops, values) & get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `l` [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/solutions/day24.rs:30:72 [INFO] [stdout] | [INFO] [stdout] 30 | Operation::AND(l, r) => get_value(&l, ops, values) & get_value(&r, ops, values), [INFO] [stdout] | ^^ help: change this to: `r` [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: manual implementation of an assign operation [INFO] [stdout] --> src/solutions/day24.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | result = result | ((get_value(&key, ops, values) as usize) << i) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `result |= ((get_value(&key, ops, values) as usize) << i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` 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/solutions/day24.rs:64:26 [INFO] [stdout] | [INFO] [stdout] 64 | if get_value(&key, &ops, &mut HashMap::new()) != x ^ y { [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/day24.rs:238:70 [INFO] [stdout] | [INFO] [stdout] 238 | let correct_value = find_half_add(position, ops, &fixed).unwrap(); [INFO] [stdout] | ^^^^^^ help: change this to: `fixed` [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/solutions/day24.rs:263:75 [INFO] [stdout] | [INFO] [stdout] 263 | find_position(position, &prev_value, &prev_carry, &ops, &fixed).unwrap(); [INFO] [stdout] | ^^^^ help: change this to: `ops` [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/solutions/day24.rs:263:81 [INFO] [stdout] | [INFO] [stdout] 263 | find_position(position, &prev_value, &prev_carry, &ops, &fixed).unwrap(); [INFO] [stdout] | ^^^^^^ help: change this to: `fixed` [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/solutions/day24.rs:358:41 [INFO] [stdout] | [INFO] [stdout] 358 | test_position(position, &k, prev_v, prev_c, ops) [INFO] [stdout] | ^^ help: change this to: `k` [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: comparison to empty slice [INFO] [stdout] --> src/solutions/day24.rs:377:16 [INFO] [stdout] | [INFO] [stdout] 377 | if l == "" { [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/day25.rs:25:16 [INFO] [stdout] | [INFO] [stdout] 25 | if l == "" { [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/main.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if let Err(_) = token { [INFO] [stdout] | -------^^^^^^-------- help: try: `if token.is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:83:5 [INFO] [stdout] | [INFO] [stdout] 83 | / return std::fs::copy( [INFO] [stdout] 84 | | "src/solutions/template.rs", [INFO] [stdout] 85 | | format!("src/solutions/day{:02}.rs", selected_day), [INFO] [stdout] 86 | | ); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 83 ~ std::fs::copy( [INFO] [stdout] 84 + "src/solutions/template.rs", [INFO] [stdout] 85 + format!("src/solutions/day{:02}.rs", selected_day), [INFO] [stdout] 86 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | return std::fs::write("src/solutions/mod.rs", contents); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 103 - return std::fs::write("src/solutions/mod.rs", contents); [INFO] [stdout] 103 + std::fs::write("src/solutions/mod.rs", contents) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/day21.rs:229:5 [INFO] [stdout] | [INFO] [stdout] 229 | vec!['A'] [INFO] [stdout] | ^^^^^^^^^ help: you can use an array directly: `['A']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 01s [INFO] running `Command { std: "docker" "inspect" "81d13a61cbb6c0aeda9c1617ef43572ddea02a0cf1da9f99867f57f0eee186e8", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "81d13a61cbb6c0aeda9c1617ef43572ddea02a0cf1da9f99867f57f0eee186e8", kill_on_drop: false }` [INFO] [stdout] 81d13a61cbb6c0aeda9c1617ef43572ddea02a0cf1da9f99867f57f0eee186e8