[INFO] cloning repository https://github.com/migerh/aoc2018-rs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/migerh/aoc2018-rs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmigerh%2Faoc2018-rs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmigerh%2Faoc2018-rs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 566d81609c521a1a5658005f490fde85a9d5bda3 [INFO] linting migerh/aoc2018-rs against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmigerh%2Faoc2018-rs" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/migerh/aoc2018-rs [INFO] finished tweaking git repo https://github.com/migerh/aoc2018-rs [INFO] tweaked toml for git repo https://github.com/migerh/aoc2018-rs written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/migerh/aoc2018-rs 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/migerh/aoc2018-rs 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] Downloading crates ... [INFO] [stderr] Downloaded utf8-ranges v1.0.2 [INFO] [stderr] Downloaded memchr v2.1.1 [INFO] [stderr] Downloaded aho-corasick v0.6.9 [INFO] [stderr] Downloaded regex v1.1.0 [INFO] [stderr] Downloaded libc v0.2.44 [INFO] [stderr] Downloaded regex-syntax v0.6.4 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 45bc1bcce842e179077829aa64144b9118591b23111be7adc377a1fbc0ff915b [INFO] running `Command { std: "docker" "start" "-a" "45bc1bcce842e179077829aa64144b9118591b23111be7adc377a1fbc0ff915b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "45bc1bcce842e179077829aa64144b9118591b23111be7adc377a1fbc0ff915b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "45bc1bcce842e179077829aa64144b9118591b23111be7adc377a1fbc0ff915b", kill_on_drop: false }` [INFO] [stdout] 45bc1bcce842e179077829aa64144b9118591b23111be7adc377a1fbc0ff915b [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] d5ff9252b7892780d0c749ad94697cd7cd37b94d0a90cf47def4552ae9c1bcf5 [INFO] running `Command { std: "docker" "start" "-a" "d5ff9252b7892780d0c749ad94697cd7cd37b94d0a90cf47def4552ae9c1bcf5", kill_on_drop: false }` [INFO] [stderr] Compiling version_check v0.1.5 [INFO] [stderr] Compiling libc v0.2.44 [INFO] [stderr] Checking cfg-if v0.1.6 [INFO] [stderr] Checking lazy_static v1.2.0 [INFO] [stderr] Compiling regex v1.1.0 [INFO] [stderr] Checking ucd-util v0.1.3 [INFO] [stderr] Checking utf8-ranges v1.0.2 [INFO] [stderr] Checking thread_local v0.3.6 [INFO] [stderr] Checking regex-syntax v0.6.4 [INFO] [stderr] Compiling memchr v2.1.1 [INFO] [stderr] Checking aho-corasick v0.6.9 [INFO] [stderr] Checking y2018 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/day9/mod.rs:5:21 [INFO] [stdout] | [INFO] [stdout] 5 | fn rotate_forward(self: &mut Self, number: usize) -> Result<(), Error>; [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] 5 - fn rotate_forward(self: &mut Self, number: usize) -> Result<(), Error>; [INFO] [stdout] 5 + fn rotate_forward(&mut self, number: usize) -> Result<(), Error>; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/day9/mod.rs:6:22 [INFO] [stdout] | [INFO] [stdout] 6 | fn rotate_backward(self: &mut Self, number: usize) -> Result<(), Error>; [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] 6 - fn rotate_backward(self: &mut Self, number: usize) -> Result<(), Error>; [INFO] [stdout] 6 + fn rotate_backward(&mut self, number: usize) -> Result<(), Error>; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/day9/mod.rs:5:21 [INFO] [stdout] | [INFO] [stdout] 5 | fn rotate_forward(self: &mut Self, number: usize) -> Result<(), Error>; [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] 5 - fn rotate_forward(self: &mut Self, number: usize) -> Result<(), Error>; [INFO] [stdout] 5 + fn rotate_forward(&mut self, number: usize) -> Result<(), Error>; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/day9/mod.rs:6:22 [INFO] [stdout] | [INFO] [stdout] 6 | fn rotate_backward(self: &mut Self, number: usize) -> Result<(), Error>; [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] 6 - fn rotate_backward(self: &mut Self, number: usize) -> Result<(), Error>; [INFO] [stdout] 6 + fn rotate_backward(&mut self, number: usize) -> Result<(), Error>; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/day16/ops.rs:6:52 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static Fn(State, i32, i32, i32) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static dyn Fn(State, i32, i32, i32) -> Option> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/day19/ops.rs:6:52 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static Fn(State, i128, i128, i128) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static dyn Fn(State, i128, i128, i128) -> Option> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/utils/mod.rs:66:30 [INFO] [stdout] | [INFO] [stdout] 66 | fn cause(&self) -> Option<&std::error::Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 66 | fn cause(&self) -> Option<&dyn std::error::Error> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/day16/ops.rs:6:52 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static Fn(State, i32, i32, i32) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static dyn Fn(State, i32, i32, i32) -> Option> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/day19/ops.rs:6:52 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static Fn(State, i128, i128, i128) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static dyn Fn(State, i128, i128, i128) -> Option> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/utils/mod.rs:66:30 [INFO] [stdout] | [INFO] [stdout] 66 | fn cause(&self) -> Option<&std::error::Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 66 | fn cause(&self) -> Option<&dyn std::error::Error> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day21/ops.rs:87:16 [INFO] [stdout] | [INFO] [stdout] 87 | fn apply_rr(mut state: &mut State, a: i128, b: i128, c: i128, f: F) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day21/ops.rs:94:16 [INFO] [stdout] | [INFO] [stdout] 94 | fn apply_ri(mut state: &mut State, a: i128, b: i128, c: i128, f: F) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day21/ops.rs:101:16 [INFO] [stdout] | [INFO] [stdout] 101 | fn apply_ii(mut state: &mut State, a: i128, b: i128, c: i128, f: F) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day21/ops.rs:108:16 [INFO] [stdout] | [INFO] [stdout] 108 | fn apply_ir(mut state: &mut State, a: i128, b: i128, c: i128, f: F) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day21/ops.rs:87:16 [INFO] [stdout] | [INFO] [stdout] 87 | fn apply_rr(mut state: &mut State, a: i128, b: i128, c: i128, f: F) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day21/ops.rs:94:16 [INFO] [stdout] | [INFO] [stdout] 94 | fn apply_ri(mut state: &mut State, a: i128, b: i128, c: i128, f: F) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day21/ops.rs:101:16 [INFO] [stdout] | [INFO] [stdout] 101 | fn apply_ii(mut state: &mut State, a: i128, b: i128, c: i128, f: F) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day21/ops.rs:108:16 [INFO] [stdout] | [INFO] [stdout] 108 | fn apply_ir(mut state: &mut State, a: i128, b: i128, c: i128, f: F) [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `tick` is never read [INFO] [stdout] --> src/day15/unit.rs:25:7 [INFO] [stdout] | [INFO] [stdout] 20 | pub struct Unit { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] ... [INFO] [stdout] 25 | pub tick: u64, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Unit` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day1/mod.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day1/mod.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/day2/mod.rs:17:3 [INFO] [stdout] | [INFO] [stdout] 17 | / for l in list { [INFO] [stdout] 18 | | if number_of_different_letters(l, s) == 1 { [INFO] [stdout] 19 | | return Some(l); [INFO] [stdout] ... | [INFO] [stdout] 23 | | None [INFO] [stdout] | |______^ help: replace with an iterator: `list.iter().find(|&l| number_of_different_letters(l, s) == 1).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day2/mod.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day2/mod.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | / match find_similar(&serials, serial) { [INFO] [stdout] 35 | | Some(v) => println!("{} is close to {}", serial, v), [INFO] [stdout] 36 | | None => (), [INFO] [stdout] 37 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(v) = find_similar(&serials, serial) { println!("{} is close to {}", serial, v) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day2/mod.rs:57:8 [INFO] [stdout] | [INFO] [stdout] 57 | if entry.0 == "" { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `entry.0.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/day2/mod.rs:79:17 [INFO] [stdout] | [INFO] [stdout] 79 | .filter(|v| *v != ""); [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day3/mod.rs:43:10 [INFO] [stdout] | [INFO] [stdout] 43 | .map(|v| Box::from_str(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Box::from_str` [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: comparison to empty slice [INFO] [stdout] --> src/day3/mod.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day3/mod.rs:96:30 [INFO] [stdout] | [INFO] [stdout] 96 | .and_modify(|v| *v = *v && true) [INFO] [stdout] | ^^^^^^^^^^ help: try: `*v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `tick` is never read [INFO] [stdout] --> src/day15/unit.rs:25:7 [INFO] [stdout] | [INFO] [stdout] 20 | pub struct Unit { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] ... [INFO] [stdout] 25 | pub tick: u64, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Unit` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/day3/mod.rs:111:8 [INFO] [stdout] | [INFO] [stdout] 111 | if d.1 == true { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `d.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day1/mod.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day1/mod.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/day2/mod.rs:17:3 [INFO] [stdout] | [INFO] [stdout] 17 | / for l in list { [INFO] [stdout] 18 | | if number_of_different_letters(l, s) == 1 { [INFO] [stdout] 19 | | return Some(l); [INFO] [stdout] ... | [INFO] [stdout] 23 | | None [INFO] [stdout] | |______^ help: replace with an iterator: `list.iter().find(|&l| number_of_different_letters(l, s) == 1).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day2/mod.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day2/mod.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | / match find_similar(&serials, serial) { [INFO] [stdout] 35 | | Some(v) => println!("{} is close to {}", serial, v), [INFO] [stdout] 36 | | None => (), [INFO] [stdout] 37 | | } [INFO] [stdout] | |_____^ help: try: `if let Some(v) = find_similar(&serials, serial) { println!("{} is close to {}", serial, v) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day2/mod.rs:57:8 [INFO] [stdout] | [INFO] [stdout] 57 | if entry.0 == "" { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `entry.0.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/day2/mod.rs:79:17 [INFO] [stdout] | [INFO] [stdout] 79 | .filter(|v| *v != ""); [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | assert_eq!(has_one_letter_twice(input), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 104 - assert_eq!(has_one_letter_twice(input), true); [INFO] [stdout] 104 + assert!(has_one_letter_twice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day4/mod.rs:98:10 [INFO] [stdout] | [INFO] [stdout] 98 | .map(|v| Record::from_str(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Record::from_str` [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | assert_eq!(has_one_letter_twice(input), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 110 - assert_eq!(has_one_letter_twice(input), false); [INFO] [stdout] 110 + assert!(!has_one_letter_twice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:116:5 [INFO] [stdout] | [INFO] [stdout] 116 | assert_eq!(has_one_letter_twice(input), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 116 - assert_eq!(has_one_letter_twice(input), false); [INFO] [stdout] 116 + assert!(!has_one_letter_twice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:122:5 [INFO] [stdout] | [INFO] [stdout] 122 | assert_eq!(has_one_letter_twice(input), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 122 - assert_eq!(has_one_letter_twice(input), false); [INFO] [stdout] 122 + assert!(!has_one_letter_twice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | assert_eq!(has_one_letter_twice(input), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 128 - assert_eq!(has_one_letter_twice(input), true); [INFO] [stdout] 128 + assert!(has_one_letter_twice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day4/mod.rs:137:33 [INFO] [stdout] | [INFO] [stdout] 137 | .and_modify(|v: &mut u32| *v = *v + *value) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `*v += *value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:134:5 [INFO] [stdout] | [INFO] [stdout] 134 | assert_eq!(has_one_letter_thrice(input), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 134 - assert_eq!(has_one_letter_thrice(input), true); [INFO] [stdout] 134 + assert!(has_one_letter_thrice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:140:5 [INFO] [stdout] | [INFO] [stdout] 140 | assert_eq!(has_one_letter_thrice(input), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 140 - assert_eq!(has_one_letter_thrice(input), false); [INFO] [stdout] 140 + assert!(!has_one_letter_thrice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:146:5 [INFO] [stdout] | [INFO] [stdout] 146 | assert_eq!(has_one_letter_thrice(input), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 146 - assert_eq!(has_one_letter_thrice(input), false); [INFO] [stdout] 146 + assert!(!has_one_letter_thrice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:152:5 [INFO] [stdout] | [INFO] [stdout] 152 | assert_eq!(has_one_letter_thrice(input), false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 152 - assert_eq!(has_one_letter_thrice(input), false); [INFO] [stdout] 152 + assert!(!has_one_letter_thrice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual case-insensitive ASCII comparison [INFO] [stdout] --> src/day5/mod.rs:2:3 [INFO] [stdout] | [INFO] [stdout] 2 | a.to_ascii_lowercase() == b.to_ascii_lowercase() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ignore_case_cmp [INFO] [stdout] = note: `#[warn(clippy::manual_ignore_case_cmp)]` on by default [INFO] [stdout] help: consider using `.eq_ignore_ascii_case()` instead [INFO] [stdout] | [INFO] [stdout] 2 - a.to_ascii_lowercase() == b.to_ascii_lowercase() [INFO] [stdout] 2 + a.eq_ignore_ascii_case(&b) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/day2/mod.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | assert_eq!(has_one_letter_thrice(input), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 158 - assert_eq!(has_one_letter_thrice(input), true); [INFO] [stdout] 158 + assert!(has_one_letter_thrice(input)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day3/mod.rs:43:10 [INFO] [stdout] | [INFO] [stdout] 43 | .map(|v| Box::from_str(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Box::from_str` [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: comparison to empty slice [INFO] [stdout] --> src/day3/mod.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day3/mod.rs:96:30 [INFO] [stdout] | [INFO] [stdout] 96 | .and_modify(|v| *v = *v && true) [INFO] [stdout] | ^^^^^^^^^^ help: try: `*v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day6/mod.rs:53:67 [INFO] [stdout] | [INFO] [stdout] 53 | let closest_point_and_distance = find_closest_point((x, y), &coords); [INFO] [stdout] | ^^^^^^^ help: change this to: `coords` [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: redundant closure [INFO] [stdout] --> src/day6/mod.rs:69:10 [INFO] [stdout] | [INFO] [stdout] 69 | .map(|v| parse_coordinate(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_coordinate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/day3/mod.rs:111:8 [INFO] [stdout] | [INFO] [stdout] 111 | if d.1 == true { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `d.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day6/mod.rs:76:5 [INFO] [stdout] | [INFO] [stdout] 76 | / match closest_point { [INFO] [stdout] 77 | | Some(p) => { [INFO] [stdout] 78 | | area_map.entry(p).and_modify(|v| *v += 1).or_insert(1); [INFO] [stdout] 79 | | if is_infinite(*point) { [INFO] [stdout] ... | [INFO] [stdout] 83 | | None => () [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 76 ~ if let Some(p) = closest_point { [INFO] [stdout] 77 + area_map.entry(p).and_modify(|v| *v += 1).or_insert(1); [INFO] [stdout] 78 + if is_infinite(*point) { [INFO] [stdout] 79 + area_map.entry(p).and_modify(|v| *v = -50000); [INFO] [stdout] 80 + } [INFO] [stdout] 81 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day6/mod.rs:106:10 [INFO] [stdout] | [INFO] [stdout] 106 | .map(|v| parse_coordinate(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_coordinate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day7/common.rs:35:10 [INFO] [stdout] | [INFO] [stdout] 35 | .map(|v| parse_edge(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_edge` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day7/common.rs:55:67 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn all_dependencies_done(rules: &Vec, task: char, done: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 55 - pub fn all_dependencies_done(rules: &Vec, task: char, done: &Vec) -> bool { [INFO] [stdout] 55 + pub fn all_dependencies_done(rules: &Vec, task: char, done: &[char]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day7/problem2.rs:10:66 [INFO] [stdout] | [INFO] [stdout] 10 | fn find_open_tasks(rules: &Vec, done: &Vec, in_work: &Vec) -> BTreeSet { [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] 10 - fn find_open_tasks(rules: &Vec, done: &Vec, in_work: &Vec) -> BTreeSet { [INFO] [stdout] 10 + fn find_open_tasks(rules: &Vec, done: &Vec, in_work: &[char]) -> BTreeSet { [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/day7/problem2.rs:31:34 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn all_workers_idle(workers: &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] 31 - pub fn all_workers_idle(workers: &Vec>) -> bool { [INFO] [stdout] 31 + pub fn all_workers_idle(workers: &[Option]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/day7/problem2.rs:32:26 [INFO] [stdout] | [INFO] [stdout] 32 | workers.iter().all(|w| *w == None) [INFO] [stdout] | ^^^^^^^^^^ help: use `Option::is_none()` instead: `w.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day4/mod.rs:98:10 [INFO] [stdout] | [INFO] [stdout] 98 | .map(|v| Record::from_str(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Record::from_str` [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: manual implementation of an assign operation [INFO] [stdout] --> src/day4/mod.rs:137:33 [INFO] [stdout] | [INFO] [stdout] 137 | .and_modify(|v: &mut u32| *v = *v + *value) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `*v += *value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual case-insensitive ASCII comparison [INFO] [stdout] --> src/day5/mod.rs:2:3 [INFO] [stdout] | [INFO] [stdout] 2 | a.to_ascii_lowercase() == b.to_ascii_lowercase() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ignore_case_cmp [INFO] [stdout] = note: `#[warn(clippy::manual_ignore_case_cmp)]` on by default [INFO] [stdout] help: consider using `.eq_ignore_ascii_case()` instead [INFO] [stdout] | [INFO] [stdout] 2 - a.to_ascii_lowercase() == b.to_ascii_lowercase() [INFO] [stdout] 2 + a.eq_ignore_ascii_case(&b) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day6/mod.rs:53:67 [INFO] [stdout] | [INFO] [stdout] 53 | let closest_point_and_distance = find_closest_point((x, y), &coords); [INFO] [stdout] | ^^^^^^^ help: change this to: `coords` [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: empty string literal in `println!` [INFO] [stdout] --> src/day10/mod.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day10/mod.rs:101:10 [INFO] [stdout] | [INFO] [stdout] 101 | .map(|s| Light::from_str(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Light::from_str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day6/mod.rs:69:10 [INFO] [stdout] | [INFO] [stdout] 69 | .map(|v| parse_coordinate(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_coordinate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day6/mod.rs:76:5 [INFO] [stdout] | [INFO] [stdout] 76 | / match closest_point { [INFO] [stdout] 77 | | Some(p) => { [INFO] [stdout] 78 | | area_map.entry(p).and_modify(|v| *v += 1).or_insert(1); [INFO] [stdout] 79 | | if is_infinite(*point) { [INFO] [stdout] ... | [INFO] [stdout] 83 | | None => () [INFO] [stdout] 84 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 76 ~ if let Some(p) = closest_point { [INFO] [stdout] 77 + area_map.entry(p).and_modify(|v| *v += 1).or_insert(1); [INFO] [stdout] 78 + if is_infinite(*point) { [INFO] [stdout] 79 + area_map.entry(p).and_modify(|v| *v = -50000); [INFO] [stdout] 80 + } [INFO] [stdout] 81 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day6/mod.rs:106:10 [INFO] [stdout] | [INFO] [stdout] 106 | .map(|v| parse_coordinate(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_coordinate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day11/mod.rs:36:29 [INFO] [stdout] | [INFO] [stdout] 36 | fn power_level_square(grid: &Vec, top_left: (usize, usize)) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 36 - fn power_level_square(grid: &Vec, top_left: (usize, usize)) -> i32 { [INFO] [stdout] 36 + fn power_level_square(grid: &[i32], top_left: (usize, usize)) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day11/mod.rs:71:21 [INFO] [stdout] | [INFO] [stdout] 71 | fn get_column(grid: &Vec, top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - fn get_column(grid: &Vec, top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] 71 + fn get_column(grid: &[i32], top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day11/mod.rs:83:18 [INFO] [stdout] | [INFO] [stdout] 83 | fn get_row(grid: &Vec, top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 83 - fn get_row(grid: &Vec, top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] 83 + fn get_row(grid: &[i32], top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day7/common.rs:35:10 [INFO] [stdout] | [INFO] [stdout] 35 | .map(|v| parse_edge(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_edge` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day7/common.rs:55:67 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn all_dependencies_done(rules: &Vec, task: char, done: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 55 - pub fn all_dependencies_done(rules: &Vec, task: char, done: &Vec) -> bool { [INFO] [stdout] 55 + pub fn all_dependencies_done(rules: &Vec, task: char, done: &[char]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/day12/mod.rs:19:21 [INFO] [stdout] | [INFO] [stdout] 19 | if extract == key.to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day12/mod.rs:29:16 [INFO] [stdout] | [INFO] [stdout] 29 | fn checksum(v: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - fn checksum(v: &Vec) -> usize { [INFO] [stdout] 29 + fn checksum(v: &[char]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day7/problem2.rs:10:66 [INFO] [stdout] | [INFO] [stdout] 10 | fn find_open_tasks(rules: &Vec, done: &Vec, in_work: &Vec) -> BTreeSet { [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] 10 - fn find_open_tasks(rules: &Vec, done: &Vec, in_work: &Vec) -> BTreeSet { [INFO] [stdout] 10 + fn find_open_tasks(rules: &Vec, done: &Vec, in_work: &[char]) -> BTreeSet { [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/day7/problem2.rs:31:34 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn all_workers_idle(workers: &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] 31 - pub fn all_workers_idle(workers: &Vec>) -> bool { [INFO] [stdout] 31 + pub fn all_workers_idle(workers: &[Option]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/day7/problem2.rs:32:26 [INFO] [stdout] | [INFO] [stdout] 32 | workers.iter().all(|w| *w == None) [INFO] [stdout] | ^^^^^^^^^^ help: use `Option::is_none()` instead: `w.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13/mod.rs:53:30 [INFO] [stdout] | [INFO] [stdout] 53 | fn drive(cart: Cart, tracks: &Vec>) -> Cart { [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] 53 - fn drive(cart: Cart, tracks: &Vec>) -> Cart { [INFO] [stdout] 53 + fn drive(cart: Cart, tracks: &[Vec]) -> Cart { [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/day13/mod.rs:81:23 [INFO] [stdout] | [INFO] [stdout] 81 | fn find_carts(tracks: &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] 81 - fn find_carts(tracks: &Vec>) -> Vec { [INFO] [stdout] 81 + fn find_carts(tracks: &[Vec]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13/mod.rs:95:26 [INFO] [stdout] | [INFO] [stdout] 95 | fn find_collision(carts: &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] 95 - fn find_collision(carts: &Vec) -> Vec { [INFO] [stdout] 95 + fn find_collision(carts: &[Cart]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/day13/mod.rs:124:33 [INFO] [stdout] | [INFO] [stdout] 124 | let carts_copy: Vec = carts [INFO] [stdout] | _________________________________^ [INFO] [stdout] 125 | | .iter() [INFO] [stdout] 126 | | .map(|v| v.clone()) [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 124 ~ let carts_copy: Vec = carts [INFO] [stdout] 125 + .iter().cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day13/mod.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | if collided.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!collided.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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day13/mod.rs:139:36 [INFO] [stdout] | [INFO] [stdout] 139 | let position = carts[collided[0] as usize].position; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `collided[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessarily eager cloning of iterator items [INFO] [stdout] --> src/day13/mod.rs:183:26 [INFO] [stdout] | [INFO] [stdout] 183 | let unbroken_carts = carts [INFO] [stdout] | ___________________________^ [INFO] [stdout] 184 | | .iter() [INFO] [stdout] | | ______________- [INFO] [stdout] 185 | || .cloned() [INFO] [stdout] 186 | || .filter(|v| !v.broken) [INFO] [stdout] | ||____________________________^ [INFO] [stdout] | |____________________________| [INFO] [stdout] | help: try: `.filter(|&v| !v.broken).cloned()` [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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day13/mod.rs:196:8 [INFO] [stdout] | [INFO] [stdout] 196 | if unbroken_carts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `unbroken_carts.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day15/cave.rs:35:42 [INFO] [stdout] | [INFO] [stdout] 35 | fn print_units_onto_board(printed_board: &mut Vec>, units: &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] 35 - fn print_units_onto_board(printed_board: &mut Vec>, units: &Vec) { [INFO] [stdout] 35 + fn print_units_onto_board(printed_board: &mut [Vec], units: &Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day15/cave.rs:45:34 [INFO] [stdout] | [INFO] [stdout] 45 | fn print_state_with_stats(state: &Vec>, units: &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] 45 - fn print_state_with_stats(state: &Vec>, units: &Vec) { [INFO] [stdout] 45 + fn print_state_with_stats(state: &[Vec], units: &Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day15/cave.rs:45:58 [INFO] [stdout] | [INFO] [stdout] 45 | fn print_state_with_stats(state: &Vec>, units: &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] 45 - fn print_state_with_stats(state: &Vec>, units: &Vec) { [INFO] [stdout] 45 + fn print_state_with_stats(state: &Vec>, units: &[Unit]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day15/cave.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15/cave.rs:82:63 [INFO] [stdout] | [INFO] [stdout] 82 | self.units[index].position = match unit.move_unit(&self) { [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15/cave.rs:87:73 [INFO] [stdout] | [INFO] [stdout] 87 | let (target_index, damage) = match self.units[index].attack(&self) { [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day10/mod.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day10/mod.rs:101:10 [INFO] [stdout] | [INFO] [stdout] 101 | .map(|s| Light::from_str(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Light::from_str` [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: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/day15/unit.rs:50:23 [INFO] [stdout] | [INFO] [stdout] 50 | for (pos, _) in &result { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 50 - for (pos, _) in &result { [INFO] [stdout] 50 + for pos in result.keys() { [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/day11/mod.rs:36:29 [INFO] [stdout] | [INFO] [stdout] 36 | fn power_level_square(grid: &Vec, top_left: (usize, usize)) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 36 - fn power_level_square(grid: &Vec, top_left: (usize, usize)) -> i32 { [INFO] [stdout] 36 + fn power_level_square(grid: &[i32], top_left: (usize, usize)) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day15/unit.rs:115:32 [INFO] [stdout] | [INFO] [stdout] 115 | let mut closest_distance = std::u32::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 115 - let mut closest_distance = std::u32::MAX; [INFO] [stdout] 115 + let mut closest_distance = u32::MAX; [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/day11/mod.rs:71:21 [INFO] [stdout] | [INFO] [stdout] 71 | fn get_column(grid: &Vec, top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - fn get_column(grid: &Vec, top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] 71 + fn get_column(grid: &[i32], top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day11/mod.rs:83:18 [INFO] [stdout] | [INFO] [stdout] 83 | fn get_row(grid: &Vec, top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 83 - fn get_row(grid: &Vec, top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] 83 + fn get_row(grid: &[i32], top_left: (usize, usize), size: usize) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15/unit.rs:117:37 [INFO] [stdout] | [INFO] [stdout] 117 | if !distance_map.contains_key(&pos) { [INFO] [stdout] | ^^^^ help: change this to: `pos` [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/day15/unit.rs:121:35 [INFO] [stdout] | [INFO] [stdout] 121 | let distance = distance_map[&pos]; [INFO] [stdout] | ^^^^ help: change this to: `pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/day15/unit.rs:124:52 [INFO] [stdout] | [INFO] [stdout] 124 | .and_modify(|v: &mut Vec| v.push(pos.clone())) [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/day15/unit.rs:125:25 [INFO] [stdout] | [INFO] [stdout] 125 | .or_insert(vec![pos.clone()]); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day15/unit.rs:132:23 [INFO] [stdout] | [INFO] [stdout] 132 | return (vec![], std::u32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 132 - return (vec![], std::u32::MAX); [INFO] [stdout] 132 + return (vec![], u32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessarily eager cloning of iterator items [INFO] [stdout] --> src/day15/unit.rs:139:30 [INFO] [stdout] | [INFO] [stdout] 139 | let enemies: Vec = cave.units [INFO] [stdout] | _______________________________^ [INFO] [stdout] 140 | | .iter() [INFO] [stdout] | | ______________- [INFO] [stdout] 141 | || .cloned() [INFO] [stdout] 142 | || .filter(|v| v.kind != self.kind) [INFO] [stdout] | ||______________________________________^ [INFO] [stdout] | |______________________________________| [INFO] [stdout] | help: try: `.filter(|&v| v.kind != self.kind).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/day15/unit.rs:175:18 [INFO] [stdout] | [INFO] [stdout] 175 | let target = match Unit::first_position(&target_distances) { [INFO] [stdout] | __________________^ [INFO] [stdout] 176 | | Some(v) => v, [INFO] [stdout] 177 | | None => return None [INFO] [stdout] 178 | | }; [INFO] [stdout] | |_____^ help: try instead: `Unit::first_position(&target_distances)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day15/unit.rs:208:29 [INFO] [stdout] | [INFO] [stdout] 208 | let mut lowest_health = std::i32::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 208 - let mut lowest_health = std::i32::MAX; [INFO] [stdout] 208 + let mut lowest_health = i32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/day12/mod.rs:19:21 [INFO] [stdout] | [INFO] [stdout] 19 | if extract == key.to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `*key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day12/mod.rs:29:16 [INFO] [stdout] | [INFO] [stdout] 29 | fn checksum(v: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - fn checksum(v: &Vec) -> usize { [INFO] [stdout] 29 + fn checksum(v: &[char]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/day15/unit.rs:226:30 [INFO] [stdout] | [INFO] [stdout] 226 | let position_to_attack = match Unit::first_position(&positions) { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 227 | | Some(v) => v, [INFO] [stdout] 228 | | None => return None [INFO] [stdout] 229 | | }; [INFO] [stdout] | |_____^ help: try instead: `Unit::first_position(&positions)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day16/ops.rs:6:20 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static Fn(State, i32, i32, i32) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13/mod.rs:53:30 [INFO] [stdout] | [INFO] [stdout] 53 | fn drive(cart: Cart, tracks: &Vec>) -> Cart { [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] 53 - fn drive(cart: Cart, tracks: &Vec>) -> Cart { [INFO] [stdout] 53 + fn drive(cart: Cart, tracks: &[Vec]) -> Cart { [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/day13/mod.rs:81:23 [INFO] [stdout] | [INFO] [stdout] 81 | fn find_carts(tracks: &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] 81 - fn find_carts(tracks: &Vec>) -> Vec { [INFO] [stdout] 81 + fn find_carts(tracks: &[Vec]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/day16/ops.rs:110:3 [INFO] [stdout] | [INFO] [stdout] 110 | 0 <= v && v < 4 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `(0..4).contains(&v)` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13/mod.rs:95:26 [INFO] [stdout] | [INFO] [stdout] 95 | fn find_collision(carts: &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] 95 - fn find_collision(carts: &Vec) -> Vec { [INFO] [stdout] 95 + fn find_collision(carts: &[Cart]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/day13/mod.rs:124:33 [INFO] [stdout] | [INFO] [stdout] 124 | let carts_copy: Vec = carts [INFO] [stdout] | _________________________________^ [INFO] [stdout] 125 | | .iter() [INFO] [stdout] 126 | | .map(|v| v.clone()) [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 124 ~ let carts_copy: Vec = carts [INFO] [stdout] 125 + .iter().cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day13/mod.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | if collided.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!collided.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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day13/mod.rs:139:36 [INFO] [stdout] | [INFO] [stdout] 139 | let position = carts[collided[0] as usize].position; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `collided[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessarily eager cloning of iterator items [INFO] [stdout] --> src/day13/mod.rs:183:26 [INFO] [stdout] | [INFO] [stdout] 183 | let unbroken_carts = carts [INFO] [stdout] | ___________________________^ [INFO] [stdout] 184 | | .iter() [INFO] [stdout] | | ______________- [INFO] [stdout] 185 | || .cloned() [INFO] [stdout] 186 | || .filter(|v| !v.broken) [INFO] [stdout] | ||____________________________^ [INFO] [stdout] | |____________________________| [INFO] [stdout] | help: try: `.filter(|&v| !v.broken).cloned()` [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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day13/mod.rs:196:8 [INFO] [stdout] | [INFO] [stdout] 196 | if unbroken_carts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `unbroken_carts.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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16/problems.rs:137:36 [INFO] [stdout] | [INFO] [stdout] 137 | let instruction = opcode_map[i as usize][0]; [INFO] [stdout] | ^^^^^^^^^^ help: try: `{ i }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `opcode_map` [INFO] [stdout] --> src/day16/problems.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | for k in 0..opcode_map.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 138 - for k in 0..opcode_map.len() { [INFO] [stdout] 138 + for (k, ) in opcode_map.iter_mut().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day15/cave.rs:35:42 [INFO] [stdout] | [INFO] [stdout] 35 | fn print_units_onto_board(printed_board: &mut Vec>, units: &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] 35 - fn print_units_onto_board(printed_board: &mut Vec>, units: &Vec) { [INFO] [stdout] 35 + fn print_units_onto_board(printed_board: &mut [Vec], units: &Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day15/cave.rs:45:34 [INFO] [stdout] | [INFO] [stdout] 45 | fn print_state_with_stats(state: &Vec>, units: &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] 45 - fn print_state_with_stats(state: &Vec>, units: &Vec) { [INFO] [stdout] 45 + fn print_state_with_stats(state: &[Vec], units: &Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day15/cave.rs:45:58 [INFO] [stdout] | [INFO] [stdout] 45 | fn print_state_with_stats(state: &Vec>, units: &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] 45 - fn print_state_with_stats(state: &Vec>, units: &Vec) { [INFO] [stdout] 45 + fn print_state_with_stats(state: &Vec>, units: &[Unit]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day15/cave.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15/cave.rs:82:63 [INFO] [stdout] | [INFO] [stdout] 82 | self.units[index].position = match unit.move_unit(&self) { [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15/cave.rs:87:73 [INFO] [stdout] | [INFO] [stdout] 87 | let (target_index, damage) = match self.units[index].attack(&self) { [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day17/mod.rs:81:19 [INFO] [stdout] | [INFO] [stdout] 81 | let mut minp = (std::i32::MAX, std::i32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 81 - let mut minp = (std::i32::MAX, std::i32::MAX); [INFO] [stdout] 81 + let mut minp = (i32::MAX, std::i32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day17/mod.rs:81:34 [INFO] [stdout] | [INFO] [stdout] 81 | let mut minp = (std::i32::MAX, std::i32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 81 - let mut minp = (std::i32::MAX, std::i32::MAX); [INFO] [stdout] 81 + let mut minp = (std::i32::MAX, i32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day17/mod.rs:82:19 [INFO] [stdout] | [INFO] [stdout] 82 | let mut maxp = (std::i32::MIN, std::i32::MIN); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 82 - let mut maxp = (std::i32::MIN, std::i32::MIN); [INFO] [stdout] 82 + let mut maxp = (i32::MIN, std::i32::MIN); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day17/mod.rs:82:34 [INFO] [stdout] | [INFO] [stdout] 82 | let mut maxp = (std::i32::MIN, std::i32::MIN); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 82 - let mut maxp = (std::i32::MIN, std::i32::MIN); [INFO] [stdout] 82 + let mut maxp = (std::i32::MIN, i32::MIN); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/day17/mod.rs:125:20 [INFO] [stdout] | [INFO] [stdout] 125 | let c = (n / (10 as i32).pow(2 - l)) % 10; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `10_i32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day17/mod.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/day17/mod.rs:170:3 [INFO] [stdout] | [INFO] [stdout] 165 | / let result = board.can_flow(p) && [INFO] [stdout] 166 | | board.can_flow(water) && [INFO] [stdout] 167 | | board.can_flow(sand) && [INFO] [stdout] 168 | | !board.can_flow(clay); [INFO] [stdout] | |________________________- unnecessary `let` binding [INFO] [stdout] 169 | [INFO] [stdout] 170 | result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 165 ~ [INFO] [stdout] 166 | [INFO] [stdout] 167 ~ board.can_flow(p) && [INFO] [stdout] 168 + board.can_flow(water) && [INFO] [stdout] 169 + board.can_flow(sand) && [INFO] [stdout] 170 + !board.can_flow(clay) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17/mod.rs:211:46 [INFO] [stdout] | [INFO] [stdout] 211 | if flow_left && is_edge(-1, (x - dx, y), &board) { [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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/day17/mod.rs:224:46 [INFO] [stdout] | [INFO] [stdout] 224 | if flow_right && is_edge(1, (x + dx, y), &board) { [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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 `if` has identical blocks [INFO] [stdout] --> src/day17/mod.rs:273:24 [INFO] [stdout] | [INFO] [stdout] 273 | if pos.0 - 1 < 0 { [INFO] [stdout] | ________________________^ [INFO] [stdout] 274 | | can_be_settled = false; [INFO] [stdout] 275 | | } else if board.can_flow((pos.0 - 1, pos.1)) { [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day17/mod.rs:275:52 [INFO] [stdout] | [INFO] [stdout] 275 | } else if board.can_flow((pos.0 - 1, pos.1)) { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 276 | | can_be_settled = false; [INFO] [stdout] 277 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/day15/unit.rs:50:23 [INFO] [stdout] | [INFO] [stdout] 50 | for (pos, _) in &result { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 50 - for (pos, _) in &result { [INFO] [stdout] 50 + for pos in result.keys() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/day17/mod.rs:308:25 [INFO] [stdout] | [INFO] [stdout] 308 | previous_seeds.push(next.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `next` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17/mod.rs:311:54 [INFO] [stdout] | [INFO] [stdout] 311 | let (x, mut y) = match find_next_stop_down(next, &mut board) { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `board` [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/day17/mod.rs:317:46 [INFO] [stdout] | [INFO] [stdout] 317 | let mut next_seeds = fill_bucket((x, y), &mut board); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `board` [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/day17/mod.rs:318:36 [INFO] [stdout] | [INFO] [stdout] 318 | while y > 0 && settle_water(y, &mut board) && next_seeds.is_empty() { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `board` [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/day17/mod.rs:320:40 [INFO] [stdout] | [INFO] [stdout] 320 | next_seeds = fill_bucket((x, y), &mut board); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `board` [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/day17/mod.rs:326:13 [INFO] [stdout] | [INFO] [stdout] 326 | print(&board); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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: usage of a legacy numeric constant [INFO] [stdout] --> src/day15/unit.rs:115:32 [INFO] [stdout] | [INFO] [stdout] 115 | let mut closest_distance = std::u32::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 115 - let mut closest_distance = std::u32::MAX; [INFO] [stdout] 115 + let mut closest_distance = u32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15/unit.rs:117:37 [INFO] [stdout] | [INFO] [stdout] 117 | if !distance_map.contains_key(&pos) { [INFO] [stdout] | ^^^^ help: change this to: `pos` [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/day15/unit.rs:121:35 [INFO] [stdout] | [INFO] [stdout] 121 | let distance = distance_map[&pos]; [INFO] [stdout] | ^^^^ help: change this to: `pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/day15/unit.rs:124:52 [INFO] [stdout] | [INFO] [stdout] 124 | .and_modify(|v: &mut Vec| v.push(pos.clone())) [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/day15/unit.rs:125:25 [INFO] [stdout] | [INFO] [stdout] 125 | .or_insert(vec![pos.clone()]); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day15/unit.rs:132:23 [INFO] [stdout] | [INFO] [stdout] 132 | return (vec![], std::u32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 132 - return (vec![], std::u32::MAX); [INFO] [stdout] 132 + return (vec![], u32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessarily eager cloning of iterator items [INFO] [stdout] --> src/day15/unit.rs:139:30 [INFO] [stdout] | [INFO] [stdout] 139 | let enemies: Vec = cave.units [INFO] [stdout] | _______________________________^ [INFO] [stdout] 140 | | .iter() [INFO] [stdout] | | ______________- [INFO] [stdout] 141 | || .cloned() [INFO] [stdout] 142 | || .filter(|v| v.kind != self.kind) [INFO] [stdout] | ||______________________________________^ [INFO] [stdout] | |______________________________________| [INFO] [stdout] | help: try: `.filter(|&v| v.kind != self.kind).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day18/problems.rs:36:26 [INFO] [stdout] | [INFO] [stdout] 36 | fn find_cycle(checksums: &Vec) -> 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] 36 - fn find_cycle(checksums: &Vec) -> Option { [INFO] [stdout] 36 + fn find_cycle(checksums: &[usize]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/day15/unit.rs:175:18 [INFO] [stdout] | [INFO] [stdout] 175 | let target = match Unit::first_position(&target_distances) { [INFO] [stdout] | __________________^ [INFO] [stdout] 176 | | Some(v) => v, [INFO] [stdout] 177 | | None => return None [INFO] [stdout] 178 | | }; [INFO] [stdout] | |_____^ help: try instead: `Unit::first_position(&target_distances)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day15/unit.rs:208:29 [INFO] [stdout] | [INFO] [stdout] 208 | let mut lowest_health = std::i32::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 208 - let mut lowest_health = std::i32::MAX; [INFO] [stdout] 208 + let mut lowest_health = i32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day18/board.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/day15/unit.rs:226:30 [INFO] [stdout] | [INFO] [stdout] 226 | let position_to_attack = match Unit::first_position(&positions) { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 227 | | Some(v) => v, [INFO] [stdout] 228 | | None => return None [INFO] [stdout] 229 | | }; [INFO] [stdout] | |_____^ help: try instead: `Unit::first_position(&positions)?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day19/ops.rs:6:20 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static Fn(State, i128, i128, i128) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day16/ops.rs:6:20 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static Fn(State, i32, i32, i32) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/day19/ops.rs:110:3 [INFO] [stdout] | [INFO] [stdout] 110 | 0 <= v && v < 6 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `(0..6).contains(&v)` [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: manual `Range::contains` implementation [INFO] [stdout] --> src/day16/ops.rs:110:3 [INFO] [stdout] | [INFO] [stdout] 110 | 0 <= v && v < 4 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `(0..4).contains(&v)` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20/parser.rs:19:39 [INFO] [stdout] | [INFO] [stdout] 19 | let options = recursive_parse(&mut s); [INFO] [stdout] | ^^^^^^ help: change this to: `s` [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/day20/parser.rs:43:6 [INFO] [stdout] | [INFO] [stdout] 43 | if buffer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!buffer.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day20/analysis.rs:17:15 [INFO] [stdout] | [INFO] [stdout] 17 | directions: &String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 17 - directions: &String, [INFO] [stdout] 17 + directions: &str, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/day20/analysis.rs:23:19 [INFO] [stdout] | [INFO] [stdout] 23 | let old_pos = pos.clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20/analysis.rs:53:45 [INFO] [stdout] | [INFO] [stdout] 53 | let result = walk_and_count_new_rooms(&v, &mut pos, &mut map); [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/day20/analysis.rs:53:49 [INFO] [stdout] | [INFO] [stdout] 53 | let result = walk_and_count_new_rooms(&v, &mut pos, &mut map); [INFO] [stdout] | ^^^^^^^^ help: change this to: `pos` [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/day20/analysis.rs:53:59 [INFO] [stdout] | [INFO] [stdout] 53 | let result = walk_and_count_new_rooms(&v, &mut pos, &mut map); [INFO] [stdout] | ^^^^^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/day20/analysis.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | let old_pos = pos.clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20/analysis.rs:62:37 [INFO] [stdout] | [INFO] [stdout] 62 | lengths.push(count_rooms(d, &mut pos, &mut map, indent + 1, rooms)); [INFO] [stdout] | ^^^^^^^^ help: change this to: `pos` [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/day20/analysis.rs:62:47 [INFO] [stdout] | [INFO] [stdout] 62 | lengths.push(count_rooms(d, &mut pos, &mut map, indent + 1, rooms)); [INFO] [stdout] | ^^^^^^^^ help: change this to: `map` [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/day20/analysis.rs:76:52 [INFO] [stdout] | [INFO] [stdout] 76 | let result = v.iter().map(|v| count_rooms(v, &mut pos, &mut map, indent + 1, rooms)).sum(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `pos` [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/day20/analysis.rs:76:62 [INFO] [stdout] | [INFO] [stdout] 76 | let result = v.iter().map(|v| count_rooms(v, &mut pos, &mut map, indent + 1, rooms)).sum(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `map` [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: parameter is only used in recursion [INFO] [stdout] --> src/day20/analysis.rs:42:3 [INFO] [stdout] | [INFO] [stdout] 42 | indent: usize, [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_indent` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/day20/analysis.rs:62:57 [INFO] [stdout] | [INFO] [stdout] 62 | lengths.push(count_rooms(d, &mut pos, &mut map, indent + 1, rooms)); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 76 | let result = v.iter().map(|v| count_rooms(v, &mut pos, &mut map, indent + 1, rooms)).sum(); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/day20/analysis.rs:43:3 [INFO] [stdout] | [INFO] [stdout] 43 | rooms: &mut usize, [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_rooms` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/day20/analysis.rs:62:69 [INFO] [stdout] | [INFO] [stdout] 62 | lengths.push(count_rooms(d, &mut pos, &mut map, indent + 1, rooms)); [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 76 | let result = v.iter().map(|v| count_rooms(v, &mut pos, &mut map, indent + 1, rooms)).sum(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16/problems.rs:137:36 [INFO] [stdout] | [INFO] [stdout] 137 | let instruction = opcode_map[i as usize][0]; [INFO] [stdout] | ^^^^^^^^^^ help: try: `{ i }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `opcode_map` [INFO] [stdout] --> src/day16/problems.rs:138:16 [INFO] [stdout] | [INFO] [stdout] 138 | for k in 0..opcode_map.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 138 - for k in 0..opcode_map.len() { [INFO] [stdout] 138 + for (k, ) in opcode_map.iter_mut().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/day21/ops.rs:84:3 [INFO] [stdout] | [INFO] [stdout] 84 | 0 <= v && v < 6 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `(0..6).contains(&v)` [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: usage of a legacy numeric constant [INFO] [stdout] --> src/day17/mod.rs:81:19 [INFO] [stdout] | [INFO] [stdout] 81 | let mut minp = (std::i32::MAX, std::i32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 81 - let mut minp = (std::i32::MAX, std::i32::MAX); [INFO] [stdout] 81 + let mut minp = (i32::MAX, std::i32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day17/mod.rs:81:34 [INFO] [stdout] | [INFO] [stdout] 81 | let mut minp = (std::i32::MAX, std::i32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 81 - let mut minp = (std::i32::MAX, std::i32::MAX); [INFO] [stdout] 81 + let mut minp = (std::i32::MAX, i32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day17/mod.rs:82:19 [INFO] [stdout] | [INFO] [stdout] 82 | let mut maxp = (std::i32::MIN, std::i32::MIN); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 82 - let mut maxp = (std::i32::MIN, std::i32::MIN); [INFO] [stdout] 82 + let mut maxp = (i32::MIN, std::i32::MIN); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day17/mod.rs:82:34 [INFO] [stdout] | [INFO] [stdout] 82 | let mut maxp = (std::i32::MIN, std::i32::MIN); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 82 - let mut maxp = (std::i32::MIN, std::i32::MIN); [INFO] [stdout] 82 + let mut maxp = (std::i32::MIN, i32::MIN); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i32` is unnecessary [INFO] [stdout] --> src/day17/mod.rs:125:20 [INFO] [stdout] | [INFO] [stdout] 125 | let c = (n / (10 as i32).pow(2 - l)) % 10; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `10_i32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day17/mod.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day22/mod.rs:16:27 [INFO] [stdout] | [INFO] [stdout] 16 | if p.0 == 0 && p.1 == 0 { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 17 | | 0 [INFO] [stdout] 18 | | } else if p.0 == target.0 && p.1 == target.1 { [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day22/mod.rs:18:48 [INFO] [stdout] | [INFO] [stdout] 18 | } else if p.0 == target.0 && p.1 == target.1 { [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 19 | | 0 [INFO] [stdout] 20 | | } else if p.0 == 0 { [INFO] [stdout] | |___^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/day17/mod.rs:170:3 [INFO] [stdout] | [INFO] [stdout] 165 | / let result = board.can_flow(p) && [INFO] [stdout] 166 | | board.can_flow(water) && [INFO] [stdout] 167 | | board.can_flow(sand) && [INFO] [stdout] 168 | | !board.can_flow(clay); [INFO] [stdout] | |________________________- unnecessary `let` binding [INFO] [stdout] 169 | [INFO] [stdout] 170 | result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 165 ~ [INFO] [stdout] 166 | [INFO] [stdout] 167 ~ board.can_flow(p) && [INFO] [stdout] 168 + board.can_flow(water) && [INFO] [stdout] 169 + board.can_flow(sand) && [INFO] [stdout] 170 + !board.can_flow(clay) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17/mod.rs:211:46 [INFO] [stdout] | [INFO] [stdout] 211 | if flow_left && is_edge(-1, (x - dx, y), &board) { [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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/day17/mod.rs:224:46 [INFO] [stdout] | [INFO] [stdout] 224 | if flow_right && is_edge(1, (x + dx, y), &board) { [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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 `if` has identical blocks [INFO] [stdout] --> src/day17/mod.rs:273:24 [INFO] [stdout] | [INFO] [stdout] 273 | if pos.0 - 1 < 0 { [INFO] [stdout] | ________________________^ [INFO] [stdout] 274 | | can_be_settled = false; [INFO] [stdout] 275 | | } else if board.can_flow((pos.0 - 1, pos.1)) { [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day17/mod.rs:275:52 [INFO] [stdout] | [INFO] [stdout] 275 | } else if board.can_flow((pos.0 - 1, pos.1)) { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 276 | | can_be_settled = false; [INFO] [stdout] 277 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/day17/mod.rs:308:25 [INFO] [stdout] | [INFO] [stdout] 308 | previous_seeds.push(next.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `next` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17/mod.rs:311:54 [INFO] [stdout] | [INFO] [stdout] 311 | let (x, mut y) = match find_next_stop_down(next, &mut board) { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `board` [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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/day22/mod.rs:131:38 [INFO] [stdout] | [INFO] [stdout] 131 | if let Some(first_non_empty_log) = backlog.iter_mut().filter(|(_, v)| !v.is_empty()).next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `backlog.iter_mut().find(|(_, v)| !v.is_empty())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` 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/day17/mod.rs:317:46 [INFO] [stdout] | [INFO] [stdout] 317 | let mut next_seeds = fill_bucket((x, y), &mut board); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `board` [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/day17/mod.rs:318:36 [INFO] [stdout] | [INFO] [stdout] 318 | while y > 0 && settle_water(y, &mut board) && next_seeds.is_empty() { [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `board` [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/day17/mod.rs:320:40 [INFO] [stdout] | [INFO] [stdout] 320 | next_seeds = fill_bucket((x, y), &mut board); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `board` [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/day17/mod.rs:326:13 [INFO] [stdout] | [INFO] [stdout] 326 | print(&board); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day18/problems.rs:36:26 [INFO] [stdout] | [INFO] [stdout] 36 | fn find_cycle(checksums: &Vec) -> 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] 36 - fn find_cycle(checksums: &Vec) -> Option { [INFO] [stdout] 36 + fn find_cycle(checksums: &[usize]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day23/mod.rs:49:10 [INFO] [stdout] | [INFO] [stdout] 49 | .map(|s| NanoBot::from_str(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `NanoBot::from_str` [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: using `clone` on type `(f64, f64, f64)` which implements the `Copy` trait [INFO] [stdout] --> src/day23/mod.rs:70:33 [INFO] [stdout] | [INFO] [stdout] 70 | manhattan_distance(b.pos, strongest_bot.pos.clone()) <= strongest_bot.radius [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `strongest_bot.pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day23/mod.rs:79:21 [INFO] [stdout] | [INFO] [stdout] 79 | fn scale_bots(bots: &Vec, scale: f64) -> 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] 79 ~ fn scale_bots(bots: &[NanoBot], scale: f64) -> Vec { [INFO] [stdout] 80 ~ let mut scaled_bots = bots.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day23/mod.rs:110:28 [INFO] [stdout] | [INFO] [stdout] 110 | let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 110 - let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] 110 + let mut closest_point = (f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day23/mod.rs:110:43 [INFO] [stdout] | [INFO] [stdout] 110 | let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 110 - let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] 110 + let mut closest_point = (std::f64::MAX, f64::MAX, std::f64::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day23/mod.rs:110:58 [INFO] [stdout] | [INFO] [stdout] 110 | let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 110 - let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] 110 + let mut closest_point = (std::f64::MAX, std::f64::MAX, f64::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day23/mod.rs:111:31 [INFO] [stdout] | [INFO] [stdout] 111 | let mut closest_manhattan = std::f64::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 111 - let mut closest_manhattan = std::f64::MAX; [INFO] [stdout] 111 + let mut closest_manhattan = f64::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day18/board.rs:102:5 [INFO] [stdout] | [INFO] [stdout] 102 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `at` after checking its variant with `is_some` [INFO] [stdout] --> src/day24/parse.rs:30:39 [INFO] [stdout] | [INFO] [stdout] 29 | if at.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = at` [INFO] [stdout] 30 | attack_type.insert(parse_attack(at.unwrap().as_str())?); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day19/ops.rs:6:20 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn op_map() -> BTreeMap<&'static str, &'static Fn(State, i128, i128, i128) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/day19/ops.rs:110:3 [INFO] [stdout] | [INFO] [stdout] 110 | 0 <= v && v < 6 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `(0..6).contains(&v)` [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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/day24/parse.rs:91:6 [INFO] [stdout] | [INFO] [stdout] 91 | .filter(|v| v.is_some()) [INFO] [stdout] | ______^ [INFO] [stdout] 92 | | .map(|v| v.unwrap()) [INFO] [stdout] | |________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessarily eager cloning of iterator items [INFO] [stdout] --> src/day24/parse.rs:86:16 [INFO] [stdout] | [INFO] [stdout] 86 | let groups = input.split("\n") [INFO] [stdout] | _________________^ [INFO] [stdout] 87 | | .map(|v| parse_group(v, affiliation.clone())) [INFO] [stdout] 88 | | .collect::>, ParseError>>()? [INFO] [stdout] 89 | | .iter() [INFO] [stdout] | | ____________- [INFO] [stdout] 90 | || .cloned() [INFO] [stdout] 91 | || .filter(|v| v.is_some()) [INFO] [stdout] | ||____________________________^ [INFO] [stdout] | |____________________________| [INFO] [stdout] | help: try: `.filter(|&v| v.is_some()).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24/group.rs:49:39 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn select_target(&self, groups: &Vec, already_selected: &Vec) -> 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] 49 - pub fn select_target(&self, groups: &Vec, already_selected: &Vec) -> Option { [INFO] [stdout] 49 + pub fn select_target(&self, groups: &[Group], already_selected: &Vec) -> Option { [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/day24/group.rs:49:70 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn select_target(&self, groups: &Vec, already_selected: &Vec) -> 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] 49 - pub fn select_target(&self, groups: &Vec, already_selected: &Vec) -> Option { [INFO] [stdout] 49 + pub fn select_target(&self, groups: &Vec, already_selected: &[usize]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `available_enemies.get(0)` [INFO] [stdout] --> src/day24/group.rs:70:26 [INFO] [stdout] | [INFO] [stdout] 70 | if let Some(group) = available_enemies.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `available_enemies.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24/problems.rs:8:19 [INFO] [stdout] | [INFO] [stdout] 8 | fn _print(groups: &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] 8 - fn _print(groups: &Vec) { [INFO] [stdout] 8 + fn _print(groups: &[Group]) { [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/day24/problems.rs:20:35 [INFO] [stdout] | [INFO] [stdout] 20 | fn target_selection_order(groups: &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] 20 ~ fn target_selection_order(groups: &[Group]) -> Vec { [INFO] [stdout] 21 ~ let mut target_selection_groups = groups.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/day24/problems.rs:31:48 [INFO] [stdout] | [INFO] [stdout] 31 | let selection_order = target_selection_order(&groups); [INFO] [stdout] | ^^^^^^^ help: change this to: `groups` [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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/day24/problems.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | let group = groups.iter().filter(|v| v.id == id).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `groups.iter().find(|v| v.id == id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day24/problems.rs:36:47 [INFO] [stdout] | [INFO] [stdout] 36 | if let Some(target) = group.select_target(&groups, &already_selected) { [INFO] [stdout] | ^^^^^^^ help: change this to: `groups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24/problems.rs:45:35 [INFO] [stdout] | [INFO] [stdout] 45 | fn determine_attack_order(groups: &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] 45 ~ fn determine_attack_order(groups: &[Group]) -> Vec { [INFO] [stdout] 46 ~ let mut attack_order = groups.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/day24/problems.rs:56:17 [INFO] [stdout] | [INFO] [stdout] 56 | let group = groups.iter().filter(|v| v.id == id).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `groups.iter().find(|v| v.id == id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/day24/problems.rs:62:42 [INFO] [stdout] | [INFO] [stdout] 62 | let (target_index, target_group) = groups.iter().enumerate().filter(|(_, v)| v.id == *target).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `groups.iter().enumerate().find(|(_, v)| v.id == *target)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20/parser.rs:19:39 [INFO] [stdout] | [INFO] [stdout] 19 | let options = recursive_parse(&mut s); [INFO] [stdout] | ^^^^^^ help: change this to: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24/problems.rs:87:30 [INFO] [stdout] | [INFO] [stdout] 87 | fn battle_is_ongoing(groups: &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] 87 - fn battle_is_ongoing(groups: &Vec) -> bool { [INFO] [stdout] 87 + fn battle_is_ongoing(groups: &[Group]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day20/parser.rs:43:6 [INFO] [stdout] | [INFO] [stdout] 43 | if buffer.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!buffer.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day20/analysis.rs:17:15 [INFO] [stdout] | [INFO] [stdout] 17 | directions: &String, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 17 - directions: &String, [INFO] [stdout] 17 + directions: &str, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/day20/analysis.rs:23:19 [INFO] [stdout] | [INFO] [stdout] 23 | let old_pos = pos.clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20/analysis.rs:53:45 [INFO] [stdout] | [INFO] [stdout] 53 | let result = walk_and_count_new_rooms(&v, &mut pos, &mut map); [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/day20/analysis.rs:53:49 [INFO] [stdout] | [INFO] [stdout] 53 | let result = walk_and_count_new_rooms(&v, &mut pos, &mut map); [INFO] [stdout] | ^^^^^^^^ help: change this to: `pos` [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/day20/analysis.rs:53:59 [INFO] [stdout] | [INFO] [stdout] 53 | let result = walk_and_count_new_rooms(&v, &mut pos, &mut map); [INFO] [stdout] | ^^^^^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/day20/analysis.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | let old_pos = pos.clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20/analysis.rs:62:37 [INFO] [stdout] | [INFO] [stdout] 62 | lengths.push(count_rooms(d, &mut pos, &mut map, indent + 1, rooms)); [INFO] [stdout] | ^^^^^^^^ help: change this to: `pos` [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/day20/analysis.rs:62:47 [INFO] [stdout] | [INFO] [stdout] 62 | lengths.push(count_rooms(d, &mut pos, &mut map, indent + 1, rooms)); [INFO] [stdout] | ^^^^^^^^ help: change this to: `map` [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/day20/analysis.rs:76:52 [INFO] [stdout] | [INFO] [stdout] 76 | let result = v.iter().map(|v| count_rooms(v, &mut pos, &mut map, indent + 1, rooms)).sum(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `pos` [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/day20/analysis.rs:76:62 [INFO] [stdout] | [INFO] [stdout] 76 | let result = v.iter().map(|v| count_rooms(v, &mut pos, &mut map, indent + 1, rooms)).sum(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `map` [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: parameter is only used in recursion [INFO] [stdout] --> src/day20/analysis.rs:42:3 [INFO] [stdout] | [INFO] [stdout] 42 | indent: usize, [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_indent` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/day20/analysis.rs:62:57 [INFO] [stdout] | [INFO] [stdout] 62 | lengths.push(count_rooms(d, &mut pos, &mut map, indent + 1, rooms)); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 76 | let result = v.iter().map(|v| count_rooms(v, &mut pos, &mut map, indent + 1, rooms)).sum(); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/day20/analysis.rs:43:3 [INFO] [stdout] | [INFO] [stdout] 43 | rooms: &mut usize, [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_rooms` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/day20/analysis.rs:62:69 [INFO] [stdout] | [INFO] [stdout] 62 | lengths.push(count_rooms(d, &mut pos, &mut map, indent + 1, rooms)); [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 76 | let result = v.iter().map(|v| count_rooms(v, &mut pos, &mut map, indent + 1, rooms)).sum(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day25/mod.rs:45:10 [INFO] [stdout] | [INFO] [stdout] 45 | .map(|v| Point::from_str(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Point::from_str` [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: comparison to empty slice [INFO] [stdout] --> src/day25/mod.rs:44:17 [INFO] [stdout] | [INFO] [stdout] 44 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/day25/mod.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | let last = points.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 73 ~ while let Some(last) = points.pop() { [INFO] [stdout] 74 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/utils/mod.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/day21/ops.rs:84:3 [INFO] [stdout] | [INFO] [stdout] 84 | 0 <= v && v < 6 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `(0..6).contains(&v)` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:113:3 [INFO] [stdout] | [INFO] [stdout] 113 | / match run() { [INFO] [stdout] 114 | | Err(err) => println!("Error occurred: {}", err), [INFO] [stdout] 115 | | _ => {} [INFO] [stdout] 116 | | } [INFO] [stdout] | |___^ help: try: `if let Err(err) = run() { println!("Error occurred: {}", err) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `REFallsAsleep` should have an upper case name [INFO] [stdout] --> src/day4/mod.rs:34:18 [INFO] [stdout] | [INFO] [stdout] 34 | static ref REFallsAsleep: Regex = Regex::new(r"falls asleep").unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_upper_case_globals)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 34 - static ref REFallsAsleep: Regex = Regex::new(r"falls asleep").unwrap(); [INFO] [stdout] 34 + static ref REFALLS_ASLEEP: Regex = Regex::new(r"falls asleep").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `REWakesUp` should have an upper case name [INFO] [stdout] --> src/day4/mod.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 35 | static ref REWakesUp: Regex = Regex::new(r"wakes up").unwrap(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 35 - static ref REWakesUp: Regex = Regex::new(r"wakes up").unwrap(); [INFO] [stdout] 35 + static ref REWAKES_UP: Regex = Regex::new(r"wakes up").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `REStarts` should have an upper case name [INFO] [stdout] --> src/day4/mod.rs:36:18 [INFO] [stdout] | [INFO] [stdout] 36 | static ref REStarts: Regex = Regex::new(r"Guard \#(\d+) begins shift").unwrap(); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 36 - static ref REStarts: Regex = Regex::new(r"Guard \#(\d+) begins shift").unwrap(); [INFO] [stdout] 36 + static ref RESTARTS: Regex = Regex::new(r"Guard \#(\d+) begins shift").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day22/mod.rs:16:27 [INFO] [stdout] | [INFO] [stdout] 16 | if p.0 == 0 && p.1 == 0 { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 17 | | 0 [INFO] [stdout] 18 | | } else if p.0 == target.0 && p.1 == target.1 { [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day22/mod.rs:18:48 [INFO] [stdout] | [INFO] [stdout] 18 | } else if p.0 == target.0 && p.1 == target.1 { [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 19 | | 0 [INFO] [stdout] 20 | | } else if p.0 == 0 { [INFO] [stdout] | |___^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `REEdge` should have an upper case name [INFO] [stdout] --> src/day7/common.rs:16:18 [INFO] [stdout] | [INFO] [stdout] 16 | static ref REEdge: Regex = Regex::new(r"Step (.) must be finished before step (.) can begin\.").unwrap(); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 16 - static ref REEdge: Regex = Regex::new(r"Step (.) must be finished before step (.) can begin\.").unwrap(); [INFO] [stdout] 16 + static ref REEDGE: Regex = Regex::new(r"Step (.) must be finished before step (.) can begin\.").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_state` should have an upper case name [INFO] [stdout] --> src/day16/problems.rs:26:16 [INFO] [stdout] | [INFO] [stdout] 26 | static ref RE_state: Regex = Regex::new(r"\[(\d+), (\d+), (\d+), (\d+)\]").unwrap(); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 26 - static ref RE_state: Regex = Regex::new(r"\[(\d+), (\d+), (\d+), (\d+)\]").unwrap(); [INFO] [stdout] 26 + static ref RE_STATE: Regex = Regex::new(r"\[(\d+), (\d+), (\d+), (\d+)\]").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_instruction` should have an upper case name [INFO] [stdout] --> src/day16/problems.rs:39:16 [INFO] [stdout] | [INFO] [stdout] 39 | static ref RE_instruction: Regex = Regex::new(r"(\d+) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 39 - static ref RE_instruction: Regex = Regex::new(r"(\d+) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] 39 + static ref RE_INSTRUCTION: Regex = Regex::new(r"(\d+) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/day22/mod.rs:131:38 [INFO] [stdout] | [INFO] [stdout] 131 | if let Some(first_non_empty_log) = backlog.iter_mut().filter(|(_, v)| !v.is_empty()).next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `backlog.iter_mut().find(|(_, v)| !v.is_empty())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_before` should have an upper case name [INFO] [stdout] --> src/day16/problems.rs:84:16 [INFO] [stdout] | [INFO] [stdout] 84 | static ref RE_before: Regex = Regex::new(r"Before:").unwrap(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 84 - static ref RE_before: Regex = Regex::new(r"Before:").unwrap(); [INFO] [stdout] 84 + static ref RE_BEFORE: Regex = Regex::new(r"Before:").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_x` should have an upper case name [INFO] [stdout] --> src/day17/mod.rs:64:16 [INFO] [stdout] | [INFO] [stdout] 64 | static ref RE_x: Regex = Regex::new(r"x=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case (notice the capitalization) [INFO] [stdout] | [INFO] [stdout] 64 - static ref RE_x: Regex = Regex::new(r"x=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] 64 + static ref RE_X: Regex = Regex::new(r"x=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_y` should have an upper case name [INFO] [stdout] --> src/day17/mod.rs:65:16 [INFO] [stdout] | [INFO] [stdout] 65 | static ref RE_y: Regex = Regex::new(r"y=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case (notice the capitalization) [INFO] [stdout] | [INFO] [stdout] 65 - static ref RE_y: Regex = Regex::new(r"y=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] 65 + static ref RE_Y: Regex = Regex::new(r"y=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_ip` should have an upper case name [INFO] [stdout] --> src/day19/problems.rs:16:16 [INFO] [stdout] | [INFO] [stdout] 16 | static ref RE_ip: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 16 - static ref RE_ip: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] 16 + static ref RE_IP: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_instruction` should have an upper case name [INFO] [stdout] --> src/day19/problems.rs:29:16 [INFO] [stdout] | [INFO] [stdout] 29 | static ref RE_instruction: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 29 - static ref RE_instruction: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] 29 + static ref RE_INSTRUCTION: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day23/mod.rs:49:10 [INFO] [stdout] | [INFO] [stdout] 49 | .map(|s| NanoBot::from_str(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `NanoBot::from_str` [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: using `clone` on type `(f64, f64, f64)` which implements the `Copy` trait [INFO] [stdout] --> src/day23/mod.rs:70:33 [INFO] [stdout] | [INFO] [stdout] 70 | manhattan_distance(b.pos, strongest_bot.pos.clone()) <= strongest_bot.radius [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `strongest_bot.pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_ip` should have an upper case name [INFO] [stdout] --> src/day21/problems.rs:17:16 [INFO] [stdout] | [INFO] [stdout] 17 | static ref RE_ip: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 17 - static ref RE_ip: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] 17 + static ref RE_IP: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day23/mod.rs:79:21 [INFO] [stdout] | [INFO] [stdout] 79 | fn scale_bots(bots: &Vec, scale: f64) -> 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] 79 ~ fn scale_bots(bots: &[NanoBot], scale: f64) -> Vec { [INFO] [stdout] 80 ~ let mut scaled_bots = bots.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_instruction` should have an upper case name [INFO] [stdout] --> src/day21/problems.rs:30:16 [INFO] [stdout] | [INFO] [stdout] 30 | static ref RE_instruction: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 30 - static ref RE_instruction: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] 30 + static ref RE_INSTRUCTION: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day23/mod.rs:110:28 [INFO] [stdout] | [INFO] [stdout] 110 | let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 110 - let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] 110 + let mut closest_point = (f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day23/mod.rs:110:43 [INFO] [stdout] | [INFO] [stdout] 110 | let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 110 - let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] 110 + let mut closest_point = (std::f64::MAX, f64::MAX, std::f64::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day23/mod.rs:110:58 [INFO] [stdout] | [INFO] [stdout] 110 | let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 110 - let mut closest_point = (std::f64::MAX, std::f64::MAX, std::f64::MAX); [INFO] [stdout] 110 + let mut closest_point = (std::f64::MAX, std::f64::MAX, f64::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/day23/mod.rs:111:31 [INFO] [stdout] | [INFO] [stdout] 111 | let mut closest_manhattan = std::f64::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 111 - let mut closest_manhattan = std::f64::MAX; [INFO] [stdout] 111 + let mut closest_manhattan = f64::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_bot` should have an upper case name [INFO] [stdout] --> src/day23/mod.rs:25:18 [INFO] [stdout] | [INFO] [stdout] 25 | static ref RE_bot: Regex = Regex::new(r"pos=<(-?\d+),(-?\d+),(-?\d+)>, r=(\d+)").unwrap(); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 25 - static ref RE_bot: Regex = Regex::new(r"pos=<(-?\d+),(-?\d+),(-?\d+)>, r=(\d+)").unwrap(); [INFO] [stdout] 25 + static ref RE_BOT: Regex = Regex::new(r"pos=<(-?\d+),(-?\d+),(-?\d+)>, r=(\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_weak` should have an upper case name [INFO] [stdout] --> src/day24/parse.rs:39:16 [INFO] [stdout] | [INFO] [stdout] 39 | static ref RE_weak: Regex = Regex::new(r"weak to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 39 - static ref RE_weak: Regex = Regex::new(r"weak to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] 39 + static ref RE_WEAK: Regex = Regex::new(r"weak to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_immune` should have an upper case name [INFO] [stdout] --> src/day24/parse.rs:47:16 [INFO] [stdout] | [INFO] [stdout] 47 | static ref RE_immune: Regex = Regex::new(r"immune to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 47 - static ref RE_immune: Regex = Regex::new(r"immune to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] 47 + static ref RE_IMMUNE: Regex = Regex::new(r"immune to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `at` after checking its variant with `is_some` [INFO] [stdout] --> src/day24/parse.rs:30:39 [INFO] [stdout] | [INFO] [stdout] 29 | if at.is_some() { [INFO] [stdout] | --------------- help: try: `if let Some() = at` [INFO] [stdout] 30 | attack_type.insert(parse_attack(at.unwrap().as_str())?); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_group` should have an upper case name [INFO] [stdout] --> src/day24/parse.rs:55:16 [INFO] [stdout] | [INFO] [stdout] 55 | static ref RE_group: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (\(.*\))? with an attack that does (\d+) (\w+) ... [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 55 - static ref RE_group: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (\(.*\))? with an attack that does (\d+) (\w+) damage at initiative (\d+)").unwrap(); [INFO] [stdout] 55 + static ref RE_GROUP: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (\(.*\))? with an attack that does (\d+) (\w+) damage at initiative (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_group_nospecial` should have an upper case name [INFO] [stdout] --> src/day24/parse.rs:56:16 [INFO] [stdout] | [INFO] [stdout] 56 | static ref RE_group_nospecial: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (with) an attack that does (\d+) (\w+... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 56 - static ref RE_group_nospecial: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (with) an attack that does (\d+) (\w+) damage at initiative (\d+)").unwrap(); [INFO] [stdout] 56 + static ref RE_GROUP_NOSPECIAL: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (with) an attack that does (\d+) (\w+) damage at initiative (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/day24/parse.rs:91:6 [INFO] [stdout] | [INFO] [stdout] 91 | .filter(|v| v.is_some()) [INFO] [stdout] | ______^ [INFO] [stdout] 92 | | .map(|v| v.unwrap()) [INFO] [stdout] | |________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessarily eager cloning of iterator items [INFO] [stdout] --> src/day24/parse.rs:86:16 [INFO] [stdout] | [INFO] [stdout] 86 | let groups = input.split("\n") [INFO] [stdout] | _________________^ [INFO] [stdout] 87 | | .map(|v| parse_group(v, affiliation.clone())) [INFO] [stdout] 88 | | .collect::>, ParseError>>()? [INFO] [stdout] 89 | | .iter() [INFO] [stdout] | | ____________- [INFO] [stdout] 90 | || .cloned() [INFO] [stdout] 91 | || .filter(|v| v.is_some()) [INFO] [stdout] | ||____________________________^ [INFO] [stdout] | |____________________________| [INFO] [stdout] | help: try: `.filter(|&v| v.is_some()).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_overeager_cloned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24/group.rs:49:39 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn select_target(&self, groups: &Vec, already_selected: &Vec) -> 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] 49 - pub fn select_target(&self, groups: &Vec, already_selected: &Vec) -> Option { [INFO] [stdout] 49 + pub fn select_target(&self, groups: &[Group], already_selected: &Vec) -> Option { [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/day24/group.rs:49:70 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn select_target(&self, groups: &Vec, already_selected: &Vec) -> 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] 49 - pub fn select_target(&self, groups: &Vec, already_selected: &Vec) -> Option { [INFO] [stdout] 49 + pub fn select_target(&self, groups: &Vec, already_selected: &[usize]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `available_enemies.get(0)` [INFO] [stdout] --> src/day24/group.rs:70:26 [INFO] [stdout] | [INFO] [stdout] 70 | if let Some(group) = available_enemies.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `available_enemies.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24/problems.rs:8:19 [INFO] [stdout] | [INFO] [stdout] 8 | fn _print(groups: &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] 8 - fn _print(groups: &Vec) { [INFO] [stdout] 8 + fn _print(groups: &[Group]) { [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/day24/problems.rs:20:35 [INFO] [stdout] | [INFO] [stdout] 20 | fn target_selection_order(groups: &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] 20 ~ fn target_selection_order(groups: &[Group]) -> Vec { [INFO] [stdout] 21 ~ let mut target_selection_groups = groups.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/day24/problems.rs:31:48 [INFO] [stdout] | [INFO] [stdout] 31 | let selection_order = target_selection_order(&groups); [INFO] [stdout] | ^^^^^^^ help: change this to: `groups` [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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/day24/problems.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | let group = groups.iter().filter(|v| v.id == id).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `groups.iter().find(|v| v.id == id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day24/problems.rs:36:47 [INFO] [stdout] | [INFO] [stdout] 36 | if let Some(target) = group.select_target(&groups, &already_selected) { [INFO] [stdout] | ^^^^^^^ help: change this to: `groups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24/problems.rs:45:35 [INFO] [stdout] | [INFO] [stdout] 45 | fn determine_attack_order(groups: &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] 45 ~ fn determine_attack_order(groups: &[Group]) -> Vec { [INFO] [stdout] 46 ~ let mut attack_order = groups.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/day24/problems.rs:56:17 [INFO] [stdout] | [INFO] [stdout] 56 | let group = groups.iter().filter(|v| v.id == id).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `groups.iter().find(|v| v.id == id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/day24/problems.rs:62:42 [INFO] [stdout] | [INFO] [stdout] 62 | let (target_index, target_group) = groups.iter().enumerate().filter(|(_, v)| v.id == *target).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `groups.iter().enumerate().find(|(_, v)| v.id == *target)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24/problems.rs:87:30 [INFO] [stdout] | [INFO] [stdout] 87 | fn battle_is_ongoing(groups: &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] 87 - fn battle_is_ongoing(groups: &Vec) -> bool { [INFO] [stdout] 87 + fn battle_is_ongoing(groups: &[Group]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day25/mod.rs:45:10 [INFO] [stdout] | [INFO] [stdout] 45 | .map(|v| Point::from_str(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Point::from_str` [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: comparison to empty slice [INFO] [stdout] --> src/day25/mod.rs:44:17 [INFO] [stdout] | [INFO] [stdout] 44 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/day25/mod.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | let last = points.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 73 ~ while let Some(last) = points.pop() { [INFO] [stdout] 74 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/utils/mod.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | .filter(|v| *v != "") [INFO] [stdout] | ^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!v.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:113:3 [INFO] [stdout] | [INFO] [stdout] 113 | / match run() { [INFO] [stdout] 114 | | Err(err) => println!("Error occurred: {}", err), [INFO] [stdout] 115 | | _ => {} [INFO] [stdout] 116 | | } [INFO] [stdout] | |___^ help: try: `if let Err(err) = run() { println!("Error occurred: {}", err) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `REFallsAsleep` should have an upper case name [INFO] [stdout] --> src/day4/mod.rs:34:18 [INFO] [stdout] | [INFO] [stdout] 34 | static ref REFallsAsleep: Regex = Regex::new(r"falls asleep").unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_upper_case_globals)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 34 - static ref REFallsAsleep: Regex = Regex::new(r"falls asleep").unwrap(); [INFO] [stdout] 34 + static ref REFALLS_ASLEEP: Regex = Regex::new(r"falls asleep").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `REWakesUp` should have an upper case name [INFO] [stdout] --> src/day4/mod.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 35 | static ref REWakesUp: Regex = Regex::new(r"wakes up").unwrap(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 35 - static ref REWakesUp: Regex = Regex::new(r"wakes up").unwrap(); [INFO] [stdout] 35 + static ref REWAKES_UP: Regex = Regex::new(r"wakes up").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `REStarts` should have an upper case name [INFO] [stdout] --> src/day4/mod.rs:36:18 [INFO] [stdout] | [INFO] [stdout] 36 | static ref REStarts: Regex = Regex::new(r"Guard \#(\d+) begins shift").unwrap(); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 36 - static ref REStarts: Regex = Regex::new(r"Guard \#(\d+) begins shift").unwrap(); [INFO] [stdout] 36 + static ref RESTARTS: Regex = Regex::new(r"Guard \#(\d+) begins shift").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `REEdge` should have an upper case name [INFO] [stdout] --> src/day7/common.rs:16:18 [INFO] [stdout] | [INFO] [stdout] 16 | static ref REEdge: Regex = Regex::new(r"Step (.) must be finished before step (.) can begin\.").unwrap(); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 16 - static ref REEdge: Regex = Regex::new(r"Step (.) must be finished before step (.) can begin\.").unwrap(); [INFO] [stdout] 16 + static ref REEDGE: Regex = Regex::new(r"Step (.) must be finished before step (.) can begin\.").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_state` should have an upper case name [INFO] [stdout] --> src/day16/problems.rs:26:16 [INFO] [stdout] | [INFO] [stdout] 26 | static ref RE_state: Regex = Regex::new(r"\[(\d+), (\d+), (\d+), (\d+)\]").unwrap(); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 26 - static ref RE_state: Regex = Regex::new(r"\[(\d+), (\d+), (\d+), (\d+)\]").unwrap(); [INFO] [stdout] 26 + static ref RE_STATE: Regex = Regex::new(r"\[(\d+), (\d+), (\d+), (\d+)\]").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_instruction` should have an upper case name [INFO] [stdout] --> src/day16/problems.rs:39:16 [INFO] [stdout] | [INFO] [stdout] 39 | static ref RE_instruction: Regex = Regex::new(r"(\d+) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 39 - static ref RE_instruction: Regex = Regex::new(r"(\d+) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] 39 + static ref RE_INSTRUCTION: Regex = Regex::new(r"(\d+) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_before` should have an upper case name [INFO] [stdout] --> src/day16/problems.rs:84:16 [INFO] [stdout] | [INFO] [stdout] 84 | static ref RE_before: Regex = Regex::new(r"Before:").unwrap(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 84 - static ref RE_before: Regex = Regex::new(r"Before:").unwrap(); [INFO] [stdout] 84 + static ref RE_BEFORE: Regex = Regex::new(r"Before:").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_x` should have an upper case name [INFO] [stdout] --> src/day17/mod.rs:64:16 [INFO] [stdout] | [INFO] [stdout] 64 | static ref RE_x: Regex = Regex::new(r"x=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case (notice the capitalization) [INFO] [stdout] | [INFO] [stdout] 64 - static ref RE_x: Regex = Regex::new(r"x=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] 64 + static ref RE_X: Regex = Regex::new(r"x=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_y` should have an upper case name [INFO] [stdout] --> src/day17/mod.rs:65:16 [INFO] [stdout] | [INFO] [stdout] 65 | static ref RE_y: Regex = Regex::new(r"y=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case (notice the capitalization) [INFO] [stdout] | [INFO] [stdout] 65 - static ref RE_y: Regex = Regex::new(r"y=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] 65 + static ref RE_Y: Regex = Regex::new(r"y=(\d+)(\.\.)?(\d+)?").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_ip` should have an upper case name [INFO] [stdout] --> src/day19/problems.rs:16:16 [INFO] [stdout] | [INFO] [stdout] 16 | static ref RE_ip: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 16 - static ref RE_ip: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] 16 + static ref RE_IP: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_instruction` should have an upper case name [INFO] [stdout] --> src/day19/problems.rs:29:16 [INFO] [stdout] | [INFO] [stdout] 29 | static ref RE_instruction: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 29 - static ref RE_instruction: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] 29 + static ref RE_INSTRUCTION: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_ip` should have an upper case name [INFO] [stdout] --> src/day21/problems.rs:17:16 [INFO] [stdout] | [INFO] [stdout] 17 | static ref RE_ip: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 17 - static ref RE_ip: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] 17 + static ref RE_IP: Regex = Regex::new(r"#ip (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_instruction` should have an upper case name [INFO] [stdout] --> src/day21/problems.rs:30:16 [INFO] [stdout] | [INFO] [stdout] 30 | static ref RE_instruction: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 30 - static ref RE_instruction: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] 30 + static ref RE_INSTRUCTION: Regex = Regex::new(r"([a-z]{4}) (\d+) (\d+) (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_bot` should have an upper case name [INFO] [stdout] --> src/day23/mod.rs:25:18 [INFO] [stdout] | [INFO] [stdout] 25 | static ref RE_bot: Regex = Regex::new(r"pos=<(-?\d+),(-?\d+),(-?\d+)>, r=(\d+)").unwrap(); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 25 - static ref RE_bot: Regex = Regex::new(r"pos=<(-?\d+),(-?\d+),(-?\d+)>, r=(\d+)").unwrap(); [INFO] [stdout] 25 + static ref RE_BOT: Regex = Regex::new(r"pos=<(-?\d+),(-?\d+),(-?\d+)>, r=(\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_weak` should have an upper case name [INFO] [stdout] --> src/day24/parse.rs:39:16 [INFO] [stdout] | [INFO] [stdout] 39 | static ref RE_weak: Regex = Regex::new(r"weak to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 39 - static ref RE_weak: Regex = Regex::new(r"weak to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] 39 + static ref RE_WEAK: Regex = Regex::new(r"weak to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.74s [INFO] [stdout] warning: static variable `RE_immune` should have an upper case name [INFO] [stdout] --> src/day24/parse.rs:47:16 [INFO] [stdout] | [INFO] [stdout] 47 | static ref RE_immune: Regex = Regex::new(r"immune to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 47 - static ref RE_immune: Regex = Regex::new(r"immune to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] 47 + static ref RE_IMMUNE: Regex = Regex::new(r"immune to (\w+),?\s?(\w+)?,?\s?(\w+)?,?\s?(\w+)?").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_group` should have an upper case name [INFO] [stdout] --> src/day24/parse.rs:55:16 [INFO] [stdout] | [INFO] [stdout] 55 | static ref RE_group: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (\(.*\))? with an attack that does (\d+) (\w+) ... [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 55 - static ref RE_group: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (\(.*\))? with an attack that does (\d+) (\w+) damage at initiative (\d+)").unwrap(); [INFO] [stdout] 55 + static ref RE_GROUP: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (\(.*\))? with an attack that does (\d+) (\w+) damage at initiative (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `RE_group_nospecial` should have an upper case name [INFO] [stdout] --> src/day24/parse.rs:56:16 [INFO] [stdout] | [INFO] [stdout] 56 | static ref RE_group_nospecial: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (with) an attack that does (\d+) (\w+... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 56 - static ref RE_group_nospecial: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (with) an attack that does (\d+) (\w+) damage at initiative (\d+)").unwrap(); [INFO] [stdout] 56 + static ref RE_GROUP_NOSPECIAL: Regex = Regex::new(r"(\d+) units each with (\d+) hit points (with) an attack that does (\d+) (\w+) damage at initiative (\d+)").unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] running `Command { std: "docker" "inspect" "d5ff9252b7892780d0c749ad94697cd7cd37b94d0a90cf47def4552ae9c1bcf5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d5ff9252b7892780d0c749ad94697cd7cd37b94d0a90cf47def4552ae9c1bcf5", kill_on_drop: false }` [INFO] [stdout] d5ff9252b7892780d0c749ad94697cd7cd37b94d0a90cf47def4552ae9c1bcf5