[INFO] cloning repository https://github.com/a-ungurianu/advent-of-code-2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/a-ungurianu/advent-of-code-2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fa-ungurianu%2Fadvent-of-code-2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fa-ungurianu%2Fadvent-of-code-2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 0c7fdb3b00f5bb41f39410109141ad26e05174c0 [INFO] linting a-ungurianu/advent-of-code-2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fa-ungurianu%2Fadvent-of-code-2024" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-2-tc1/source/.cargo/config.toml [INFO] started tweaking git repo https://github.com/a-ungurianu/advent-of-code-2024 [INFO] finished tweaking git repo https://github.com/a-ungurianu/advent-of-code-2024 [INFO] tweaked toml for git repo https://github.com/a-ungurianu/advent-of-code-2024 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/a-ungurianu/advent-of-code-2024 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/a-ungurianu/advent-of-code-2024 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded thousands v0.2.0 [INFO] [stderr] Downloaded pico-args v0.5.0 [INFO] [stderr] Downloaded tinyjson v2.5.1 [INFO] [stderr] Downloaded wasm-bindgen-macro v0.2.89 [INFO] [stderr] Downloaded wasm-bindgen-shared v0.2.89 [INFO] [stderr] Downloaded mintex v0.1.2 [INFO] [stderr] Downloaded sys-info v0.9.1 [INFO] [stderr] Downloaded dhat v0.3.3 [INFO] [stderr] Downloaded iana-time-zone v0.1.58 [INFO] [stderr] Downloaded serde_derive v1.0.193 [INFO] [stderr] Downloaded serde v1.0.193 [INFO] [stderr] Downloaded js-sys v0.3.66 [INFO] [stderr] Downloaded serde_json v1.0.108 [INFO] [stderr] Downloaded wasm-bindgen-backend v0.2.89 [INFO] [stderr] Downloaded wasm-bindgen-macro-support v0.2.89 [INFO] [stderr] Downloaded wasm-bindgen v0.2.89 [INFO] [stderr] Downloaded smallvec v1.11.2 [INFO] [stderr] Downloaded proc-macro2 v1.0.70 [INFO] [stderr] Downloaded syn v2.0.39 [INFO] [stderr] Downloaded libc v0.2.150 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] a6cde14417abde901e351457d16a090b2b070b067f77ee33f6c881587e79c14a [INFO] running `Command { std: "docker" "start" "-a" "a6cde14417abde901e351457d16a090b2b070b067f77ee33f6c881587e79c14a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "a6cde14417abde901e351457d16a090b2b070b067f77ee33f6c881587e79c14a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a6cde14417abde901e351457d16a090b2b070b067f77ee33f6c881587e79c14a", kill_on_drop: false }` [INFO] [stdout] a6cde14417abde901e351457d16a090b2b070b067f77ee33f6c881587e79c14a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 6eb34aa511db9113551c9dc179a848d281bef5e258e23ac362f9e702df69ffda [INFO] running `Command { std: "docker" "start" "-a" "6eb34aa511db9113551c9dc179a848d281bef5e258e23ac362f9e702df69ffda", kill_on_drop: false }` [INFO] [stderr] Checking memchr v2.6.4 [INFO] [stderr] Checking pico-args v0.5.0 [INFO] [stderr] Checking tinyjson v2.5.1 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking advent_of_code v0.11.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 - data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] 54 + data.sort_unstable_by_key(|a| a.day); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 - data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] 54 + data.sort_unstable_by_key(|a| a.day); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/bin/13.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn solve(self: &Self) -> u32 { [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] 28 - pub fn solve(self: &Self) -> u32 { [INFO] [stdout] 28 + pub fn solve(&self) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/bin/13.rs:36:18 [INFO] [stdout] | [INFO] [stdout] 36 | fn try_solve(self: &Self, a_count: i32) -> Option { [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] 36 - fn try_solve(self: &Self, a_count: i32) -> Option { [INFO] [stdout] 36 + fn try_solve(&self, a_count: i32) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/19.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/02.rs:25:48 [INFO] [stdout] | [INFO] [stdout] 25 | } else if order == Order::Ascending && !(prev < *current) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `(prev >= *current)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/02.rs:27:49 [INFO] [stdout] | [INFO] [stdout] 27 | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `(prev <= *current)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:10:27 [INFO] [stdout] | [INFO] [stdout] 10 | fn is_report_safe(report: &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] 10 - fn is_report_safe(report: &Vec) -> bool { [INFO] [stdout] 10 + fn is_report_safe(report: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/bin/02.rs:14:32 [INFO] [stdout] | [INFO] [stdout] 14 | for current in report[1..].into_iter() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/02.rs:23:34 [INFO] [stdout] | [INFO] [stdout] 23 | if order == Order::Equal { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 24 | | return false; [INFO] [stdout] 25 | | } else if order == Order::Ascending && !(prev < *current) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/02.rs:25:67 [INFO] [stdout] | [INFO] [stdout] 25 | } else if order == Order::Ascending && !(prev < *current) { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 26 | | return false; [INFO] [stdout] 27 | | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/02.rs:25:67 [INFO] [stdout] | [INFO] [stdout] 25 | } else if order == Order::Ascending && !(prev < *current) { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 26 | | return false; [INFO] [stdout] 27 | | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/02.rs:27:68 [INFO] [stdout] | [INFO] [stdout] 27 | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | ____________________________________________________________________^ [INFO] [stdout] 28 | | return false; [INFO] [stdout] 29 | | } else if prev.abs_diff(*current) > 3 { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/02.rs:27:68 [INFO] [stdout] | [INFO] [stdout] 27 | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | ____________________________________________________________________^ [INFO] [stdout] 28 | | return false; [INFO] [stdout] 29 | | } else if prev.abs_diff(*current) > 3 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/02.rs:29:47 [INFO] [stdout] | [INFO] [stdout] 29 | } else if prev.abs_diff(*current) > 3 { [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 30 | | return false; [INFO] [stdout] 31 | | } [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:37:38 [INFO] [stdout] | [INFO] [stdout] 37 | fn vec_copy_with_hole_at_idx(report: &Vec, index: usize) -> 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] 37 - fn vec_copy_with_hole_at_idx(report: &Vec, index: usize) -> Vec { [INFO] [stdout] 37 + fn vec_copy_with_hole_at_idx(report: &[i32], index: usize) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 57 - return false; [INFO] [stdout] 57 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/02.rs:46:23 [INFO] [stdout] | [INFO] [stdout] 46 | if is_report_safe(&report) { [INFO] [stdout] | ^^^^^^^ help: change this to: `report` [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/bin/02.rs:67:25 [INFO] [stdout] | [INFO] [stdout] 67 | Some(reports.filter(|i| is_report_safe(i)).count() as u32) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_report_safe` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/02.rs:77:25 [INFO] [stdout] | [INFO] [stdout] 77 | Some(reports.filter(|i| is_report_skip_safe(i)).count() as u32) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_report_skip_safe` [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: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/bin/13.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn solve(self: &Self) -> u32 { [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] 28 - pub fn solve(self: &Self) -> u32 { [INFO] [stdout] 28 + pub fn solve(&self) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/bin/13.rs:36:18 [INFO] [stdout] | [INFO] [stdout] 36 | fn try_solve(self: &Self, a_count: i32) -> Option { [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] 36 - fn try_solve(self: &Self, a_count: i32) -> Option { [INFO] [stdout] 36 + fn try_solve(&self, a_count: i32) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `fs::read` [INFO] [stdout] --> src/bin/17.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, fs::read}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/bin/17.rs:79:15 [INFO] [stdout] | [INFO] [stdout] 79 | fn get_op(self: &Self, op: &u64) -> u64 { [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] 79 - fn get_op(self: &Self, op: &u64) -> u64 { [INFO] [stdout] 79 + fn get_op(&self, op: &u64) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/13.rs:84:17 [INFO] [stdout] | [INFO] [stdout] 84 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/13.rs:84:17 [INFO] [stdout] | [INFO] [stdout] 84 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/10.rs:9:29 [INFO] [stdout] | [INFO] [stdout] 9 | fn count_reached_zeros(map: &Vec<&str>, start: &Point) -> u32 { [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] 9 - fn count_reached_zeros(map: &Vec<&str>, start: &Point) -> u32 { [INFO] [stdout] 9 + fn count_reached_zeros(map: &[&str], start: &Point) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/bin/13.rs:31:14 [INFO] [stdout] | [INFO] [stdout] 31 | .filter_map(identity) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/13.rs:39:13 [INFO] [stdout] | [INFO] [stdout] 39 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 39 - return None; [INFO] [stdout] 39 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/13.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | / match div_perfect(&remaining, &self.b_step) { [INFO] [stdout] 44 | | Some(b_count) => Some((a_count * 3 + b_count) as u32), [INFO] [stdout] 45 | | None => None, [INFO] [stdout] 46 | | } [INFO] [stdout] | |_____________^ help: try: `div_perfect(&remaining, &self.b_step).map(|b_count| (a_count * 3 + b_count) as u32)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/bin/10.rs:55:25 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|row| vec![0 as u32; row.as_bytes().len()]) [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/13.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / point_finder.captures(line).and_then(|c| { [INFO] [stdout] 55 | | let (_, [x, y]) = c.extract(); [INFO] [stdout] 56 | | Some(Point(x.parse().unwrap(), y.parse().unwrap())) [INFO] [stdout] 57 | | }) [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 54 ~ point_finder.captures(line).map(|c| { [INFO] [stdout] 55 | let (_, [x, y]) = c.extract(); [INFO] [stdout] 56 ~ Point(x.parse().unwrap(), y.parse().unwrap()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/bin/01.rs:26:18 [INFO] [stdout] | [INFO] [stdout] 26 | .zip(right_list.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 26 - .zip(right_list.into_iter()) [INFO] [stdout] 26 + .zip(right_list) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to u32 [INFO] [stdout] --> src/bin/01.rs:29:17 [INFO] [stdout] | [INFO] [stdout] 29 | s.abs() as u32 [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace with: `s.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `advent_of_code::template::aoc_cli::check` [INFO] [stdout] --> src/bin/09.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use advent_of_code::template::aoc_cli::check; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/02.rs:25:48 [INFO] [stdout] | [INFO] [stdout] 25 | } else if order == Order::Ascending && !(prev < *current) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `(prev >= *current)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/02.rs:27:49 [INFO] [stdout] | [INFO] [stdout] 27 | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `(prev <= *current)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:10:27 [INFO] [stdout] | [INFO] [stdout] 10 | fn is_report_safe(report: &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] 10 - fn is_report_safe(report: &Vec) -> bool { [INFO] [stdout] 10 + fn is_report_safe(report: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/bin/02.rs:14:32 [INFO] [stdout] | [INFO] [stdout] 14 | for current in report[1..].into_iter() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/02.rs:23:34 [INFO] [stdout] | [INFO] [stdout] 23 | if order == Order::Equal { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 24 | | return false; [INFO] [stdout] 25 | | } else if order == Order::Ascending && !(prev < *current) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/02.rs:25:67 [INFO] [stdout] | [INFO] [stdout] 25 | } else if order == Order::Ascending && !(prev < *current) { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 26 | | return false; [INFO] [stdout] 27 | | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/bin/11.rs:17:32 [INFO] [stdout] | [INFO] [stdout] 17 | let split_10 = (10 as u64).pow((stone.ilog10() + 1) / 2); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `10_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/02.rs:25:67 [INFO] [stdout] | [INFO] [stdout] 25 | } else if order == Order::Ascending && !(prev < *current) { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 26 | | return false; [INFO] [stdout] 27 | | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/02.rs:27:68 [INFO] [stdout] | [INFO] [stdout] 27 | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | ____________________________________________________________________^ [INFO] [stdout] 28 | | return false; [INFO] [stdout] 29 | | } else if prev.abs_diff(*current) > 3 { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/02.rs:27:68 [INFO] [stdout] | [INFO] [stdout] 27 | } else if order == Order::Descending && !(prev > *current) { [INFO] [stdout] | ____________________________________________________________________^ [INFO] [stdout] 28 | | return false; [INFO] [stdout] 29 | | } else if prev.abs_diff(*current) > 3 { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/02.rs:29:47 [INFO] [stdout] | [INFO] [stdout] 29 | } else if prev.abs_diff(*current) > 3 { [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 30 | | return false; [INFO] [stdout] 31 | | } [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:37:38 [INFO] [stdout] | [INFO] [stdout] 37 | fn vec_copy_with_hole_at_idx(report: &Vec, index: usize) -> 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] 37 - fn vec_copy_with_hole_at_idx(report: &Vec, index: usize) -> Vec { [INFO] [stdout] 37 + fn vec_copy_with_hole_at_idx(report: &[i32], index: usize) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 57 - return false; [INFO] [stdout] 57 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/bin/11.rs:17:48 [INFO] [stdout] | [INFO] [stdout] 17 | let split_10 = (10 as u64).pow((stone.ilog10() + 1) / 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `stone.ilog10().div_ceil(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/02.rs:46:23 [INFO] [stdout] | [INFO] [stdout] 46 | if is_report_safe(&report) { [INFO] [stdout] | ^^^^^^^ help: change this to: `report` [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/bin/02.rs:67:25 [INFO] [stdout] | [INFO] [stdout] 67 | Some(reports.filter(|i| is_report_safe(i)).count() as u32) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_report_safe` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/02.rs:77:25 [INFO] [stdout] | [INFO] [stdout] 77 | Some(reports.filter(|i| is_report_skip_safe(i)).count() as u32) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `is_report_skip_safe` [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: needless call to `as_bytes` [INFO] [stdout] --> src/bin/10.rs:55:35 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|row| vec![0 as u32; row.as_bytes().len()]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `row.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes [INFO] [stdout] = note: `#[warn(clippy::needless_as_bytes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/bin/13.rs:31:14 [INFO] [stdout] | [INFO] [stdout] 31 | .filter_map(identity) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/13.rs:39:13 [INFO] [stdout] | [INFO] [stdout] 39 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 39 - return None; [INFO] [stdout] 39 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/13.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | / match div_perfect(&remaining, &self.b_step) { [INFO] [stdout] 44 | | Some(b_count) => Some((a_count * 3 + b_count) as u32), [INFO] [stdout] 45 | | None => None, [INFO] [stdout] 46 | | } [INFO] [stdout] | |_____________^ help: try: `div_perfect(&remaining, &self.b_step).map(|b_count| (a_count * 3 + b_count) as u32)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/13.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / point_finder.captures(line).and_then(|c| { [INFO] [stdout] 55 | | let (_, [x, y]) = c.extract(); [INFO] [stdout] 56 | | Some(Point(x.parse().unwrap(), y.parse().unwrap())) [INFO] [stdout] 57 | | }) [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 54 ~ point_finder.captures(line).map(|c| { [INFO] [stdout] 55 | let (_, [x, y]) = c.extract(); [INFO] [stdout] 56 ~ Point(x.parse().unwrap(), y.parse().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/bin/09.rs:65:29 [INFO] [stdout] | [INFO] [stdout] 65 | let candidate = partitions [INFO] [stdout] | _____________________________^ [INFO] [stdout] 66 | | .iter() [INFO] [stdout] 67 | | .enumerate() [INFO] [stdout] 68 | | .rev() [INFO] [stdout] 69 | | .filter(|(_, partition)| partition.2 && (partition.0 <= len)) [INFO] [stdout] 70 | | .next(); [INFO] [stdout] | |_______________________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 65 ~ let candidate = partitions [INFO] [stdout] 66 + .iter() [INFO] [stdout] 67 + .enumerate() [INFO] [stdout] 68 ~ .rev().find(|(_, partition)| partition.2 && (partition.0 <= len)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `reg_a` [INFO] [stdout] --> src/bin/17.rs:207:9 [INFO] [stdout] | [INFO] [stdout] 207 | let reg_a = lines.next().map(read_reg).unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_reg_a` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `op_s` is never used [INFO] [stdout] --> src/bin/17.rs:13:4 [INFO] [stdout] | [INFO] [stdout] 13 | fn op_s(o: &u64) -> &'static str { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `print_program` is never used [INFO] [stdout] --> src/bin/17.rs:26:4 [INFO] [stdout] | [INFO] [stdout] 26 | fn print_program(program: &Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/17.rs:26:27 [INFO] [stdout] | [INFO] [stdout] 26 | fn print_program(program: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 26 - fn print_program(program: &Vec) { [INFO] [stdout] 26 + fn print_program(program: &[u64]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/10.rs:9:29 [INFO] [stdout] | [INFO] [stdout] 9 | fn count_reached_zeros(map: &Vec<&str>, start: &Point) -> u32 { [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] 9 - fn count_reached_zeros(map: &Vec<&str>, start: &Point) -> u32 { [INFO] [stdout] 9 + fn count_reached_zeros(map: &[&str], start: &Point) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/17.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | return (state, output); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 163 - return (state, output); [INFO] [stdout] 163 + (state, output) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/17.rs:94:14 [INFO] [stdout] | [INFO] [stdout] 94 | program: &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] 94 - program: &Vec, [INFO] [stdout] 94 + program: &[u64], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:119:17 [INFO] [stdout] | [INFO] [stdout] 119 | state.a = state.a >> state.get_op(op); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `state.a >>= state.get_op(op)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:123:17 [INFO] [stdout] | [INFO] [stdout] 123 | state.b = state.b ^ op; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `state.b ^= op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 138 | state.b = state.b ^ state.c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `state.b ^= state.c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/bin/10.rs:55:25 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|row| vec![0 as u32; row.as_bytes().len()]) [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [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: needless call to `as_bytes` [INFO] [stdout] --> src/bin/10.rs:55:35 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|row| vec![0 as u32; row.as_bytes().len()]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `row.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes [INFO] [stdout] = note: `#[warn(clippy::needless_as_bytes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:199:9 [INFO] [stdout] | [INFO] [stdout] 199 | num = num >> 3; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `num >>= 3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/17.rs:247:5 [INFO] [stdout] | [INFO] [stdout] 247 | return Some("NOT_FOUND".to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 247 - return Some("NOT_FOUND".to_string()); [INFO] [stdout] 247 + Some("NOT_FOUND".to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/bin/11.rs:17:32 [INFO] [stdout] | [INFO] [stdout] 17 | let split_10 = (10 as u64).pow((stone.ilog10() + 1) / 2); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `10_u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/bin/11.rs:17:48 [INFO] [stdout] | [INFO] [stdout] 17 | let split_10 = (10 as u64).pow((stone.ilog10() + 1) / 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `stone.ilog10().div_ceil(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::default` [INFO] [stdout] --> src/bin/07.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::default; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `default` [INFO] [stdout] --> src/bin/06.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, default}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `match` scrutinee expression [INFO] [stdout] --> src/bin/06.rs:72:11 [INFO] [stdout] | [INFO] [stdout] 72 | match (get(obstacles, next)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 72 - match (get(obstacles, next)) { [INFO] [stdout] 72 + match get(obstacles, next) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/14.rs:25:20 [INFO] [stdout] | [INFO] [stdout] 25 | *map.entry(&point).or_default() += 1; [INFO] [stdout] | ^^^^^^ help: change this to: `point` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/14.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | robots: &Vec, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 60 - robots: &Vec, [INFO] [stdout] 60 + robots: &[Robot], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/14.rs:67:37 [INFO] [stdout] | [INFO] [stdout] 67 | .map(|robot| simulate_robot(&robot, steps, grid_width, grid_height)) [INFO] [stdout] | ^^^^^^ help: change this to: `robot` [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: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/bin/14.rs:89:22 [INFO] [stdout] | [INFO] [stdout] 89 | (acc.0 + 1 as u32, acc.1, acc.2, acc.3) [INFO] [stdout] | ^^^^^^^^ help: try: `1_u32` [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: unused import: `default` [INFO] [stdout] --> src/bin/06.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, default}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `advent_of_code::template::aoc_cli::check` [INFO] [stdout] --> src/bin/09.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use advent_of_code::template::aoc_cli::check; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `match` scrutinee expression [INFO] [stdout] --> src/bin/06.rs:72:11 [INFO] [stdout] | [INFO] [stdout] 72 | match (get(obstacles, next)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 72 - match (get(obstacles, next)) { [INFO] [stdout] 72 + match get(obstacles, next) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/05.rs:11:56 [INFO] [stdout] | [INFO] [stdout] 11 | let rules_s = line_iter.by_ref().take_while(|line| line.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:29:42 [INFO] [stdout] | [INFO] [stdout] 29 | fn matches_rules(report: &Report, rules: &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] 29 - fn matches_rules(report: &Report, rules: &Vec) -> bool { [INFO] [stdout] 29 + fn matches_rules(report: &Report, rules: &[Rule]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/05.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | return swapped; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 92 - return swapped; [INFO] [stdout] 92 + swapped [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/05.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 82 | / if left_idx > right_idx { [INFO] [stdout] 83 | | report.swap(left_idx, right_idx); [INFO] [stdout] 84 | | index_map.insert(report[left_idx], left_idx); [INFO] [stdout] 85 | | index_map.insert(report[right_idx], right_idx); [INFO] [stdout] 86 | | swapped = true; [INFO] [stdout] 87 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 81 ~ (Some(&left_idx), Some(&right_idx)) [INFO] [stdout] 82 ~ if left_idx > right_idx => { [INFO] [stdout] 83 | report.swap(left_idx, right_idx); [INFO] [stdout] ... [INFO] [stdout] 86 | swapped = true; [INFO] [stdout] 87 ~ } [INFO] [stdout] | [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/bin/05.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | / match (index_map.get(left), index_map.get(right)) { [INFO] [stdout] 81 | | (Some(&left_idx), Some(&right_idx)) => { [INFO] [stdout] 82 | | if left_idx > right_idx { [INFO] [stdout] 83 | | report.swap(left_idx, right_idx); [INFO] [stdout] ... | [INFO] [stdout] 89 | | _ => (), [INFO] [stdout] 90 | | } [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] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 80 ~ if let (Some(&left_idx), Some(&right_idx)) = (index_map.get(left), index_map.get(right)) { [INFO] [stdout] 81 + if left_idx > right_idx { [INFO] [stdout] 82 + report.swap(left_idx, right_idx); [INFO] [stdout] 83 + index_map.insert(report[left_idx], left_idx); [INFO] [stdout] 84 + index_map.insert(report[right_idx], right_idx); [INFO] [stdout] 85 + swapped = true; [INFO] [stdout] 86 + } [INFO] [stdout] 87 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/14.rs:25:20 [INFO] [stdout] | [INFO] [stdout] 25 | *map.entry(&point).or_default() += 1; [INFO] [stdout] | ^^^^^^ help: change this to: `point` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/14.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | robots: &Vec, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 60 - robots: &Vec, [INFO] [stdout] 60 + robots: &[Robot], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/06.rs:118:17 [INFO] [stdout] | [INFO] [stdout] 118 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/14.rs:67:37 [INFO] [stdout] | [INFO] [stdout] 67 | .map(|robot| simulate_robot(&robot, steps, grid_width, grid_height)) [INFO] [stdout] | ^^^^^^ help: change this to: `robot` [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: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/bin/14.rs:89:22 [INFO] [stdout] | [INFO] [stdout] 89 | (acc.0 + 1 as u32, acc.1, acc.2, acc.3) [INFO] [stdout] | ^^^^^^^^ help: try: `1_u32` [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: unused import: `std::default` [INFO] [stdout] --> src/bin/07.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::default; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/bin/06.rs:101:13 [INFO] [stdout] | [INFO] [stdout] 101 | / match c { [INFO] [stdout] 102 | | b'^' => { [INFO] [stdout] 103 | | guard = Some(Point(row_idx as i32, col_idx as i32)); [INFO] [stdout] 104 | | break; [INFO] [stdout] 105 | | } [INFO] [stdout] 106 | | _ => {} [INFO] [stdout] 107 | | } [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] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 101 ~ if c == &b'^' { [INFO] [stdout] 102 + guard = Some(Point(row_idx as i32, col_idx as i32)); [INFO] [stdout] 103 + break; [INFO] [stdout] 104 + } [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/bin/09.rs:65:29 [INFO] [stdout] | [INFO] [stdout] 65 | let candidate = partitions [INFO] [stdout] | _____________________________^ [INFO] [stdout] 66 | | .iter() [INFO] [stdout] 67 | | .enumerate() [INFO] [stdout] 68 | | .rev() [INFO] [stdout] 69 | | .filter(|(_, partition)| partition.2 && (partition.0 <= len)) [INFO] [stdout] 70 | | .next(); [INFO] [stdout] | |_______________________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 65 ~ let candidate = partitions [INFO] [stdout] 66 + .iter() [INFO] [stdout] 67 + .enumerate() [INFO] [stdout] 68 ~ .rev().find(|(_, partition)| partition.2 && (partition.0 <= len)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/07.rs:22:19 [INFO] [stdout] | [INFO] [stdout] 22 | [rest] => return *rest == target, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - [rest] => return *rest == target, [INFO] [stdout] 22 + [rest] => *rest == target, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/07.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / if target % last == 0 { [INFO] [stdout] 28 | | if is_doable(target / last, rest) { [INFO] [stdout] 29 | | return true [INFO] [stdout] 30 | | } [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if target % last == 0 [INFO] [stdout] 28 ~ && is_doable(target / last, rest) { [INFO] [stdout] 29 | return true [INFO] [stdout] 30 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/06.rs:118:17 [INFO] [stdout] | [INFO] [stdout] 118 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/07.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | if target % last == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `target.is_multiple_of(*last)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/07.rs:40:19 [INFO] [stdout] | [INFO] [stdout] 40 | [rest] => return *rest == target, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 40 - [rest] => return *rest == target, [INFO] [stdout] 40 + [rest] => *rest == target, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/07.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | / if target % last == 0 { [INFO] [stdout] 46 | | if is_doable_two(target / last, rest) { [INFO] [stdout] 47 | | return true [INFO] [stdout] 48 | | } [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 45 ~ if target % last == 0 [INFO] [stdout] 46 ~ && is_doable_two(target / last, rest) { [INFO] [stdout] 47 | return true [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/bin/06.rs:101:13 [INFO] [stdout] | [INFO] [stdout] 101 | / match c { [INFO] [stdout] 102 | | b'^' => { [INFO] [stdout] 103 | | guard = Some(Point(row_idx as i32, col_idx as i32)); [INFO] [stdout] 104 | | break; [INFO] [stdout] 105 | | } [INFO] [stdout] 106 | | _ => {} [INFO] [stdout] 107 | | } [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] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 101 ~ if c == &b'^' { [INFO] [stdout] 102 + guard = Some(Point(row_idx as i32, col_idx as i32)); [INFO] [stdout] 103 + break; [INFO] [stdout] 104 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/07.rs:45:16 [INFO] [stdout] | [INFO] [stdout] 45 | if target % last == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `target.is_multiple_of(*last)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/07.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | / if target.to_string().ends_with(&last.to_string()) { [INFO] [stdout] 52 | | if is_doable_two(target / (10_u64.pow(last.ilog10() + 1)), rest) { [INFO] [stdout] 53 | | return true [INFO] [stdout] 54 | | } [INFO] [stdout] 55 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 51 ~ if target.to_string().ends_with(&last.to_string()) [INFO] [stdout] 52 ~ && is_doable_two(target / (10_u64.pow(last.ilog10() + 1)), rest) { [INFO] [stdout] 53 | return true [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/05.rs:11:56 [INFO] [stdout] | [INFO] [stdout] 11 | let rules_s = line_iter.by_ref().take_while(|line| line.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:29:42 [INFO] [stdout] | [INFO] [stdout] 29 | fn matches_rules(report: &Report, rules: &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] 29 - fn matches_rules(report: &Report, rules: &Vec) -> bool { [INFO] [stdout] 29 + fn matches_rules(report: &Report, rules: &[Rule]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/bin/01.rs:26:18 [INFO] [stdout] | [INFO] [stdout] 26 | .zip(right_list.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 26 - .zip(right_list.into_iter()) [INFO] [stdout] 26 + .zip(right_list) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to u32 [INFO] [stdout] --> src/bin/01.rs:29:17 [INFO] [stdout] | [INFO] [stdout] 29 | s.abs() as u32 [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace with: `s.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/05.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | return swapped; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 92 - return swapped; [INFO] [stdout] 92 + swapped [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/19.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/08.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | let width = input [INFO] [stdout] | _________________^ [INFO] [stdout] 15 | | .lines() [INFO] [stdout] 16 | | .next() [INFO] [stdout] 17 | | .and_then(|line| Some(line.bytes().count())) [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 14 ~ let width = input [INFO] [stdout] 15 + .lines() [INFO] [stdout] 16 + .next().map(|line| line.bytes().count()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using long and hard to read `.bytes().count()` [INFO] [stdout] --> src/bin/08.rs:17:31 [INFO] [stdout] | [INFO] [stdout] 17 | .and_then(|line| Some(line.bytes().count())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len()` instead: `line.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bytes_count_to_len [INFO] [stdout] = note: `#[warn(clippy::bytes_count_to_len)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/bin/08.rs:37:56 [INFO] [stdout] | [INFO] [stdout] 37 | for (_, antenna_group) in grouped_antennas.values().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 37 - for (_, antenna_group) in grouped_antennas.values().enumerate() { [INFO] [stdout] 37 + for antenna_group in grouped_antennas.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/08.rs:58:17 [INFO] [stdout] | [INFO] [stdout] 58 | let width = input [INFO] [stdout] | _________________^ [INFO] [stdout] 59 | | .lines() [INFO] [stdout] 60 | | .next() [INFO] [stdout] 61 | | .and_then(|line| Some(line.bytes().count())) [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 58 ~ let width = input [INFO] [stdout] 59 + .lines() [INFO] [stdout] 60 + .next().map(|line| line.bytes().count()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using long and hard to read `.bytes().count()` [INFO] [stdout] --> src/bin/08.rs:61:31 [INFO] [stdout] | [INFO] [stdout] 61 | .and_then(|line| Some(line.bytes().count())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len()` instead: `line.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bytes_count_to_len [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/bin/08.rs:81:56 [INFO] [stdout] | [INFO] [stdout] 81 | for (_, antenna_group) in grouped_antennas.values().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 81 - for (_, antenna_group) in grouped_antennas.values().enumerate() { [INFO] [stdout] 81 + for antenna_group in grouped_antennas.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/07.rs:22:19 [INFO] [stdout] | [INFO] [stdout] 22 | [rest] => return *rest == target, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - [rest] => return *rest == target, [INFO] [stdout] 22 + [rest] => *rest == target, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/07.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / if target % last == 0 { [INFO] [stdout] 28 | | if is_doable(target / last, rest) { [INFO] [stdout] 29 | | return true [INFO] [stdout] 30 | | } [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 27 ~ if target % last == 0 [INFO] [stdout] 28 ~ && is_doable(target / last, rest) { [INFO] [stdout] 29 | return true [INFO] [stdout] 30 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/07.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | if target % last == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `target.is_multiple_of(*last)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/07.rs:40:19 [INFO] [stdout] | [INFO] [stdout] 40 | [rest] => return *rest == target, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 40 - [rest] => return *rest == target, [INFO] [stdout] 40 + [rest] => *rest == target, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/07.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | / if target % last == 0 { [INFO] [stdout] 46 | | if is_doable_two(target / last, rest) { [INFO] [stdout] 47 | | return true [INFO] [stdout] 48 | | } [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 45 ~ if target % last == 0 [INFO] [stdout] 46 ~ && is_doable_two(target / last, rest) { [INFO] [stdout] 47 | return true [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/07.rs:45:16 [INFO] [stdout] | [INFO] [stdout] 45 | if target % last == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `target.is_multiple_of(*last)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/07.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | / if target.to_string().ends_with(&last.to_string()) { [INFO] [stdout] 52 | | if is_doable_two(target / (10_u64.pow(last.ilog10() + 1)), rest) { [INFO] [stdout] 53 | | return true [INFO] [stdout] 54 | | } [INFO] [stdout] 55 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 51 ~ if target.to_string().ends_with(&last.to_string()) [INFO] [stdout] 52 ~ && is_doable_two(target / (10_u64.pow(last.ilog10() + 1)), rest) { [INFO] [stdout] 53 | return true [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/bin/08.rs:85:38 [INFO] [stdout] | [INFO] [stdout] 85 | let mut antinode_a = antenna_a.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*antenna_a` [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 `Point` which implements the `Copy` trait [INFO] [stdout] --> src/bin/08.rs:93:38 [INFO] [stdout] | [INFO] [stdout] 93 | let mut antinode_b = antenna_b.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*antenna_b` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/08.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | let width = input [INFO] [stdout] | _________________^ [INFO] [stdout] 15 | | .lines() [INFO] [stdout] 16 | | .next() [INFO] [stdout] 17 | | .and_then(|line| Some(line.bytes().count())) [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 14 ~ let width = input [INFO] [stdout] 15 + .lines() [INFO] [stdout] 16 + .next().map(|line| line.bytes().count()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using long and hard to read `.bytes().count()` [INFO] [stdout] --> src/bin/08.rs:17:31 [INFO] [stdout] | [INFO] [stdout] 17 | .and_then(|line| Some(line.bytes().count())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len()` instead: `line.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bytes_count_to_len [INFO] [stdout] = note: `#[warn(clippy::bytes_count_to_len)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/bin/08.rs:37:56 [INFO] [stdout] | [INFO] [stdout] 37 | for (_, antenna_group) in grouped_antennas.values().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 37 - for (_, antenna_group) in grouped_antennas.values().enumerate() { [INFO] [stdout] 37 + for antenna_group in grouped_antennas.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `HashSet` and `hash::Hash` [INFO] [stdout] --> src/bin/18.rs:2:28 [INFO] [stdout] | [INFO] [stdout] 2 | collections::{HashMap, HashSet, VecDeque}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 3 | hash::Hash, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/04.rs:114:5 [INFO] [stdout] | [INFO] [stdout] 114 | / return count_vertical(&grid, needle) [INFO] [stdout] 115 | | + count_diagonal(&grid, needle) [INFO] [stdout] 116 | | + count_other_diagonal(&grid, needle) [INFO] [stdout] 117 | | + count_horizontal(&grid, needle); [INFO] [stdout] | |_________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 114 ~ count_vertical(&grid, needle) [INFO] [stdout] 115 + + count_diagonal(&grid, needle) [INFO] [stdout] 116 + + count_other_diagonal(&grid, needle) [INFO] [stdout] 117 ~ + count_horizontal(&grid, needle) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/04.rs:133:13 [INFO] [stdout] | [INFO] [stdout] 133 | / if grid[&here] == b'A' { [INFO] [stdout] 134 | | if (grid[&(&here + (-1, -1))] == b'M' && grid[&(&here + (1, 1))] == b'S') [INFO] [stdout] 135 | | || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M') [INFO] [stdout] ... | [INFO] [stdout] 143 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 133 ~ if grid[&here] == b'A' [INFO] [stdout] 134 ~ && ((grid[&(&here + (-1, -1))] == b'M' && grid[&(&here + (1, 1))] == b'S') [INFO] [stdout] 135 ~ || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M')) [INFO] [stdout] 136 | { [INFO] [stdout] ... [INFO] [stdout] 141 | } [INFO] [stdout] 142 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/04.rs:134:17 [INFO] [stdout] | [INFO] [stdout] 134 | / if (grid[&(&here + (-1, -1))] == b'M' && grid[&(&here + (1, 1))] == b'S') [INFO] [stdout] 135 | | || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M') [INFO] [stdout] 136 | | { [INFO] [stdout] 137 | | if (grid[&(&here + (-1, 1))] == b'M' && grid[&(&here + (1, -1))] == b'S') [INFO] [stdout] ... | [INFO] [stdout] 142 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 134 ~ if ((grid[&(&here + (-1, -1))] == b'M' && grid[&(&here + (1, 1))] == b'S') [INFO] [stdout] 135 ~ || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M') [INFO] [stdout] 136 ~ || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M')) [INFO] [stdout] 137 | { [INFO] [stdout] 138 ~ && ((grid[&(&here + (-1, 1))] == b'M' && grid[&(&here + (1, -1))] == b'S') [INFO] [stdout] 139 ~ || (grid[&(&here + (-1, 1))] == b'S' && grid[&(&here + (1, -1))] == b'M')) [INFO] [stdout] 140 | { [INFO] [stdout] 141 | count += 1; [INFO] [stdout] 142 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/05.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 82 | / if left_idx > right_idx { [INFO] [stdout] 83 | | report.swap(left_idx, right_idx); [INFO] [stdout] 84 | | index_map.insert(report[left_idx], left_idx); [INFO] [stdout] 85 | | index_map.insert(report[right_idx], right_idx); [INFO] [stdout] 86 | | swapped = true; [INFO] [stdout] 87 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 81 ~ (Some(&left_idx), Some(&right_idx)) [INFO] [stdout] 82 ~ if left_idx > right_idx => { [INFO] [stdout] 83 | report.swap(left_idx, right_idx); [INFO] [stdout] ... [INFO] [stdout] 86 | swapped = true; [INFO] [stdout] 87 ~ } [INFO] [stdout] | [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/bin/05.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | / match (index_map.get(left), index_map.get(right)) { [INFO] [stdout] 81 | | (Some(&left_idx), Some(&right_idx)) => { [INFO] [stdout] 82 | | if left_idx > right_idx { [INFO] [stdout] 83 | | report.swap(left_idx, right_idx); [INFO] [stdout] ... | [INFO] [stdout] 89 | | _ => (), [INFO] [stdout] 90 | | } [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] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 80 ~ if let (Some(&left_idx), Some(&right_idx)) = (index_map.get(left), index_map.get(right)) { [INFO] [stdout] 81 + if left_idx > right_idx { [INFO] [stdout] 82 + report.swap(left_idx, right_idx); [INFO] [stdout] 83 + index_map.insert(report[left_idx], left_idx); [INFO] [stdout] 84 + index_map.insert(report[right_idx], right_idx); [INFO] [stdout] 85 + swapped = true; [INFO] [stdout] 86 + } [INFO] [stdout] 87 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/08.rs:58:17 [INFO] [stdout] | [INFO] [stdout] 58 | let width = input [INFO] [stdout] | _________________^ [INFO] [stdout] 59 | | .lines() [INFO] [stdout] 60 | | .next() [INFO] [stdout] 61 | | .and_then(|line| Some(line.bytes().count())) [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 58 ~ let width = input [INFO] [stdout] 59 + .lines() [INFO] [stdout] 60 + .next().map(|line| line.bytes().count()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using long and hard to read `.bytes().count()` [INFO] [stdout] --> src/bin/08.rs:61:31 [INFO] [stdout] | [INFO] [stdout] 61 | .and_then(|line| Some(line.bytes().count())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider calling `.len()` instead: `line.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bytes_count_to_len [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/bin/08.rs:81:56 [INFO] [stdout] | [INFO] [stdout] 81 | for (_, antenna_group) in grouped_antennas.values().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 81 - for (_, antenna_group) in grouped_antennas.values().enumerate() { [INFO] [stdout] 81 + for antenna_group in grouped_antennas.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/bin/08.rs:85:38 [INFO] [stdout] | [INFO] [stdout] 85 | let mut antinode_a = antenna_a.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*antenna_a` [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 `Point` which implements the `Copy` trait [INFO] [stdout] --> src/bin/08.rs:93:38 [INFO] [stdout] | [INFO] [stdout] 93 | let mut antinode_b = antenna_b.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*antenna_b` [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: unused import: `fs::read` [INFO] [stdout] --> src/bin/17.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, fs::read}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/bin/17.rs:79:15 [INFO] [stdout] | [INFO] [stdout] 79 | fn get_op(self: &Self, op: &u64) -> u64 { [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] 79 - fn get_op(self: &Self, op: &u64) -> u64 { [INFO] [stdout] 79 + fn get_op(&self, op: &u64) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ops::RangeBounds` [INFO] [stdout] --> src/bin/18.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | ops::RangeBounds, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `HashSet` and `hash::Hash` [INFO] [stdout] --> src/bin/18.rs:2:28 [INFO] [stdout] | [INFO] [stdout] 2 | collections::{HashMap, HashSet, VecDeque}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 3 | hash::Hash, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/18.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | return 0 <= point.0 && point.0 < n as i32 && 0 <= point.1 && point.1 < n as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 12 - return 0 <= point.0 && point.0 < n as i32 && 0 <= point.1 && point.1 < n as i32; [INFO] [stdout] 12 + 0 <= point.0 && point.0 < n as i32 && 0 <= point.1 && point.1 < n as i32 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/18.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | / if in_bounds(&p, n) { [INFO] [stdout] 31 | | if !points_hm.contains_key(&p) { [INFO] [stdout] 32 | | let res = points_hm.get(&c).unwrap() + 1; [INFO] [stdout] 33 | | points_hm.insert(p, res); [INFO] [stdout] ... | [INFO] [stdout] 36 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 30 ~ if in_bounds(&p, n) [INFO] [stdout] 31 ~ && !points_hm.contains_key(&p) { [INFO] [stdout] 32 | let res = points_hm.get(&c).unwrap() + 1; [INFO] [stdout] 33 | points_hm.insert(p, res); [INFO] [stdout] 34 | queue.push_back(p); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/18.rs:80:5 [INFO] [stdout] | [INFO] [stdout] 80 | points.get(r - 1).map(|p| *p) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `points.get(r - 1).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ops::RangeBounds` [INFO] [stdout] --> src/bin/18.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | ops::RangeBounds, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `reg_a` [INFO] [stdout] --> src/bin/17.rs:207:9 [INFO] [stdout] | [INFO] [stdout] 207 | let reg_a = lines.next().map(read_reg).unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_reg_a` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/04.rs:114:5 [INFO] [stdout] | [INFO] [stdout] 114 | / return count_vertical(&grid, needle) [INFO] [stdout] 115 | | + count_diagonal(&grid, needle) [INFO] [stdout] 116 | | + count_other_diagonal(&grid, needle) [INFO] [stdout] 117 | | + count_horizontal(&grid, needle); [INFO] [stdout] | |_________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 114 ~ count_vertical(&grid, needle) [INFO] [stdout] 115 + + count_diagonal(&grid, needle) [INFO] [stdout] 116 + + count_other_diagonal(&grid, needle) [INFO] [stdout] 117 ~ + count_horizontal(&grid, needle) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/18.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | return 0 <= point.0 && point.0 < n as i32 && 0 <= point.1 && point.1 < n as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 12 - return 0 <= point.0 && point.0 < n as i32 && 0 <= point.1 && point.1 < n as i32; [INFO] [stdout] 12 + 0 <= point.0 && point.0 < n as i32 && 0 <= point.1 && point.1 < n as i32 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/18.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | / if in_bounds(&p, n) { [INFO] [stdout] 31 | | if !points_hm.contains_key(&p) { [INFO] [stdout] 32 | | let res = points_hm.get(&c).unwrap() + 1; [INFO] [stdout] 33 | | points_hm.insert(p, res); [INFO] [stdout] ... | [INFO] [stdout] 36 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 30 ~ if in_bounds(&p, n) [INFO] [stdout] 31 ~ && !points_hm.contains_key(&p) { [INFO] [stdout] 32 | let res = points_hm.get(&c).unwrap() + 1; [INFO] [stdout] 33 | points_hm.insert(p, res); [INFO] [stdout] 34 | queue.push_back(p); [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/18.rs:80:5 [INFO] [stdout] | [INFO] [stdout] 80 | points.get(r - 1).map(|p| *p) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `points.get(r - 1).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `op_s` is never used [INFO] [stdout] --> src/bin/17.rs:13:4 [INFO] [stdout] | [INFO] [stdout] 13 | fn op_s(o: &u64) -> &'static str { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `print_program` is never used [INFO] [stdout] --> src/bin/17.rs:26:4 [INFO] [stdout] | [INFO] [stdout] 26 | fn print_program(program: &Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/17.rs:26:27 [INFO] [stdout] | [INFO] [stdout] 26 | fn print_program(program: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 26 - fn print_program(program: &Vec) { [INFO] [stdout] 26 + fn print_program(program: &[u64]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/04.rs:133:13 [INFO] [stdout] | [INFO] [stdout] 133 | / if grid[&here] == b'A' { [INFO] [stdout] 134 | | if (grid[&(&here + (-1, -1))] == b'M' && grid[&(&here + (1, 1))] == b'S') [INFO] [stdout] 135 | | || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M') [INFO] [stdout] ... | [INFO] [stdout] 143 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 133 ~ if grid[&here] == b'A' [INFO] [stdout] 134 ~ && ((grid[&(&here + (-1, -1))] == b'M' && grid[&(&here + (1, 1))] == b'S') [INFO] [stdout] 135 ~ || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M')) [INFO] [stdout] 136 | { [INFO] [stdout] ... [INFO] [stdout] 141 | } [INFO] [stdout] 142 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/04.rs:134:17 [INFO] [stdout] | [INFO] [stdout] 134 | / if (grid[&(&here + (-1, -1))] == b'M' && grid[&(&here + (1, 1))] == b'S') [INFO] [stdout] 135 | | || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M') [INFO] [stdout] 136 | | { [INFO] [stdout] 137 | | if (grid[&(&here + (-1, 1))] == b'M' && grid[&(&here + (1, -1))] == b'S') [INFO] [stdout] ... | [INFO] [stdout] 142 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 134 ~ if ((grid[&(&here + (-1, -1))] == b'M' && grid[&(&here + (1, 1))] == b'S') [INFO] [stdout] 135 ~ || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M') [INFO] [stdout] 136 ~ || (grid[&(&here + (-1, -1))] == b'S' && grid[&(&here + (1, 1))] == b'M')) [INFO] [stdout] 137 | { [INFO] [stdout] 138 ~ && ((grid[&(&here + (-1, 1))] == b'M' && grid[&(&here + (1, -1))] == b'S') [INFO] [stdout] 139 ~ || (grid[&(&here + (-1, 1))] == b'S' && grid[&(&here + (1, -1))] == b'M')) [INFO] [stdout] 140 | { [INFO] [stdout] 141 | count += 1; [INFO] [stdout] 142 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/17.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | return (state, output); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 163 - return (state, output); [INFO] [stdout] 163 + (state, output) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/17.rs:94:14 [INFO] [stdout] | [INFO] [stdout] 94 | program: &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] 94 - program: &Vec, [INFO] [stdout] 94 + program: &[u64], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:119:17 [INFO] [stdout] | [INFO] [stdout] 119 | state.a = state.a >> state.get_op(op); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `state.a >>= state.get_op(op)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:123:17 [INFO] [stdout] | [INFO] [stdout] 123 | state.b = state.b ^ op; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `state.b ^= op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 138 | state.b = state.b ^ state.c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `state.b ^= state.c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:199:9 [INFO] [stdout] | [INFO] [stdout] 199 | num = num >> 3; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `num >>= 3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/17.rs:247:5 [INFO] [stdout] | [INFO] [stdout] 247 | return Some("NOT_FOUND".to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 247 - return Some("NOT_FOUND".to_string()); [INFO] [stdout] 247 + Some("NOT_FOUND".to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.58s [INFO] running `Command { std: "docker" "inspect" "6eb34aa511db9113551c9dc179a848d281bef5e258e23ac362f9e702df69ffda", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "6eb34aa511db9113551c9dc179a848d281bef5e258e23ac362f9e702df69ffda", kill_on_drop: false }` [INFO] [stdout] 6eb34aa511db9113551c9dc179a848d281bef5e258e23ac362f9e702df69ffda