[INFO] cloning repository https://github.com/mfrdbigolin/AoC2023 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mfrdbigolin/AoC2023" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmfrdbigolin%2FAoC2023", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmfrdbigolin%2FAoC2023'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 3227e1a4643fcb392df5488261a11afb4f757441 [INFO] linting mfrdbigolin/AoC2023 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmfrdbigolin%2FAoC2023" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/mfrdbigolin/AoC2023 [INFO] finished tweaking git repo https://github.com/mfrdbigolin/AoC2023 [INFO] tweaked toml for git repo https://github.com/mfrdbigolin/AoC2023 written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/mfrdbigolin/AoC2023 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/mfrdbigolin/AoC2023 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded automod v1.0.13 [INFO] [stderr] Downloaded num v0.4.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 1a312ab6f14e8f2118cf91e647b6827e83faae7eb61e2941de2e35e094b02489 [INFO] running `Command { std: "docker" "start" "-a" "1a312ab6f14e8f2118cf91e647b6827e83faae7eb61e2941de2e35e094b02489", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "1a312ab6f14e8f2118cf91e647b6827e83faae7eb61e2941de2e35e094b02489", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1a312ab6f14e8f2118cf91e647b6827e83faae7eb61e2941de2e35e094b02489", kill_on_drop: false }` [INFO] [stdout] 1a312ab6f14e8f2118cf91e647b6827e83faae7eb61e2941de2e35e094b02489 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 206173d8b9d7dec77bcef11beefe60b9145d7a56628e697c5bb64aa028ca87bc [INFO] running `Command { std: "docker" "start" "-a" "206173d8b9d7dec77bcef11beefe60b9145d7a56628e697c5bb64aa028ca87bc", kill_on_drop: false }` [INFO] [stderr] Compiling num-traits v0.2.17 [INFO] [stderr] Compiling proc-macro2 v1.0.70 [INFO] [stderr] Compiling num-bigint v0.4.4 [INFO] [stderr] Compiling unicode-ident v1.0.12 [INFO] [stderr] Compiling num-iter v0.1.43 [INFO] [stderr] Compiling num-rational v0.4.1 [INFO] [stderr] Checking memchr v2.6.4 [INFO] [stderr] Checking regex-syntax v0.8.2 [INFO] [stderr] Checking aho-corasick v1.1.2 [INFO] [stderr] Compiling quote v1.0.33 [INFO] [stderr] Compiling syn v2.0.41 [INFO] [stderr] Checking num-integer v0.1.45 [INFO] [stderr] Checking num-complex v0.4.4 [INFO] [stderr] Checking regex-automata v0.4.3 [INFO] [stderr] Compiling automod v1.0.13 [INFO] [stderr] Checking num v0.4.1 [INFO] [stderr] Checking regex v1.10.2 [INFO] [stderr] Checking aoc2023 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day01.rs:19:50 [INFO] [stdout] | [INFO] [stdout] 19 | let mut digit_matches = s.matches(|ch: char| ch.is_digit(10)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `ch.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day01.rs:29:50 [INFO] [stdout] | [INFO] [stdout] 29 | let mut digit_matches = s.matches(|ch: char| ch.is_digit(10)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `ch.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day02.rs:8:18 [INFO] [stdout] | [INFO] [stdout] 8 | fn solve1(games: &Vec, bag: (u32, u32, u32)) -> usize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 8 - fn solve1(games: &Vec, bag: (u32, u32, u32)) -> usize { [INFO] [stdout] 8 + fn solve1(games: &[Game], bag: (u32, u32, u32)) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day03.rs:12:25 [INFO] [stdout] | [INFO] [stdout] 12 | fn extract_number(line: &mut Vec, mut j: usize) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 12 - fn extract_number(line: &mut Vec, mut j: usize) -> u32 { [INFO] [stdout] 12 + fn extract_number(line: &mut [char], mut j: usize) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day03.rs:14:11 [INFO] [stdout] | [INFO] [stdout] 14 | while line[j].is_digit(10) && j > 0 && line[j - 1].is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `line[j].is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day03.rs:14:44 [INFO] [stdout] | [INFO] [stdout] 14 | while line[j].is_digit(10) && j > 0 && line[j - 1].is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `line[j - 1].is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day03.rs:20:29 [INFO] [stdout] | [INFO] [stdout] 20 | while j < line.len() && line[j].is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `line[j].is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `partial` after checking its variant with `is_none` [INFO] [stdout] --> src/days/day03.rs:88:49 [INFO] [stdout] | [INFO] [stdout] 85 | partial = if partial.is_none() { [INFO] [stdout] | -------------------- help: try: `if let Some() = partial` [INFO] [stdout] ... [INFO] [stdout] 88 | Some(part_number_op(partial.unwrap(), part_number)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day03.rs:70:38 [INFO] [stdout] | [INFO] [stdout] 70 | if symbol_pred(*sym) && !sym.is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `sym.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/days/day03.rs:96:25 [INFO] [stdout] | [INFO] [stdout] 96 | / if count != num { [INFO] [stdout] 97 | | partial = None [INFO] [stdout] 98 | | } [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] 95 ~ Some(num) [INFO] [stdout] 96 ~ if count != num => { [INFO] [stdout] 97 | partial = None [INFO] [stdout] 98 ~ } [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/days/day03.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 94 | / match exactly_adjacent_to { [INFO] [stdout] 95 | | Some(num) => { [INFO] [stdout] 96 | | if count != num { [INFO] [stdout] 97 | | partial = None [INFO] [stdout] ... | [INFO] [stdout] 100 | | None => (), [INFO] [stdout] 101 | | }; [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] 94 ~ if let Some(num) = exactly_adjacent_to { [INFO] [stdout] 95 + if count != num { [INFO] [stdout] 96 + partial = None [INFO] [stdout] 97 + } [INFO] [stdout] 98 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/days/day03.rs:103:24 [INFO] [stdout] | [INFO] [stdout] 103 | acc += match partial { [INFO] [stdout] | ________________________^ [INFO] [stdout] 104 | | Some(num) => num, [INFO] [stdout] 105 | | None => 0, [INFO] [stdout] 106 | | }; [INFO] [stdout] | |_________________^ help: replace it with: `partial.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` 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/days/day04.rs:29:18 [INFO] [stdout] | [INFO] [stdout] 29 | fn solve2(cards: &Vec) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - fn solve2(cards: &Vec) -> u32 { [INFO] [stdout] 29 + fn solve2(cards: &[Card]) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/days/day06.rs:32:14 [INFO] [stdout] | [INFO] [stdout] 32 | .trim() [INFO] [stdout] | ______________^ [INFO] [stdout] 33 | | .split_whitespace() [INFO] [stdout] | |_____________^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` 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/days/day07.rs:84:32 [INFO] [stdout] | [INFO] [stdout] 84 | .max_by(|a, b| a.1.cmp(&b.1)) [INFO] [stdout] | ^^^^ help: change this to: `b.1` [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/days/day07.rs:151:17 [INFO] [stdout] | [INFO] [stdout] 151 | fn solve(plays: &Vec<(Hand, u32)>) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 151 - fn solve(plays: &Vec<(Hand, u32)>) -> u32 { [INFO] [stdout] 151 + fn solve(plays: &[(Hand, u32)]) -> u32 { [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/days/day08.rs:48:19 [INFO] [stdout] | [INFO] [stdout] 48 | instructions: &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] 48 - instructions: &Vec, [INFO] [stdout] 48 + instructions: &[Instruction], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days/day08.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | if !node.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `node.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day08.rs:78:19 [INFO] [stdout] | [INFO] [stdout] 78 | instructions: &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] 78 - instructions: &Vec, [INFO] [stdout] 78 + instructions: &[Instruction], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/days/day08.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | .reduce(|multiple, cnt| integer::lcm(multiple, cnt)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `integer::lcm` [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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/days/day10.rs:104:26 [INFO] [stdout] | [INFO] [stdout] 104 | (cur_dir, cur) = pipe_matrix [INFO] [stdout] | __________________________^ [INFO] [stdout] 105 | | .get_neighbors(cur) [INFO] [stdout] 106 | | .iter() [INFO] [stdout] 107 | | .copied() [INFO] [stdout] ... | [INFO] [stdout] 110 | | }) [INFO] [stdout] 111 | | .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] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/days/day10.rs:146:6 [INFO] [stdout] | [INFO] [stdout] 146 | (loop_area.abs() as usize) - main_loop.len() / 2 + 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `loop_area.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day11.rs:10:18 [INFO] [stdout] | [INFO] [stdout] 10 | fn solve(points: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 10 - fn solve(points: &Vec) -> u64 { [INFO] [stdout] 10 + fn solve(points: &[Point]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to u64 [INFO] [stdout] --> src/days/day11.rs:15:22 [INFO] [stdout] | [INFO] [stdout] 15 | let dx = (point2.0 as i64 - point1.0 as i64).abs() as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(point2.0 as i64 - point1.0 as i64).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to u64 [INFO] [stdout] --> src/days/day11.rs:16:22 [INFO] [stdout] | [INFO] [stdout] 16 | let dy = (point2.1 as i64 - point1.1 as i64).abs() as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(point2.1 as i64 - point1.1 as i64).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day12.rs:86:22 [INFO] [stdout] | [INFO] [stdout] 86 | fn solve_dp(springs: &Vec, groups: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 86 ~ fn solve_dp(springs: &[Spring], groups: &Vec) -> u64 { [INFO] [stdout] 87 | // Pad springs. [INFO] [stdout] 88 | let springs = vec![ [INFO] [stdout] 89 | vec![Spring::Operational], [INFO] [stdout] 90 ~ springs.to_owned(), [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/days/day12.rs:86:44 [INFO] [stdout] | [INFO] [stdout] 86 | fn solve_dp(springs: &Vec, groups: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 86 - fn solve_dp(springs: &Vec, groups: &Vec) -> u64 { [INFO] [stdout] 86 + fn solve_dp(springs: &Vec, groups: &[u64]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/days/day12.rs:105:23 [INFO] [stdout] | [INFO] [stdout] 105 | let mut dp = vec![0 as u64; groups.len() + 1]; [INFO] [stdout] | ^^^^^^^^ help: try: `0_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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day12.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | acc += solve_dp(&springs, &groups); [INFO] [stdout] | ^^^^^^^^ help: change this to: `springs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day12.rs:145:35 [INFO] [stdout] | [INFO] [stdout] 145 | acc += solve_dp(&springs, &groups); [INFO] [stdout] | ^^^^^^^ help: change this to: `groups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | fn find_reflection_line(lines: &Vec>, req_num_smudges: usize) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - fn find_reflection_line(lines: &Vec>, req_num_smudges: usize) -> Option { [INFO] [stdout] 29 + fn find_reflection_line(lines: &[Vec], req_num_smudges: usize) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:50:30 [INFO] [stdout] | [INFO] [stdout] 50 | fn solve(landscape_matrices: &Vec>, req_num_smudges: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 50 - fn solve(landscape_matrices: &Vec>, req_num_smudges: usize) -> usize { [INFO] [stdout] 50 + fn solve(landscape_matrices: &[Matrix], req_num_smudges: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/days/day15.rs:58:45 [INFO] [stdout] | [INFO] [stdout] 58 | let mut split_step = step.split(|ch| ch == '-' || ch == '='); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['-', '=']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/days/day16.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | let (dir, point) = stack.pop().expect("the stack should not be empty"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 72 ~ while let Some((dir, point)) = stack.pop() { [INFO] [stdout] 73 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `program_path` after checking its variant with `is_ok` [INFO] [stdout] --> src/main.rs:19:24 [INFO] [stdout] | [INFO] [stdout] 18 | if program_path.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = program_path` [INFO] [stdout] 19 | let path = program_path.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day01.rs:58:20 [INFO] [stdout] | [INFO] [stdout] 58 | let patterns = vec![ [INFO] [stdout] | ____________________^ [INFO] [stdout] 59 | | overlapping_patterns, [INFO] [stdout] 60 | | vec![ [INFO] [stdout] 61 | | "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", [INFO] [stdout] 62 | | ], [INFO] [stdout] 63 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 58 ~ let patterns = [overlapping_patterns, [INFO] [stdout] 59 + vec![ [INFO] [stdout] 60 + "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", [INFO] [stdout] 61 + ]] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day01.rs:68:24 [INFO] [stdout] | [INFO] [stdout] 68 | let replacements = vec![ [INFO] [stdout] | ________________________^ [INFO] [stdout] 69 | | overlapping_replacements, [INFO] [stdout] 70 | | vec!["1", "2", "3", "4", "5", "6", "7", "8", "9"], [INFO] [stdout] 71 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 68 ~ let replacements = [overlapping_replacements, [INFO] [stdout] 69 + vec!["1", "2", "3", "4", "5", "6", "7", "8", "9"]] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day12.rs:88:19 [INFO] [stdout] | [INFO] [stdout] 88 | let springs = vec![ [INFO] [stdout] | ___________________^ [INFO] [stdout] 89 | | vec![Spring::Operational], [INFO] [stdout] 90 | | springs.clone(), [INFO] [stdout] 91 | | vec![Spring::Operational], [INFO] [stdout] 92 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 88 ~ let springs = [vec![Spring::Operational], [INFO] [stdout] 89 + springs.clone(), [INFO] [stdout] 90 + vec![Spring::Operational]] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day12.rs:100:27 [INFO] [stdout] | [INFO] [stdout] 100 | .flat_map(|group| vec![group, vec![false]].concat()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[group, vec![false]]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day12.rs:103:18 [INFO] [stdout] | [INFO] [stdout] 103 | let groups = vec![vec![false], groups].concat(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[vec![false], groups]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day16.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | vec![south, north, east, west].concat() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[south, north, east, west]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique [INFO] [stdout] --> src/days/day16.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 10 | #[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)] [INFO] [stdout] | --------- in this derive macro expansion [INFO] [stdout] ... [INFO] [stdout] 13 | reflect: fn(Direction) -> Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the address of the same function can vary between different codegen units [INFO] [stdout] = note: furthermore, different functions could have the same address after being merged together [INFO] [stdout] = note: for more information visit [INFO] [stdout] = note: `#[warn(unpredictable_function_pointer_comparisons)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day01.rs:19:50 [INFO] [stdout] | [INFO] [stdout] 19 | let mut digit_matches = s.matches(|ch: char| ch.is_digit(10)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `ch.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day01.rs:29:50 [INFO] [stdout] | [INFO] [stdout] 29 | let mut digit_matches = s.matches(|ch: char| ch.is_digit(10)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `ch.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day02.rs:8:18 [INFO] [stdout] | [INFO] [stdout] 8 | fn solve1(games: &Vec, bag: (u32, u32, u32)) -> usize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 8 - fn solve1(games: &Vec, bag: (u32, u32, u32)) -> usize { [INFO] [stdout] 8 + fn solve1(games: &[Game], bag: (u32, u32, u32)) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day03.rs:12:25 [INFO] [stdout] | [INFO] [stdout] 12 | fn extract_number(line: &mut Vec, mut j: usize) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 12 - fn extract_number(line: &mut Vec, mut j: usize) -> u32 { [INFO] [stdout] 12 + fn extract_number(line: &mut [char], mut j: usize) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day03.rs:14:11 [INFO] [stdout] | [INFO] [stdout] 14 | while line[j].is_digit(10) && j > 0 && line[j - 1].is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `line[j].is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day03.rs:14:44 [INFO] [stdout] | [INFO] [stdout] 14 | while line[j].is_digit(10) && j > 0 && line[j - 1].is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `line[j - 1].is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day03.rs:20:29 [INFO] [stdout] | [INFO] [stdout] 20 | while j < line.len() && line[j].is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `line[j].is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `partial` after checking its variant with `is_none` [INFO] [stdout] --> src/days/day03.rs:88:49 [INFO] [stdout] | [INFO] [stdout] 85 | partial = if partial.is_none() { [INFO] [stdout] | -------------------- help: try: `if let Some() = partial` [INFO] [stdout] ... [INFO] [stdout] 88 | Some(part_number_op(partial.unwrap(), part_number)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 10 [INFO] [stdout] --> src/days/day03.rs:70:38 [INFO] [stdout] | [INFO] [stdout] 70 | if symbol_pred(*sym) && !sym.is_digit(10) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `sym.is_ascii_digit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/days/day03.rs:96:25 [INFO] [stdout] | [INFO] [stdout] 96 | / if count != num { [INFO] [stdout] 97 | | partial = None [INFO] [stdout] 98 | | } [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] 95 ~ Some(num) [INFO] [stdout] 96 ~ if count != num => { [INFO] [stdout] 97 | partial = None [INFO] [stdout] 98 ~ } [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/days/day03.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 94 | / match exactly_adjacent_to { [INFO] [stdout] 95 | | Some(num) => { [INFO] [stdout] 96 | | if count != num { [INFO] [stdout] 97 | | partial = None [INFO] [stdout] ... | [INFO] [stdout] 100 | | None => (), [INFO] [stdout] 101 | | }; [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] 94 ~ if let Some(num) = exactly_adjacent_to { [INFO] [stdout] 95 + if count != num { [INFO] [stdout] 96 + partial = None [INFO] [stdout] 97 + } [INFO] [stdout] 98 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/days/day03.rs:103:24 [INFO] [stdout] | [INFO] [stdout] 103 | acc += match partial { [INFO] [stdout] | ________________________^ [INFO] [stdout] 104 | | Some(num) => num, [INFO] [stdout] 105 | | None => 0, [INFO] [stdout] 106 | | }; [INFO] [stdout] | |_________________^ help: replace it with: `partial.unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` 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/days/day04.rs:29:18 [INFO] [stdout] | [INFO] [stdout] 29 | fn solve2(cards: &Vec) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - fn solve2(cards: &Vec) -> u32 { [INFO] [stdout] 29 + fn solve2(cards: &[Card]) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/days/day06.rs:32:14 [INFO] [stdout] | [INFO] [stdout] 32 | .trim() [INFO] [stdout] | ______________^ [INFO] [stdout] 33 | | .split_whitespace() [INFO] [stdout] | |_____________^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` 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/days/day07.rs:84:32 [INFO] [stdout] | [INFO] [stdout] 84 | .max_by(|a, b| a.1.cmp(&b.1)) [INFO] [stdout] | ^^^^ help: change this to: `b.1` [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/days/day07.rs:151:17 [INFO] [stdout] | [INFO] [stdout] 151 | fn solve(plays: &Vec<(Hand, u32)>) -> 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] help: change this to [INFO] [stdout] | [INFO] [stdout] 151 - fn solve(plays: &Vec<(Hand, u32)>) -> u32 { [INFO] [stdout] 151 + fn solve(plays: &[(Hand, u32)]) -> u32 { [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/days/day08.rs:48:19 [INFO] [stdout] | [INFO] [stdout] 48 | instructions: &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] 48 - instructions: &Vec, [INFO] [stdout] 48 + instructions: &[Instruction], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days/day08.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | if !node.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `node.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day08.rs:78:19 [INFO] [stdout] | [INFO] [stdout] 78 | instructions: &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] 78 - instructions: &Vec, [INFO] [stdout] 78 + instructions: &[Instruction], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/days/day08.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | .reduce(|multiple, cnt| integer::lcm(multiple, cnt)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `integer::lcm` [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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/days/day10.rs:104:26 [INFO] [stdout] | [INFO] [stdout] 104 | (cur_dir, cur) = pipe_matrix [INFO] [stdout] | __________________________^ [INFO] [stdout] 105 | | .get_neighbors(cur) [INFO] [stdout] 106 | | .iter() [INFO] [stdout] 107 | | .copied() [INFO] [stdout] ... | [INFO] [stdout] 110 | | }) [INFO] [stdout] 111 | | .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] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/days/day10.rs:146:6 [INFO] [stdout] | [INFO] [stdout] 146 | (loop_area.abs() as usize) - main_loop.len() / 2 + 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace with: `loop_area.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day11.rs:10:18 [INFO] [stdout] | [INFO] [stdout] 10 | fn solve(points: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 10 - fn solve(points: &Vec) -> u64 { [INFO] [stdout] 10 + fn solve(points: &[Point]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to u64 [INFO] [stdout] --> src/days/day11.rs:15:22 [INFO] [stdout] | [INFO] [stdout] 15 | let dx = (point2.0 as i64 - point1.0 as i64).abs() as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(point2.0 as i64 - point1.0 as i64).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i64::abs()` to u64 [INFO] [stdout] --> src/days/day11.rs:16:22 [INFO] [stdout] | [INFO] [stdout] 16 | let dy = (point2.1 as i64 - point1.1 as i64).abs() as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(point2.1 as i64 - point1.1 as i64).unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day12.rs:86:22 [INFO] [stdout] | [INFO] [stdout] 86 | fn solve_dp(springs: &Vec, groups: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 86 ~ fn solve_dp(springs: &[Spring], groups: &Vec) -> u64 { [INFO] [stdout] 87 | // Pad springs. [INFO] [stdout] 88 | let springs = vec![ [INFO] [stdout] 89 | vec![Spring::Operational], [INFO] [stdout] 90 ~ springs.to_owned(), [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/days/day12.rs:86:44 [INFO] [stdout] | [INFO] [stdout] 86 | fn solve_dp(springs: &Vec, groups: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 86 - fn solve_dp(springs: &Vec, groups: &Vec) -> u64 { [INFO] [stdout] 86 + fn solve_dp(springs: &Vec, groups: &[u64]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/days/day12.rs:105:23 [INFO] [stdout] | [INFO] [stdout] 105 | let mut dp = vec![0 as u64; groups.len() + 1]; [INFO] [stdout] | ^^^^^^^^ help: try: `0_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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day12.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | acc += solve_dp(&springs, &groups); [INFO] [stdout] | ^^^^^^^^ help: change this to: `springs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days/day12.rs:145:35 [INFO] [stdout] | [INFO] [stdout] 145 | acc += solve_dp(&springs, &groups); [INFO] [stdout] | ^^^^^^^ help: change this to: `groups` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | fn find_reflection_line(lines: &Vec>, req_num_smudges: usize) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - fn find_reflection_line(lines: &Vec>, req_num_smudges: usize) -> Option { [INFO] [stdout] 29 + fn find_reflection_line(lines: &[Vec], req_num_smudges: usize) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days/day13.rs:50:30 [INFO] [stdout] | [INFO] [stdout] 50 | fn solve(landscape_matrices: &Vec>, req_num_smudges: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 50 - fn solve(landscape_matrices: &Vec>, req_num_smudges: usize) -> usize { [INFO] [stdout] 50 + fn solve(landscape_matrices: &[Matrix], req_num_smudges: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/days/day15.rs:58:45 [INFO] [stdout] | [INFO] [stdout] 58 | let mut split_step = step.split(|ch| ch == '-' || ch == '='); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['-', '=']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/days/day16.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | let (dir, point) = stack.pop().expect("the stack should not be empty"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 72 ~ while let Some((dir, point)) = stack.pop() { [INFO] [stdout] 73 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `program_path` after checking its variant with `is_ok` [INFO] [stdout] --> src/main.rs:19:24 [INFO] [stdout] | [INFO] [stdout] 18 | if program_path.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = program_path` [INFO] [stdout] 19 | let path = program_path.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day01.rs:58:20 [INFO] [stdout] | [INFO] [stdout] 58 | let patterns = vec![ [INFO] [stdout] | ____________________^ [INFO] [stdout] 59 | | overlapping_patterns, [INFO] [stdout] 60 | | vec![ [INFO] [stdout] 61 | | "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", [INFO] [stdout] 62 | | ], [INFO] [stdout] 63 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 58 ~ let patterns = [overlapping_patterns, [INFO] [stdout] 59 + vec![ [INFO] [stdout] 60 + "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", [INFO] [stdout] 61 + ]] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day01.rs:68:24 [INFO] [stdout] | [INFO] [stdout] 68 | let replacements = vec![ [INFO] [stdout] | ________________________^ [INFO] [stdout] 69 | | overlapping_replacements, [INFO] [stdout] 70 | | vec!["1", "2", "3", "4", "5", "6", "7", "8", "9"], [INFO] [stdout] 71 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 68 ~ let replacements = [overlapping_replacements, [INFO] [stdout] 69 + vec!["1", "2", "3", "4", "5", "6", "7", "8", "9"]] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day12.rs:88:19 [INFO] [stdout] | [INFO] [stdout] 88 | let springs = vec![ [INFO] [stdout] | ___________________^ [INFO] [stdout] 89 | | vec![Spring::Operational], [INFO] [stdout] 90 | | springs.clone(), [INFO] [stdout] 91 | | vec![Spring::Operational], [INFO] [stdout] 92 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 88 ~ let springs = [vec![Spring::Operational], [INFO] [stdout] 89 + springs.clone(), [INFO] [stdout] 90 + vec![Spring::Operational]] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day12.rs:100:27 [INFO] [stdout] | [INFO] [stdout] 100 | .flat_map(|group| vec![group, vec![false]].concat()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[group, vec![false]]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day12.rs:103:18 [INFO] [stdout] | [INFO] [stdout] 103 | let groups = vec![vec![false], groups].concat(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[vec![false], groups]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/days/day16.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | vec![south, north, east, west].concat() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[south, north, east, west]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique [INFO] [stdout] --> src/days/day16.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 10 | #[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)] [INFO] [stdout] | --------- in this derive macro expansion [INFO] [stdout] ... [INFO] [stdout] 13 | reflect: fn(Direction) -> Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the address of the same function can vary between different codegen units [INFO] [stdout] = note: furthermore, different functions could have the same address after being merged together [INFO] [stdout] = note: for more information visit [INFO] [stdout] = note: `#[warn(unpredictable_function_pointer_comparisons)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 8.08s [INFO] running `Command { std: "docker" "inspect" "206173d8b9d7dec77bcef11beefe60b9145d7a56628e697c5bb64aa028ca87bc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "206173d8b9d7dec77bcef11beefe60b9145d7a56628e697c5bb64aa028ca87bc", kill_on_drop: false }` [INFO] [stdout] 206173d8b9d7dec77bcef11beefe60b9145d7a56628e697c5bb64aa028ca87bc