[INFO] cloning repository https://github.com/chazzam/aoc2022 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/chazzam/aoc2022" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fchazzam%2Faoc2022", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fchazzam%2Faoc2022'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 12cf4aa30fb88afb362ce86b3c64ef4b77bed976 [INFO] linting chazzam/aoc2022 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fchazzam%2Faoc2022" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/chazzam/aoc2022 [INFO] finished tweaking git repo https://github.com/chazzam/aoc2022 [INFO] tweaked toml for git repo https://github.com/chazzam/aoc2022 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/chazzam/aoc2022 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/chazzam/aoc2022 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] 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] 17f62ce98b60aea5e0ded185ad2d214dc15593cb59edaffc4b229403c456a222 [INFO] running `Command { std: "docker" "start" "-a" "17f62ce98b60aea5e0ded185ad2d214dc15593cb59edaffc4b229403c456a222", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "17f62ce98b60aea5e0ded185ad2d214dc15593cb59edaffc4b229403c456a222", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "17f62ce98b60aea5e0ded185ad2d214dc15593cb59edaffc4b229403c456a222", kill_on_drop: false }` [INFO] [stdout] 17f62ce98b60aea5e0ded185ad2d214dc15593cb59edaffc4b229403c456a222 [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] d410f8f39875720ca2077dfe82f7747dae656958eba2d1fbfb10fe3d75acccff [INFO] running `Command { std: "docker" "start" "-a" "d410f8f39875720ca2077dfe82f7747dae656958eba2d1fbfb10fe3d75acccff", kill_on_drop: false }` [INFO] [stderr] Checking aoc2022 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/days1_2.rs:8:18 [INFO] [stdout] | [INFO] [stdout] 8 | .fold(0, |acc, x| acc + x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days1_2.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | "C" | "X" | _ => "A", [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] = note: `#[warn(clippy::wildcard_in_or_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days1_2.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | "Y" | _ => s_opp, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/days1_2.rs:8:18 [INFO] [stdout] | [INFO] [stdout] 8 | .fold(0, |acc, x| acc + x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/days3_5.rs:14:35 [INFO] [stdout] | [INFO] [stdout] 14 | left.intersection(&right).map(|x| _score_priority(x)).sum() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `_score_priority` [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: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days1_2.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | "C" | "X" | _ => "A", [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] = note: `#[warn(clippy::wildcard_in_or_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days1_2.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | "Y" | _ => s_opp, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/days3_5.rs:14:35 [INFO] [stdout] | [INFO] [stdout] 14 | left.intersection(&right).map(|x| _score_priority(x)).sum() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `_score_priority` [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: useless conversion to the same type: `std::str::Lines<'_>` [INFO] [stdout] --> src/days3_5.rs:18:20 [INFO] [stdout] | [INFO] [stdout] 18 | let sum: u32 = inputs [INFO] [stdout] | ____________________^ [INFO] [stdout] 19 | | .lines() [INFO] [stdout] 20 | | .into_iter() [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 18 ~ let sum: u32 = inputs [INFO] [stdout] 19 + .lines() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/days3_5.rs:34:41 [INFO] [stdout] | [INFO] [stdout] 34 | let elf1: HashSet = packs[index + 0].chars().collect(); [INFO] [stdout] | ^^^^^^^^^ help: consider reducing it to: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/days3_5.rs:43:18 [INFO] [stdout] | [INFO] [stdout] 43 | .map(|x| _score_priority(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `_score_priority` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/days3_5.rs:38:35 [INFO] [stdout] | [INFO] [stdout] 38 | let badge_priority: u32 = elf1 [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 39 | | .intersection(&elf2) [INFO] [stdout] 40 | | .map(|x| *x) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 38 ~ let badge_priority: u32 = elf1 [INFO] [stdout] 39 + .intersection(&elf2).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days3_5.rs:68:37 [INFO] [stdout] | [INFO] [stdout] 68 | || (range1.contains(&range2.start()) && range1.contains(range2.end())) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `range2.start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days3_5.rs:82:36 [INFO] [stdout] | [INFO] [stdout] 82 | || range1.contains(&range2.start()) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `range2.start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days3_5.rs:119:12 [INFO] [stdout] | [INFO] [stdout] 119 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().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: useless conversion to the same type: `std::str::Lines<'_>` [INFO] [stdout] --> src/days3_5.rs:18:20 [INFO] [stdout] | [INFO] [stdout] 18 | let sum: u32 = inputs [INFO] [stdout] | ____________________^ [INFO] [stdout] 19 | | .lines() [INFO] [stdout] 20 | | .into_iter() [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 18 ~ let sum: u32 = inputs [INFO] [stdout] 19 + .lines() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/days3_5.rs:34:41 [INFO] [stdout] | [INFO] [stdout] 34 | let elf1: HashSet = packs[index + 0].chars().collect(); [INFO] [stdout] | ^^^^^^^^^ help: consider reducing it to: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/days3_5.rs:43:18 [INFO] [stdout] | [INFO] [stdout] 43 | .map(|x| _score_priority(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `_score_priority` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/days3_5.rs:38:35 [INFO] [stdout] | [INFO] [stdout] 38 | let badge_priority: u32 = elf1 [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 39 | | .intersection(&elf2) [INFO] [stdout] 40 | | .map(|x| *x) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 38 ~ let badge_priority: u32 = elf1 [INFO] [stdout] 39 + .intersection(&elf2).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `stacks` [INFO] [stdout] --> src/days3_5.rs:126:22 [INFO] [stdout] | [INFO] [stdout] 126 | for c in 0..columns { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 126 - for c in 0..columns { [INFO] [stdout] 126 + for (c, ) in stacks.iter_mut().enumerate().take(columns) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days3_5.rs:172:12 [INFO] [stdout] | [INFO] [stdout] 172 | if stack.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days3_5.rs:191:12 [INFO] [stdout] | [INFO] [stdout] 191 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `stacks` [INFO] [stdout] --> src/days3_5.rs:198:22 [INFO] [stdout] | [INFO] [stdout] 198 | for c in 0..columns { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 198 - for c in 0..columns { [INFO] [stdout] 198 + for (c, ) in stacks.iter_mut().enumerate().take(columns) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days3_5.rs:245:12 [INFO] [stdout] | [INFO] [stdout] 245 | if stack.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days3_5.rs:68:37 [INFO] [stdout] | [INFO] [stdout] 68 | || (range1.contains(&range2.start()) && range1.contains(range2.end())) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `range2.start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/days3_5.rs:82:36 [INFO] [stdout] | [INFO] [stdout] 82 | || range1.contains(&range2.start()) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `range2.start()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days6_8.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 14 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days3_5.rs:119:12 [INFO] [stdout] | [INFO] [stdout] 119 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().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: the loop variable `c` is used to index `stacks` [INFO] [stdout] --> src/days3_5.rs:126:22 [INFO] [stdout] | [INFO] [stdout] 126 | for c in 0..columns { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 126 - for c in 0..columns { [INFO] [stdout] 126 + for (c, ) in stacks.iter_mut().enumerate().take(columns) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days6_8.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days6_8.rs:64:11 [INFO] [stdout] | [INFO] [stdout] 64 | while !command.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `command.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: redundant closure [INFO] [stdout] --> src/days6_8.rs:54:47 [INFO] [stdout] | [INFO] [stdout] 54 | let mut commands = inputs.split("$ ").map(|x| String::from(x)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days3_5.rs:172:12 [INFO] [stdout] | [INFO] [stdout] 172 | if stack.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days6_8.rs:67:12 [INFO] [stdout] | [INFO] [stdout] 67 | if my_command.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `my_command.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days3_5.rs:191:12 [INFO] [stdout] | [INFO] [stdout] 191 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/days6_8.rs:82:21 [INFO] [stdout] | [INFO] [stdout] 82 | pwd.push_str("/"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `pwd.push('/')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `stacks` [INFO] [stdout] --> src/days3_5.rs:198:22 [INFO] [stdout] | [INFO] [stdout] 198 | for c in 0..columns { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 198 - for c in 0..columns { [INFO] [stdout] 198 + for (c, ) in stacks.iter_mut().enumerate().take(columns) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/days6_8.rs:87:25 [INFO] [stdout] | [INFO] [stdout] 87 | pwd.push_str("/"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `pwd.push('/')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days6_8.rs:90:20 [INFO] [stdout] | [INFO] [stdout] 90 | if pwd.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `pwd.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/days6_8.rs:91:21 [INFO] [stdout] | [INFO] [stdout] 91 | pwd.push_str("/"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `pwd.push('/')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days3_5.rs:245:12 [INFO] [stdout] | [INFO] [stdout] 245 | if stack.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!stack.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/days6_8.rs:145:69 [INFO] [stdout] | [INFO] [stdout] 145 | let _used: u64 = tree.iter().fold(0, |acc, (_name, size)| acc + *size as u64); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `*size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days6_8.rs:168:28 [INFO] [stdout] | [INFO] [stdout] 168 | fn check_visibility(trees: &Vec>, row: usize, col: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 168 - fn check_visibility(trees: &Vec>, row: usize, col: usize) -> usize { [INFO] [stdout] 168 + fn check_visibility(trees: &[Vec], row: usize, col: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days6_8.rs:14:12 [INFO] [stdout] | [INFO] [stdout] 14 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is used to index `trees` [INFO] [stdout] --> src/days6_8.rs:174:14 [INFO] [stdout] | [INFO] [stdout] 174 | for r in 0..row { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 174 - for r in 0..row { [INFO] [stdout] 174 + for (r, ) in trees.iter().enumerate().take(row) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days6_8.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/days6_8.rs:64:11 [INFO] [stdout] | [INFO] [stdout] 64 | while !command.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `command.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: redundant closure [INFO] [stdout] --> src/days6_8.rs:54:47 [INFO] [stdout] | [INFO] [stdout] 54 | let mut commands = inputs.split("$ ").map(|x| String::from(x)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days6_8.rs:256:28 [INFO] [stdout] | [INFO] [stdout] 256 | fn count_visibility(trees: &Vec>, row: usize, col: 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] 256 - fn count_visibility(trees: &Vec>, row: usize, col: usize) -> usize { [INFO] [stdout] 256 + fn count_visibility(trees: &[Vec], row: usize, col: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days6_8.rs:67:12 [INFO] [stdout] | [INFO] [stdout] 67 | if my_command.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `my_command.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `trees` [INFO] [stdout] --> src/days6_8.rs:272:14 [INFO] [stdout] | [INFO] [stdout] 272 | for r in row + 1..trees.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 272 - for r in row + 1..trees.len() { [INFO] [stdout] 272 + for in trees.iter().skip(row + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/days6_8.rs:82:21 [INFO] [stdout] | [INFO] [stdout] 82 | pwd.push_str("/"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `pwd.push('/')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/days6_8.rs:87:25 [INFO] [stdout] | [INFO] [stdout] 87 | pwd.push_str("/"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `pwd.push('/')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/days6_8.rs:90:20 [INFO] [stdout] | [INFO] [stdout] 90 | if pwd.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `pwd.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/days6_8.rs:91:21 [INFO] [stdout] | [INFO] [stdout] 91 | pwd.push_str("/"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `pwd.push('/')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/days6_8.rs:353:5 [INFO] [stdout] | [INFO] [stdout] 353 | print!("Running Day Six, Part two sample:\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 353 - print!("Running Day Six, Part two sample:\n"); [INFO] [stdout] 353 + println!("Running Day Six, Part two sample:"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/days6_8.rs:145:69 [INFO] [stdout] | [INFO] [stdout] 145 | let _used: u64 = tree.iter().fold(0, |acc, (_name, size)| acc + *size as u64); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `*size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/days6_8.rs:168:28 [INFO] [stdout] | [INFO] [stdout] 168 | fn check_visibility(trees: &Vec>, row: usize, col: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 168 - fn check_visibility(trees: &Vec>, row: usize, col: usize) -> usize { [INFO] [stdout] 168 + fn check_visibility(trees: &[Vec], row: usize, col: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is used to index `trees` [INFO] [stdout] --> src/days6_8.rs:174:14 [INFO] [stdout] | [INFO] [stdout] 174 | for r in 0..row { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 174 - for r in 0..row { [INFO] [stdout] 174 + for (r, ) in trees.iter().enumerate().take(row) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days9_11.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | value = value % factor; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `value %= factor` [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 `.is_multiple_of()` [INFO] [stdout] --> src/days9_11.rs:29:15 [INFO] [stdout] | [INFO] [stdout] 29 | match value % self.test as u128 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `value.is_multiple_of(self.test as u128)` [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: the variable `off_index` is used as a loop counter [INFO] [stdout] --> src/days9_11.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | for monkey in old_monkeys.into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (off_index, monkey) in old_monkeys.into_iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` 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/days6_8.rs:256:28 [INFO] [stdout] | [INFO] [stdout] 256 | fn count_visibility(trees: &Vec>, row: usize, col: 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] 256 - fn count_visibility(trees: &Vec>, row: usize, col: usize) -> usize { [INFO] [stdout] 256 + fn count_visibility(trees: &[Vec], row: usize, col: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `trees` [INFO] [stdout] --> src/days6_8.rs:272:14 [INFO] [stdout] | [INFO] [stdout] 272 | for r in row + 1..trees.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 272 - for r in row + 1..trees.len() { [INFO] [stdout] 272 + for in trees.iter().skip(row + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/days9_11.rs:91:14 [INFO] [stdout] | [INFO] [stdout] 91 | .trim() [INFO] [stdout] | ______________^ [INFO] [stdout] 92 | | .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: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days9_11.rs:136:17 [INFO] [stdout] | [INFO] [stdout] 136 | "/" | _ => |a, arg| ((a / arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/days9_11.rs:133:53 [INFO] [stdout] | [INFO] [stdout] 133 | "+" => |a, arg| ((a + arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^^ help: try: `3_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/days9_11.rs:134:53 [INFO] [stdout] | [INFO] [stdout] 134 | "-" => |a, arg| ((a - arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^^ help: try: `3_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/days9_11.rs:135:53 [INFO] [stdout] | [INFO] [stdout] 135 | "*" => |a, arg| ((a * arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^^ help: try: `3_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/days9_11.rs:136:57 [INFO] [stdout] | [INFO] [stdout] 136 | "/" | _ => |a, arg| ((a / arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^^ help: try: `3_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days9_11.rs:142:17 [INFO] [stdout] | [INFO] [stdout] 142 | "/" | _ => |a: u128, arg| a / arg, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u128` -> `u128`) [INFO] [stdout] --> src/days9_11.rs:139:43 [INFO] [stdout] | [INFO] [stdout] 139 | "+" => |a: u128, arg| a + arg as u128, [INFO] [stdout] | ^^^^^^^^^^^ help: try: `arg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/days6_8.rs:353:5 [INFO] [stdout] | [INFO] [stdout] 353 | print!("Running Day Six, Part two sample:\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 353 - print!("Running Day Six, Part two sample:\n"); [INFO] [stdout] 353 + println!("Running Day Six, Part two sample:"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/days9_11.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | value = value % factor; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `value %= factor` [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 `.is_multiple_of()` [INFO] [stdout] --> src/days9_11.rs:29:15 [INFO] [stdout] | [INFO] [stdout] 29 | match value % self.test as u128 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `value.is_multiple_of(self.test as u128)` [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: the variable `off_index` is used as a loop counter [INFO] [stdout] --> src/days9_11.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | for monkey in old_monkeys.into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (off_index, monkey) in old_monkeys.into_iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/days9_11.rs:91:14 [INFO] [stdout] | [INFO] [stdout] 91 | .trim() [INFO] [stdout] | ______________^ [INFO] [stdout] 92 | | .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: the variable `display_row` is used as a loop counter [INFO] [stdout] --> src/days9_11.rs:348:5 [INFO] [stdout] | [INFO] [stdout] 348 | for r in (min_row..=rows as i16).rev() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (display_row, r) in (min_row..=rows as i16).rev().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days9_11.rs:136:17 [INFO] [stdout] | [INFO] [stdout] 136 | "/" | _ => |a, arg| ((a / arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i16` -> `i16`) [INFO] [stdout] --> src/days9_11.rs:348:25 [INFO] [stdout] | [INFO] [stdout] 348 | for r in (min_row..=rows as i16).rev() { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `rows` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i16` -> `i16`) [INFO] [stdout] --> src/days9_11.rs:349:28 [INFO] [stdout] | [INFO] [stdout] 349 | for c in min_col..=cols as i16 { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `cols` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/days9_11.rs:133:53 [INFO] [stdout] | [INFO] [stdout] 133 | "+" => |a, arg| ((a + arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^^ help: try: `3_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/days9_11.rs:134:53 [INFO] [stdout] | [INFO] [stdout] 134 | "-" => |a, arg| ((a - arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^^ help: try: `3_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/days9_11.rs:135:53 [INFO] [stdout] | [INFO] [stdout] 135 | "*" => |a, arg| ((a * arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^^ help: try: `3_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/days9_11.rs:136:57 [INFO] [stdout] | [INFO] [stdout] 136 | "/" | _ => |a, arg| ((a / arg) as f64 / 3 as f64).floor() as u128, [INFO] [stdout] | ^^^^^^^^ help: try: `3_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days9_11.rs:142:17 [INFO] [stdout] | [INFO] [stdout] 142 | "/" | _ => |a: u128, arg| a / arg, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u128` -> `u128`) [INFO] [stdout] --> src/days9_11.rs:139:43 [INFO] [stdout] | [INFO] [stdout] 139 | "+" => |a: u128, arg| a + arg as u128, [INFO] [stdout] | ^^^^^^^^^^^ help: try: `arg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days9_11.rs:391:13 [INFO] [stdout] | [INFO] [stdout] 391 | "R" | _ => Direction::Right, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:459:29 [INFO] [stdout] | [INFO] [stdout] 459 | *head_row = tail_row.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `tail_row` [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 `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:460:29 [INFO] [stdout] | [INFO] [stdout] 460 | *head_col = tail_col.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `tail_col` [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: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days9_11.rs:502:17 [INFO] [stdout] | [INFO] [stdout] 502 | "R" | _ => Direction::Right, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:507:28 [INFO] [stdout] | [INFO] [stdout] 507 | dirs.push((row.clone(), col.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*row` [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 `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:507:41 [INFO] [stdout] | [INFO] [stdout] 507 | dirs.push((row.clone(), col.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*col` [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 `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:519:28 [INFO] [stdout] | [INFO] [stdout] 519 | dirs.push((row.clone(), col.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*row` [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 `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:519:41 [INFO] [stdout] | [INFO] [stdout] 519 | dirs.push((row.clone(), col.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*col` [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: the variable `display_row` is used as a loop counter [INFO] [stdout] --> src/days9_11.rs:348:5 [INFO] [stdout] | [INFO] [stdout] 348 | for r in (min_row..=rows as i16).rev() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (display_row, r) in (min_row..=rows as i16).rev().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i16` -> `i16`) [INFO] [stdout] --> src/days9_11.rs:348:25 [INFO] [stdout] | [INFO] [stdout] 348 | for r in (min_row..=rows as i16).rev() { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `rows` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i16` -> `i16`) [INFO] [stdout] --> src/days9_11.rs:349:28 [INFO] [stdout] | [INFO] [stdout] 349 | for c in min_col..=cols as i16 { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `cols` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days9_11.rs:391:13 [INFO] [stdout] | [INFO] [stdout] 391 | "R" | _ => Direction::Right, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/days9_11.rs:647:10 [INFO] [stdout] | [INFO] [stdout] 647 | .map(|(cycle, x)| { [INFO] [stdout] | __________^ [INFO] [stdout] 648 | | let res: char; [INFO] [stdout] 649 | | // Get the current pixel to print [INFO] [stdout] 650 | | if (((cycle % 40) - 1)..=((cycle % 40) + 1)).contains(&x) { [INFO] [stdout] ... | [INFO] [stdout] 663 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 647 ~ .flat_map(|(cycle, x)| { [INFO] [stdout] 648 + let res: char; [INFO] [stdout] 649 + // Get the current pixel to print [INFO] [stdout] 650 + if (((cycle % 40) - 1)..=((cycle % 40) + 1)).contains(&x) { [INFO] [stdout] 651 + res = '#'; [INFO] [stdout] 652 + } else { [INFO] [stdout] 653 + res = '.' [INFO] [stdout] 654 + } [INFO] [stdout] 655 + // Split into lines for display [INFO] [stdout] 656 + if cycle % 40 == 0 { [INFO] [stdout] 657 + vec!['\n', res] [INFO] [stdout] 658 + } else { [INFO] [stdout] 659 + vec![res] [INFO] [stdout] 660 + } [INFO] [stdout] 661 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:459:29 [INFO] [stdout] | [INFO] [stdout] 459 | *head_row = tail_row.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `tail_row` [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 `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:460:29 [INFO] [stdout] | [INFO] [stdout] 460 | *head_col = tail_col.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `tail_col` [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: unneeded late initialization [INFO] [stdout] --> src/days9_11.rs:648:13 [INFO] [stdout] | [INFO] [stdout] 648 | let res: char; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `res` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 648 ~ [INFO] [stdout] 649 | // Get the current pixel to print [INFO] [stdout] 650 ~ let res: char = if (((cycle % 40) - 1)..=((cycle % 40) + 1)).contains(&x) { [INFO] [stdout] 651 ~ '#' [INFO] [stdout] 652 | } else { [INFO] [stdout] 653 ~ '.' [INFO] [stdout] 654 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: wildcard pattern covers any other pattern as it will match anyway [INFO] [stdout] --> src/days9_11.rs:502:17 [INFO] [stdout] | [INFO] [stdout] 502 | "R" | _ => Direction::Right, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider handling `_` separately [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_in_or_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:507:28 [INFO] [stdout] | [INFO] [stdout] 507 | dirs.push((row.clone(), col.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*row` [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 `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:507:41 [INFO] [stdout] | [INFO] [stdout] 507 | dirs.push((row.clone(), col.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*col` [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 `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:519:28 [INFO] [stdout] | [INFO] [stdout] 519 | dirs.push((row.clone(), col.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*row` [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 `clone` on type `i16` which implements the `Copy` trait [INFO] [stdout] --> src/days9_11.rs:519:41 [INFO] [stdout] | [INFO] [stdout] 519 | dirs.push((row.clone(), col.clone())); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*col` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/days9_11.rs:647:10 [INFO] [stdout] | [INFO] [stdout] 647 | .map(|(cycle, x)| { [INFO] [stdout] | __________^ [INFO] [stdout] 648 | | let res: char; [INFO] [stdout] 649 | | // Get the current pixel to print [INFO] [stdout] 650 | | if (((cycle % 40) - 1)..=((cycle % 40) + 1)).contains(&x) { [INFO] [stdout] ... | [INFO] [stdout] 663 | | .flatten() [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 647 ~ .flat_map(|(cycle, x)| { [INFO] [stdout] 648 + let res: char; [INFO] [stdout] 649 + // Get the current pixel to print [INFO] [stdout] 650 + if (((cycle % 40) - 1)..=((cycle % 40) + 1)).contains(&x) { [INFO] [stdout] 651 + res = '#'; [INFO] [stdout] 652 + } else { [INFO] [stdout] 653 + res = '.' [INFO] [stdout] 654 + } [INFO] [stdout] 655 + // Split into lines for display [INFO] [stdout] 656 + if cycle % 40 == 0 { [INFO] [stdout] 657 + vec!['\n', res] [INFO] [stdout] 658 + } else { [INFO] [stdout] 659 + vec![res] [INFO] [stdout] 660 + } [INFO] [stdout] 661 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/days9_11.rs:648:13 [INFO] [stdout] | [INFO] [stdout] 648 | let res: char; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `res` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 648 ~ [INFO] [stdout] 649 | // Get the current pixel to print [INFO] [stdout] 650 ~ let res: char = if (((cycle % 40) - 1)..=((cycle % 40) + 1)).contains(&x) { [INFO] [stdout] 651 ~ '#' [INFO] [stdout] 652 | } else { [INFO] [stdout] 653 ~ '.' [INFO] [stdout] 654 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.50s [INFO] running `Command { std: "docker" "inspect" "d410f8f39875720ca2077dfe82f7747dae656958eba2d1fbfb10fe3d75acccff", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d410f8f39875720ca2077dfe82f7747dae656958eba2d1fbfb10fe3d75acccff", kill_on_drop: false }` [INFO] [stdout] d410f8f39875720ca2077dfe82f7747dae656958eba2d1fbfb10fe3d75acccff