[INFO] cloning repository https://github.com/7dev7urandom/aoc-2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/7dev7urandom/aoc-2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2F7dev7urandom%2Faoc-2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2F7dev7urandom%2Faoc-2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 33a3e9aacfdb4b28e2ae874287bf434a85d0e659 [INFO] linting 7dev7urandom/aoc-2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2F7dev7urandom%2Faoc-2024" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-3-tc1/source/.cargo/config.toml [INFO] started tweaking git repo https://github.com/7dev7urandom/aoc-2024 [INFO] finished tweaking git repo https://github.com/7dev7urandom/aoc-2024 [INFO] tweaked toml for git repo https://github.com/7dev7urandom/aoc-2024 written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/7dev7urandom/aoc-2024 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/7dev7urandom/aoc-2024 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded tinyjson v2.5.1 [INFO] [stderr] Downloaded thousands v0.2.0 [INFO] [stderr] Downloaded dhat v0.3.3 [INFO] [stderr] Downloaded parking_lot_core v0.9.9 [INFO] [stderr] Downloaded iana-time-zone v0.1.58 [INFO] [stderr] Downloaded mintex v0.1.2 [INFO] [stderr] Downloaded colored v2.1.0 [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] 9d029965707f065e761cbcb83449fb32cd6e33259088e47b6f3d7e1e76f3608f [INFO] running `Command { std: "docker" "start" "-a" "9d029965707f065e761cbcb83449fb32cd6e33259088e47b6f3d7e1e76f3608f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "9d029965707f065e761cbcb83449fb32cd6e33259088e47b6f3d7e1e76f3608f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9d029965707f065e761cbcb83449fb32cd6e33259088e47b6f3d7e1e76f3608f", kill_on_drop: false }` [INFO] [stdout] 9d029965707f065e761cbcb83449fb32cd6e33259088e47b6f3d7e1e76f3608f [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] c465a3ca6b1197fb14624e550eca4f9fd5b81badd97e1c2de5780cedd49d9e2c [INFO] running `Command { std: "docker" "start" "-a" "c465a3ca6b1197fb14624e550eca4f9fd5b81badd97e1c2de5780cedd49d9e2c", kill_on_drop: false }` [INFO] [stderr] Checking memchr v2.6.4 [INFO] [stderr] Checking either v1.13.0 [INFO] [stderr] Checking pico-args v0.5.0 [INFO] [stderr] Checking tinyjson v2.5.1 [INFO] [stderr] Checking colored v2.1.0 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking advent_of_code v0.11.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 61 - data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] 61 + data.sort_unstable_by_key(|a| a.day); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 61 - data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] 61 + data.sort_unstable_by_key(|a| a.day); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/23.rs:11:22 [INFO] [stdout] | [INFO] [stdout] 11 | let first = [first.chars().nth(0).unwrap(), first.chars().nth(1).unwrap()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `first.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/23.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | second.chars().nth(0).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `second.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/08.rs:5:32 [INFO] [stdout] | [INFO] [stdout] 5 | fn parse_input(input: &str) -> (usize, usize, hash_map::HashMap>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/04.rs:67:17 [INFO] [stdout] | [INFO] [stdout] 67 | / if word_search_grid[(x as i32 + dx) as usize][(y as i32 + dy) as usize] != 'M' [INFO] [stdout] 68 | | || word_search_grid[(x as i32 - dx) as usize][(y as i32 - dy) as usize] != 'S' [INFO] [stdout] 69 | | { [INFO] [stdout] 70 | | if word_search_grid[(x as i32 + dx) as usize][(y as i32 + dy) as usize] != 'S' [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 67 ~ if (word_search_grid[(x as i32 + dx) as usize][(y as i32 + dy) as usize] != 'M' [INFO] [stdout] 68 ~ || word_search_grid[(x as i32 - dx) as usize][(y as i32 - dy) as usize] != 'S' [INFO] [stdout] 69 ~ || word_search_grid[(x as i32 - dx) as usize][(y as i32 - dy) as usize] != 'S') [INFO] [stdout] 70 | { [INFO] [stdout] 71 ~ && (word_search_grid[(x as i32 + dx) as usize][(y as i32 + dy) as usize] != 'S' [INFO] [stdout] 72 | || word_search_grid[(x as i32 - dx) as usize][(y as i32 - dy) as usize] [INFO] [stdout] 73 ~ != 'M') [INFO] [stdout] 74 | { [INFO] [stdout] 75 | found = false; [INFO] [stdout] 76 | break; [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/bin/19.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | if target_pattern == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `target_pattern.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:19:28 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn mapify_rules(rules: &Vec<(u32, u32)>) -> std::collections::HashMap> { [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] 19 - pub fn mapify_rules(rules: &Vec<(u32, u32)>) -> std::collections::HashMap> { [INFO] [stdout] 19 + pub fn mapify_rules(rules: &[(u32, u32)]) -> std::collections::HashMap> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/04.rs:67:17 [INFO] [stdout] | [INFO] [stdout] 67 | / if word_search_grid[(x as i32 + dx) as usize][(y as i32 + dy) as usize] != 'M' [INFO] [stdout] 68 | | || word_search_grid[(x as i32 - dx) as usize][(y as i32 - dy) as usize] != 'S' [INFO] [stdout] 69 | | { [INFO] [stdout] 70 | | if word_search_grid[(x as i32 + dx) as usize][(y as i32 + dy) as usize] != 'S' [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 67 ~ if (word_search_grid[(x as i32 + dx) as usize][(y as i32 + dy) as usize] != 'M' [INFO] [stdout] 68 ~ || word_search_grid[(x as i32 - dx) as usize][(y as i32 - dy) as usize] != 'S' [INFO] [stdout] 69 ~ || word_search_grid[(x as i32 - dx) as usize][(y as i32 - dy) as usize] != 'S') [INFO] [stdout] 70 | { [INFO] [stdout] 71 ~ && (word_search_grid[(x as i32 + dx) as usize][(y as i32 + dy) as usize] != 'S' [INFO] [stdout] 72 | || word_search_grid[(x as i32 - dx) as usize][(y as i32 - dy) as usize] [INFO] [stdout] 73 ~ != 'M') [INFO] [stdout] 74 | { [INFO] [stdout] 75 | found = false; [INFO] [stdout] 76 | break; [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/13.rs:4:56 [INFO] [stdout] | [INFO] [stdout] 4 | fn parse_input(input: &str, add_ten_trillion: bool) -> Vec<((u64, u64), (u64, u64), (u64, u64))> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/14.rs:23:34 [INFO] [stdout] | [INFO] [stdout] 23 | fn calculate_positions_n(robots: &[((i32, i32), (i32, i32))], n: u32) -> Vec<(i32, i32)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/14.rs:30:21 [INFO] [stdout] | [INFO] [stdout] 30 | let x = (px + (vx * n as i32)).rem_euclid(DIMENSIONS.0) as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(px + (vx * n as i32)).rem_euclid(DIMENSIONS.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/14.rs:31:21 [INFO] [stdout] | [INFO] [stdout] 31 | let y = (py + (vy * n as i32)).rem_euclid(DIMENSIONS.1) as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(py + (vy * n as i32)).rem_euclid(DIMENSIONS.1)` [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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/23.rs:11:22 [INFO] [stdout] | [INFO] [stdout] 11 | let first = [first.chars().nth(0).unwrap(), first.chars().nth(1).unwrap()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `first.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/14.rs:88:24 [INFO] [stdout] | [INFO] [stdout] 88 | fn detect_tree(robots: &Vec<(i32, i32)>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 88 - fn detect_tree(robots: &Vec<(i32, i32)>) -> bool { [INFO] [stdout] 88 + fn detect_tree(robots: &[(i32, i32)]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/23.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | second.chars().nth(0).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `second.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/12.rs:89:32 [INFO] [stdout] | [INFO] [stdout] 89 | let mut region_area_edges: HashMap; 4])> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/09.rs:91:33 [INFO] [stdout] | [INFO] [stdout] 91 | fn print_file_element_str(data: &Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 91 - fn print_file_element_str(data: &Vec) { [INFO] [stdout] 91 + fn print_file_element_str(data: &[FileElement]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:95:34 [INFO] [stdout] | [INFO] [stdout] 95 | Instruction::Bxl(val) => *reg_b = *reg_b ^ *val as u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*reg_b ^= *val as u64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:103:31 [INFO] [stdout] | [INFO] [stdout] 103 | Instruction::Bxc() => *reg_b = *reg_b ^ *reg_c, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*reg_b ^= *reg_c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | return (start_position, positions); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return (start_position, positions); [INFO] [stdout] 30 + (start_position, positions) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/17.rs:127:12 [INFO] [stdout] | [INFO] [stdout] 127 | instr: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 127 - instr: &Vec, [INFO] [stdout] 127 + instr: &[Instruction], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:114:25 [INFO] [stdout] | [INFO] [stdout] 114 | direction: direction, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `direction` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:164:25 [INFO] [stdout] | [INFO] [stdout] 164 | pos: pos, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/17.rs:176:10 [INFO] [stdout] | [INFO] [stdout] 176 | &prog_digits.iter().rev().map(|f| *f).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `prog_digits.iter().rev().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/06.rs:66:11 [INFO] [stdout] | [INFO] [stdout] 66 | grid: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 66 - grid: &Vec>, [INFO] [stdout] 66 + grid: &[Vec], [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/bin/06.rs:95:11 [INFO] [stdout] | [INFO] [stdout] 95 | grid: &mut Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 95 - grid: &mut Vec>, [INFO] [stdout] 95 + grid: &mut [Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/20.rs:7:32 [INFO] [stdout] | [INFO] [stdout] 7 | fn parse_input(input: &str) -> ((usize, usize), (usize, usize), Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/20.rs:49:11 [INFO] [stdout] | [INFO] [stdout] 49 | grid: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 49 - grid: &Vec>, [INFO] [stdout] 49 + grid: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/20.rs:51:14 [INFO] [stdout] | [INFO] [stdout] 51 | visited: &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] 51 - visited: &Vec>, [INFO] [stdout] 51 + visited: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/20.rs:70:21 [INFO] [stdout] | [INFO] [stdout] 70 | no_cheat_times: &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] 70 - no_cheat_times: &Vec>>, [INFO] [stdout] 70 + no_cheat_times: &[Vec>], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/20.rs:87:17 [INFO] [stdout] | [INFO] [stdout] 87 | / if x < grid[0].len() && y < grid.len() { [INFO] [stdout] 88 | | if grid[y][x] != '#' { [INFO] [stdout] 89 | | if let Some(target_time) = no_cheat_times[y][x] { [INFO] [stdout] 90 | | let total = dx.abs() + dy.abs() + target_time as i32; [INFO] [stdout] ... | [INFO] [stdout] 99 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 87 ~ if x < grid[0].len() && y < grid.len() [INFO] [stdout] 88 ~ && grid[y][x] != '#' { [INFO] [stdout] 89 | if let Some(target_time) = no_cheat_times[y][x] { [INFO] [stdout] ... [INFO] [stdout] 97 | } [INFO] [stdout] 98 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/20.rs:103:32 [INFO] [stdout] | [INFO] [stdout] 103 | current_pos = get_next(&grid, current_pos, &visited); [INFO] [stdout] | ^^^^^ help: change this to: `grid` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/14.rs:23:34 [INFO] [stdout] | [INFO] [stdout] 23 | fn calculate_positions_n(robots: &[((i32, i32), (i32, i32))], n: u32) -> Vec<(i32, i32)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/14.rs:30:21 [INFO] [stdout] | [INFO] [stdout] 30 | let x = (px + (vx * n as i32)).rem_euclid(DIMENSIONS.0) as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(px + (vx * n as i32)).rem_euclid(DIMENSIONS.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/bin/14.rs:31:21 [INFO] [stdout] | [INFO] [stdout] 31 | let y = (py + (vy * n as i32)).rem_euclid(DIMENSIONS.1) as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(py + (vy * n as i32)).rem_euclid(DIMENSIONS.1)` [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: this boolean expression can be simplified [INFO] [stdout] --> src/bin/21.rs:65:8 [INFO] [stdout] | [INFO] [stdout] 65 | if !((is_numpad && from.1 == 0 && to.0 == 0) || (!is_numpad && to.0 == 0 && from.1 == 1)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `to.0 != 0 || is_numpad && from.1 != 0 || !is_numpad && from.1 != 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/21.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | if !((is_numpad && from.1 == 0 && to.0 == 0) || (!is_numpad && to.0 == 0 && from.1 == 1)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 65 - if !((is_numpad && from.1 == 0 && to.0 == 0) || (!is_numpad && to.0 == 0 && from.1 == 1)) { [INFO] [stdout] 65 + if !!(to.0 != 0 || is_numpad && from.1 != 0 || !is_numpad && from.1 != 1) { [INFO] [stdout] | [INFO] [stdout] 65 - if !((is_numpad && from.1 == 0 && to.0 == 0) || (!is_numpad && to.0 == 0 && from.1 == 1)) { [INFO] [stdout] 65 + if !(from.1 == 1 || is_numpad) && (from.1 == 0 || !is_numpad) && to.0 == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/21.rs:69:8 [INFO] [stdout] | [INFO] [stdout] 69 | if !((is_numpad && to.1 == 0 && from.0 == 0) || (!is_numpad && from.0 == 0 && to.1 == 1)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `from.0 != 0 || is_numpad && to.1 != 0 || !is_numpad && to.1 != 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/21.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | if !((is_numpad && to.1 == 0 && from.0 == 0) || (!is_numpad && from.0 == 0 && to.1 == 1)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 69 - if !((is_numpad && to.1 == 0 && from.0 == 0) || (!is_numpad && from.0 == 0 && to.1 == 1)) { [INFO] [stdout] 69 + if !!(from.0 != 0 || is_numpad && to.1 != 0 || !is_numpad && to.1 != 1) { [INFO] [stdout] | [INFO] [stdout] 69 - if !((is_numpad && to.1 == 0 && from.0 == 0) || (!is_numpad && from.0 == 0 && to.1 == 1)) { [INFO] [stdout] 69 + if !(to.1 == 1 || is_numpad) && (to.1 == 0 || !is_numpad) && from.0 == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/14.rs:88:24 [INFO] [stdout] | [INFO] [stdout] 88 | fn detect_tree(robots: &Vec<(i32, i32)>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 88 - fn detect_tree(robots: &Vec<(i32, i32)>) -> bool { [INFO] [stdout] 88 + fn detect_tree(robots: &[(i32, i32)]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/21.rs:65:8 [INFO] [stdout] | [INFO] [stdout] 65 | if !((is_numpad && from.1 == 0 && to.0 == 0) || (!is_numpad && to.0 == 0 && from.1 == 1)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `to.0 != 0 || is_numpad && from.1 != 0 || !is_numpad && from.1 != 1` [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: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/bin/21.rs:53:40 [INFO] [stdout] | [INFO] [stdout] 53 | x_comp.extend(vec![Inst::Left; x_diff.abs() as usize]); [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `x_diff.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: this boolean expression can be simplified [INFO] [stdout] --> src/bin/21.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | if !((is_numpad && from.1 == 0 && to.0 == 0) || (!is_numpad && to.0 == 0 && from.1 == 1)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 65 - if !((is_numpad && from.1 == 0 && to.0 == 0) || (!is_numpad && to.0 == 0 && from.1 == 1)) { [INFO] [stdout] 65 + if !!(to.0 != 0 || is_numpad && from.1 != 0 || !is_numpad && from.1 != 1) { [INFO] [stdout] | [INFO] [stdout] 65 - if !((is_numpad && from.1 == 0 && to.0 == 0) || (!is_numpad && to.0 == 0 && from.1 == 1)) { [INFO] [stdout] 65 + if !(from.1 == 1 || is_numpad) && (from.1 == 0 || !is_numpad) && to.0 == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/bin/21.rs:58:40 [INFO] [stdout] | [INFO] [stdout] 58 | y_comp.extend(vec![Inst::Down; y_diff.abs() as usize]); [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `y_diff.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/21.rs:69:8 [INFO] [stdout] | [INFO] [stdout] 69 | if !((is_numpad && to.1 == 0 && from.0 == 0) || (!is_numpad && from.0 == 0 && to.1 == 1)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `from.0 != 0 || is_numpad && to.1 != 0 || !is_numpad && to.1 != 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/21.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | if !((is_numpad && to.1 == 0 && from.0 == 0) || (!is_numpad && from.0 == 0 && to.1 == 1)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 69 - if !((is_numpad && to.1 == 0 && from.0 == 0) || (!is_numpad && from.0 == 0 && to.1 == 1)) { [INFO] [stdout] 69 + if !!(from.0 != 0 || is_numpad && to.1 != 0 || !is_numpad && to.1 != 1) { [INFO] [stdout] | [INFO] [stdout] 69 - if !((is_numpad && to.1 == 0 && from.0 == 0) || (!is_numpad && from.0 == 0 && to.1 == 1)) { [INFO] [stdout] 69 + if !(to.1 == 1 || is_numpad) && (to.1 == 0 || !is_numpad) && from.0 == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/bin/21.rs:53:40 [INFO] [stdout] | [INFO] [stdout] 53 | x_comp.extend(vec![Inst::Left; x_diff.abs() as usize]); [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `x_diff.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/bin/21.rs:58:40 [INFO] [stdout] | [INFO] [stdout] 58 | y_comp.extend(vec![Inst::Down; y_diff.abs() as usize]); [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `y_diff.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: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:95:34 [INFO] [stdout] | [INFO] [stdout] 95 | Instruction::Bxl(val) => *reg_b = *reg_b ^ *val as u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*reg_b ^= *val as u64` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/bin/21.rs:100:13 [INFO] [stdout] | [INFO] [stdout] 100 | / match inst { [INFO] [stdout] 101 | | Inst::NumA => true, [INFO] [stdout] 102 | | Inst::Num(_) => true, [INFO] [stdout] 103 | | _ => false, [INFO] [stdout] 104 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 100 - match inst { [INFO] [stdout] 101 - Inst::NumA => true, [INFO] [stdout] 102 - Inst::Num(_) => true, [INFO] [stdout] 103 - _ => false, [INFO] [stdout] 104 - }, [INFO] [stdout] 100 + matches!(inst, Inst::NumA | Inst::Num(_)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:103:31 [INFO] [stdout] | [INFO] [stdout] 103 | Instruction::Bxc() => *reg_b = *reg_b ^ *reg_c, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*reg_b ^= *reg_c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/17.rs:127:12 [INFO] [stdout] | [INFO] [stdout] 127 | instr: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 127 - instr: &Vec, [INFO] [stdout] 127 + instr: &[Instruction], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/17.rs:176:10 [INFO] [stdout] | [INFO] [stdout] 176 | &prog_digits.iter().rev().map(|f| *f).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `prog_digits.iter().rev().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/bin/21.rs:100:13 [INFO] [stdout] | [INFO] [stdout] 100 | / match inst { [INFO] [stdout] 101 | | Inst::NumA => true, [INFO] [stdout] 102 | | Inst::Num(_) => true, [INFO] [stdout] 103 | | _ => false, [INFO] [stdout] 104 | | }, [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 100 - match inst { [INFO] [stdout] 101 - Inst::NumA => true, [INFO] [stdout] 102 - Inst::Num(_) => true, [INFO] [stdout] 103 - _ => false, [INFO] [stdout] 104 - }, [INFO] [stdout] 100 + matches!(inst, Inst::NumA | Inst::Num(_)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/16.rs:5:32 [INFO] [stdout] | [INFO] [stdout] 5 | fn parse_input(input: &str) -> ((usize, usize), (usize, usize), Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:20:25 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn is_safe(numbers: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 20 - pub fn is_safe(numbers: &Vec) -> bool { [INFO] [stdout] 20 + pub fn is_safe(numbers: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/16.rs:62:11 [INFO] [stdout] | [INFO] [stdout] 62 | grid: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 62 - grid: &Vec>, [INFO] [stdout] 62 + grid: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/16.rs:68:22 [INFO] [stdout] | [INFO] [stdout] 68 | let mut visited: Vec)>; 4]>> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:96:21 [INFO] [stdout] | [INFO] [stdout] 96 | visited[new_pos.0 as usize][new_pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ new_pos.0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:96:41 [INFO] [stdout] | [INFO] [stdout] 96 | visited[new_pos.0 as usize][new_pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `new_pos.1` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:108:25 [INFO] [stdout] | [INFO] [stdout] 108 | visited[new_pos.0 as usize][new_pos.1 as usize][direction as usize] = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ new_pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:108:45 [INFO] [stdout] | [INFO] [stdout] 108 | visited[new_pos.0 as usize][new_pos.1 as usize][direction as usize] = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `new_pos.1` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:135:44 [INFO] [stdout] | [INFO] [stdout] 135 | let original_sources = visited[pos.0 as usize][pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:135:60 [INFO] [stdout] | [INFO] [stdout] 135 | let original_sources = visited[pos.0 as usize][pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:140:50 [INFO] [stdout] | [INFO] [stdout] 140 | if let Some(ref mut other) = visited[pos.0 as usize][pos.1 as usize][dir as usize] { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:140:66 [INFO] [stdout] | [INFO] [stdout] 140 | if let Some(ref mut other) = visited[pos.0 as usize][pos.1 as usize][dir as usize] { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:156:29 [INFO] [stdout] | [INFO] [stdout] 156 | visited[pos.0 as usize][pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:156:45 [INFO] [stdout] | [INFO] [stdout] 156 | visited[pos.0 as usize][pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:154:25 [INFO] [stdout] | [INFO] [stdout] 154 | visited[pos.0 as usize][pos.1 as usize][dir as usize] = Some(( [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:154:41 [INFO] [stdout] | [INFO] [stdout] 154 | visited[pos.0 as usize][pos.1 as usize][dir as usize] = Some(( [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/16.rs:184:30 [INFO] [stdout] | [INFO] [stdout] 184 | let mut spaces_to_check: Vec<((usize, usize), Vec<(usize, usize)>)> = vec![( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/16.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / visited[end.0][end.1] [INFO] [stdout] 187 | | .iter() [INFO] [stdout] 188 | | .filter_map(|f| f.as_ref()) [INFO] [stdout] 189 | | .filter(|f| f.0 == best_score) [INFO] [stdout] 190 | | .flat_map(|f| f.1.iter()) [INFO] [stdout] 191 | | .map(|f| *f) [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] 186 ~ visited[end.0][end.1] [INFO] [stdout] 187 + .iter() [INFO] [stdout] 188 + .filter_map(|f| f.as_ref()) [INFO] [stdout] 189 + .filter(|f| f.0 == best_score) [INFO] [stdout] 190 + .flat_map(|f| f.1.iter()).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/12.rs:89:32 [INFO] [stdout] | [INFO] [stdout] 89 | let mut region_area_edges: HashMap; 4])> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/15.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | mapper: &dyn Fn(char, (usize, usize)) -> (Vec, Option<(usize, usize)>), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/15.rs:21:22 [INFO] [stdout] | [INFO] [stdout] 21 | .map(|(x, c)| match c { [INFO] [stdout] | ______________________^ [INFO] [stdout] 22 | | _ => { [INFO] [stdout] 23 | | let res = mapper(c, (y, x)); [INFO] [stdout] 24 | | if let Some(p) = res.1 { [INFO] [stdout] ... | [INFO] [stdout] 29 | | }) [INFO] [stdout] 30 | | .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] 21 ~ .flat_map(|(x, c)| match c { [INFO] [stdout] 22 + _ => { [INFO] [stdout] 23 + let res = mapper(c, (y, x)); [INFO] [stdout] 24 + if let Some(p) = res.1 { [INFO] [stdout] 25 + pos = p; [INFO] [stdout] 26 + } [INFO] [stdout] 27 + res.0 [INFO] [stdout] 28 + } [INFO] [stdout] 29 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> src/bin/15.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | .map(|(x, c)| match c { [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 22 | | _ => { [INFO] [stdout] 23 | | let res = mapper(c, (y, x)); [INFO] [stdout] 24 | | if let Some(p) = res.1 { [INFO] [stdout] ... | [INFO] [stdout] 29 | | }) [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using the match body instead [INFO] [stdout] | [INFO] [stdout] 21 ~ .map(|(x, c)| { [INFO] [stdout] 22 + let res = mapper(c, (y, x)); [INFO] [stdout] 23 + if let Some(p) = res.1 { [INFO] [stdout] 24 + pos = p; [INFO] [stdout] 25 + } [INFO] [stdout] 26 + res.0 [INFO] [stdout] 27 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:19:28 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn mapify_rules(rules: &Vec<(u32, u32)>) -> std::collections::HashMap> { [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] 19 - pub fn mapify_rules(rules: &Vec<(u32, u32)>) -> std::collections::HashMap> { [INFO] [stdout] 19 + pub fn mapify_rules(rules: &[(u32, u32)]) -> std::collections::HashMap> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/15.rs:84:14 [INFO] [stdout] | [INFO] [stdout] 84 | .map(|(y, r)| { [INFO] [stdout] | ______________^ [INFO] [stdout] 85 | | r.iter() [INFO] [stdout] 86 | | .enumerate() [INFO] [stdout] 87 | | .map(move |(x, c)| if let Tile::Box(_) = c { 100 * y + x } else { 0 }) [INFO] [stdout] 88 | | }) [INFO] [stdout] 89 | | .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] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 84 ~ .flat_map(|(y, r)| { [INFO] [stdout] 85 + r.iter() [INFO] [stdout] 86 + .enumerate() [INFO] [stdout] 87 + .map(move |(x, c)| if let Tile::Box(_) = c { 100 * y + x } else { 0 }) [INFO] [stdout] 88 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/bin/19.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | if target_pattern == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `target_pattern.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/15.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | mapper: &dyn Fn(char, (usize, usize)) -> (Vec, Option<(usize, usize)>), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/15.rs:145:21 [INFO] [stdout] | [INFO] [stdout] 145 | / if current_left != left { [INFO] [stdout] 146 | | move_delta(map, other, delta); [INFO] [stdout] 147 | | map[other.0][other.1] = Tile::Blank; [INFO] [stdout] 148 | | } [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] 144 ~ Tile::Box(current_left) [INFO] [stdout] 145 ~ if current_left != left => { [INFO] [stdout] 146 | move_delta(map, other, delta); [INFO] [stdout] 147 | map[other.0][other.1] = Tile::Blank; [INFO] [stdout] 148 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/15.rs:21:22 [INFO] [stdout] | [INFO] [stdout] 21 | .map(|(x, c)| match c { [INFO] [stdout] | ______________________^ [INFO] [stdout] 22 | | _ => { [INFO] [stdout] 23 | | let res = mapper(c, (y, x)); [INFO] [stdout] 24 | | if let Some(p) = res.1 { [INFO] [stdout] ... | [INFO] [stdout] 29 | | }) [INFO] [stdout] 30 | | .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] 21 ~ .flat_map(|(x, c)| match c { [INFO] [stdout] 22 + _ => { [INFO] [stdout] 23 + let res = mapper(c, (y, x)); [INFO] [stdout] 24 + if let Some(p) = res.1 { [INFO] [stdout] 25 + pos = p; [INFO] [stdout] 26 + } [INFO] [stdout] 27 + res.0 [INFO] [stdout] 28 + } [INFO] [stdout] 29 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> src/bin/15.rs:21:35 [INFO] [stdout] | [INFO] [stdout] 21 | .map(|(x, c)| match c { [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 22 | | _ => { [INFO] [stdout] 23 | | let res = mapper(c, (y, x)); [INFO] [stdout] 24 | | if let Some(p) = res.1 { [INFO] [stdout] ... | [INFO] [stdout] 29 | | }) [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using the match body instead [INFO] [stdout] | [INFO] [stdout] 21 ~ .map(|(x, c)| { [INFO] [stdout] 22 + let res = mapper(c, (y, x)); [INFO] [stdout] 23 + if let Some(p) = res.1 { [INFO] [stdout] 24 + pos = p; [INFO] [stdout] 25 + } [INFO] [stdout] 26 + res.0 [INFO] [stdout] 27 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/13.rs:4:56 [INFO] [stdout] | [INFO] [stdout] 4 | fn parse_input(input: &str, add_ten_trillion: bool) -> Vec<((u64, u64), (u64, u64), (u64, u64))> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/24.rs:46:32 [INFO] [stdout] | [INFO] [stdout] 46 | fn parse_input(input: &str) -> (HashMap, HashMap>>, u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should use the `starts_with` method [INFO] [stdout] --> src/bin/24.rs:70:12 [INFO] [stdout] | [INFO] [stdout] 70 | if output.chars().next().unwrap() == 'z' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `output.starts_with('z')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_next_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/15.rs:84:14 [INFO] [stdout] | [INFO] [stdout] 84 | .map(|(y, r)| { [INFO] [stdout] | ______________^ [INFO] [stdout] 85 | | r.iter() [INFO] [stdout] 86 | | .enumerate() [INFO] [stdout] 87 | | .map(move |(x, c)| if let Tile::Box(_) = c { 100 * y + x } else { 0 }) [INFO] [stdout] 88 | | }) [INFO] [stdout] 89 | | .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] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 84 ~ .flat_map(|(y, r)| { [INFO] [stdout] 85 + r.iter() [INFO] [stdout] 86 + .enumerate() [INFO] [stdout] 87 + .map(move |(x, c)| if let Tile::Box(_) = c { 100 * y + x } else { 0 }) [INFO] [stdout] 88 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/15.rs:185:14 [INFO] [stdout] | [INFO] [stdout] 185 | .map(|(y, r)| { [INFO] [stdout] | ______________^ [INFO] [stdout] 186 | | r.iter().enumerate().map(move |(x, c)| { [INFO] [stdout] 187 | | if let Tile::Box(left) = c { [INFO] [stdout] 188 | | if *left { [INFO] [stdout] ... | [INFO] [stdout] 197 | | }) [INFO] [stdout] 198 | | .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] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 185 ~ .flat_map(|(y, r)| { [INFO] [stdout] 186 + r.iter().enumerate().map(move |(x, c)| { [INFO] [stdout] 187 + if let Tile::Box(left) = c { [INFO] [stdout] 188 + if *left { [INFO] [stdout] 189 + 100 * y + x [INFO] [stdout] 190 + } else { [INFO] [stdout] 191 + 0 [INFO] [stdout] 192 + } [INFO] [stdout] 193 + } else { [INFO] [stdout] 194 + 0 [INFO] [stdout] 195 + } [INFO] [stdout] 196 + }) [INFO] [stdout] 197 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/bin/24.rs:75:14 [INFO] [stdout] | [INFO] [stdout] 75 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/bin/24.rs:79:14 [INFO] [stdout] | [INFO] [stdout] 79 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/24.rs:95:55 [INFO] [stdout] | [INFO] [stdout] 95 | .for_each(|gate| gate.process(&mut wires, &wire_to_gate)); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `wire_to_gate` [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: manual implementation of an assign operation [INFO] [stdout] --> src/bin/24.rs:105:13 [INFO] [stdout] | [INFO] [stdout] 105 | acc = acc | (if *value { 1 } else { 0 } << i); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `acc |= (if *value { 1 } else { 0 } << i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/15.rs:145:21 [INFO] [stdout] | [INFO] [stdout] 145 | / if current_left != left { [INFO] [stdout] 146 | | move_delta(map, other, delta); [INFO] [stdout] 147 | | map[other.0][other.1] = Tile::Blank; [INFO] [stdout] 148 | | } [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] 144 ~ Tile::Box(current_left) [INFO] [stdout] 145 ~ if current_left != left => { [INFO] [stdout] 146 | move_delta(map, other, delta); [INFO] [stdout] 147 | map[other.0][other.1] = Tile::Blank; [INFO] [stdout] 148 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/bin/25.rs:10:34 [INFO] [stdout] | [INFO] [stdout] 10 | .map(|c| (c == '#')) [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 10 - .map(|c| (c == '#')) [INFO] [stdout] 10 + .map(|c| c == '#' ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/15.rs:185:14 [INFO] [stdout] | [INFO] [stdout] 185 | .map(|(y, r)| { [INFO] [stdout] | ______________^ [INFO] [stdout] 186 | | r.iter().enumerate().map(move |(x, c)| { [INFO] [stdout] 187 | | if let Tile::Box(left) = c { [INFO] [stdout] 188 | | if *left { [INFO] [stdout] ... | [INFO] [stdout] 197 | | }) [INFO] [stdout] 198 | | .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] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 185 ~ .flat_map(|(y, r)| { [INFO] [stdout] 186 + r.iter().enumerate().map(move |(x, c)| { [INFO] [stdout] 187 + if let Tile::Box(left) = c { [INFO] [stdout] 188 + if *left { [INFO] [stdout] 189 + 100 * y + x [INFO] [stdout] 190 + } else { [INFO] [stdout] 191 + 0 [INFO] [stdout] 192 + } [INFO] [stdout] 193 + } else { [INFO] [stdout] 194 + 0 [INFO] [stdout] 195 + } [INFO] [stdout] 196 + }) [INFO] [stdout] 197 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/bin/24.rs:118:21 [INFO] [stdout] | [INFO] [stdout] 118 | let parts = vec![0b00, 0b01, 0b10, 0b11]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[0b00, 0b01, 0b10, 0b11]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/02.rs:20:25 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn is_safe(numbers: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 20 - pub fn is_safe(numbers: &Vec) -> bool { [INFO] [stdout] 20 + pub fn is_safe(numbers: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `piece` [INFO] [stdout] --> src/bin/25.rs:26:26 [INFO] [stdout] | [INFO] [stdout] 26 | for y in 1..7 { [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] 26 - for y in 1..7 { [INFO] [stdout] 26 + for (y, ) in piece.iter().enumerate().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/bin/25.rs:10:34 [INFO] [stdout] | [INFO] [stdout] 10 | .map(|c| (c == '#')) [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 10 - .map(|c| (c == '#')) [INFO] [stdout] 10 + .map(|c| c == '#' ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:114:25 [INFO] [stdout] | [INFO] [stdout] 114 | direction: direction, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `direction` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:164:25 [INFO] [stdout] | [INFO] [stdout] 164 | pos: pos, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | return (start_position, positions); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return (start_position, positions); [INFO] [stdout] 30 + (start_position, positions) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/06.rs:66:11 [INFO] [stdout] | [INFO] [stdout] 66 | grid: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 66 - grid: &Vec>, [INFO] [stdout] 66 + grid: &[Vec], [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/bin/06.rs:95:11 [INFO] [stdout] | [INFO] [stdout] 95 | grid: &mut Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 95 - grid: &mut Vec>, [INFO] [stdout] 95 + grid: &mut [Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `piece` [INFO] [stdout] --> src/bin/25.rs:26:26 [INFO] [stdout] | [INFO] [stdout] 26 | for y in 1..7 { [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] 26 - for y in 1..7 { [INFO] [stdout] 26 + for (y, ) in piece.iter().enumerate().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/20.rs:7:32 [INFO] [stdout] | [INFO] [stdout] 7 | fn parse_input(input: &str) -> ((usize, usize), (usize, usize), Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/20.rs:49:11 [INFO] [stdout] | [INFO] [stdout] 49 | grid: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 49 - grid: &Vec>, [INFO] [stdout] 49 + grid: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/20.rs:51:14 [INFO] [stdout] | [INFO] [stdout] 51 | visited: &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] 51 - visited: &Vec>, [INFO] [stdout] 51 + visited: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/20.rs:70:21 [INFO] [stdout] | [INFO] [stdout] 70 | no_cheat_times: &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] 70 - no_cheat_times: &Vec>>, [INFO] [stdout] 70 + no_cheat_times: &[Vec>], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/20.rs:87:17 [INFO] [stdout] | [INFO] [stdout] 87 | / if x < grid[0].len() && y < grid.len() { [INFO] [stdout] 88 | | if grid[y][x] != '#' { [INFO] [stdout] 89 | | if let Some(target_time) = no_cheat_times[y][x] { [INFO] [stdout] 90 | | let total = dx.abs() + dy.abs() + target_time as i32; [INFO] [stdout] ... | [INFO] [stdout] 99 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 87 ~ if x < grid[0].len() && y < grid.len() [INFO] [stdout] 88 ~ && grid[y][x] != '#' { [INFO] [stdout] 89 | if let Some(target_time) = no_cheat_times[y][x] { [INFO] [stdout] ... [INFO] [stdout] 97 | } [INFO] [stdout] 98 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/20.rs:103:32 [INFO] [stdout] | [INFO] [stdout] 103 | current_pos = get_next(&grid, current_pos, &visited); [INFO] [stdout] | ^^^^^ help: change this to: `grid` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/08.rs:5:32 [INFO] [stdout] | [INFO] [stdout] 5 | fn parse_input(input: &str) -> (usize, usize, hash_map::HashMap>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/09.rs:91:33 [INFO] [stdout] | [INFO] [stdout] 91 | fn print_file_element_str(data: &Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 91 - fn print_file_element_str(data: &Vec) { [INFO] [stdout] 91 + fn print_file_element_str(data: &[FileElement]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/16.rs:5:32 [INFO] [stdout] | [INFO] [stdout] 5 | fn parse_input(input: &str) -> ((usize, usize), (usize, usize), Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/16.rs:62:11 [INFO] [stdout] | [INFO] [stdout] 62 | grid: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 62 - grid: &Vec>, [INFO] [stdout] 62 + grid: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/16.rs:68:22 [INFO] [stdout] | [INFO] [stdout] 68 | let mut visited: Vec)>; 4]>> = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:96:21 [INFO] [stdout] | [INFO] [stdout] 96 | visited[new_pos.0 as usize][new_pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ new_pos.0 }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:96:41 [INFO] [stdout] | [INFO] [stdout] 96 | visited[new_pos.0 as usize][new_pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `new_pos.1` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:108:25 [INFO] [stdout] | [INFO] [stdout] 108 | visited[new_pos.0 as usize][new_pos.1 as usize][direction as usize] = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `{ new_pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:108:45 [INFO] [stdout] | [INFO] [stdout] 108 | visited[new_pos.0 as usize][new_pos.1 as usize][direction as usize] = [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `new_pos.1` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/24.rs:46:32 [INFO] [stdout] | [INFO] [stdout] 46 | fn parse_input(input: &str) -> (HashMap, HashMap>>, u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:135:44 [INFO] [stdout] | [INFO] [stdout] 135 | let original_sources = visited[pos.0 as usize][pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:135:60 [INFO] [stdout] | [INFO] [stdout] 135 | let original_sources = visited[pos.0 as usize][pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:140:50 [INFO] [stdout] | [INFO] [stdout] 140 | if let Some(ref mut other) = visited[pos.0 as usize][pos.1 as usize][dir as usize] { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:140:66 [INFO] [stdout] | [INFO] [stdout] 140 | if let Some(ref mut other) = visited[pos.0 as usize][pos.1 as usize][dir as usize] { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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: you should use the `starts_with` method [INFO] [stdout] --> src/bin/24.rs:70:12 [INFO] [stdout] | [INFO] [stdout] 70 | if output.chars().next().unwrap() == 'z' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `output.starts_with('z')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_next_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_next_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:156:29 [INFO] [stdout] | [INFO] [stdout] 156 | visited[pos.0 as usize][pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ pos.0 }` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:156:45 [INFO] [stdout] | [INFO] [stdout] 156 | visited[pos.0 as usize][pos.1 as usize][direction as usize] [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/bin/24.rs:75:14 [INFO] [stdout] | [INFO] [stdout] 75 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:154:25 [INFO] [stdout] | [INFO] [stdout] 154 | visited[pos.0 as usize][pos.1 as usize][dir as usize] = Some(( [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `{ pos.0 }` [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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/bin/24.rs:79:14 [INFO] [stdout] | [INFO] [stdout] 79 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/bin/16.rs:154:41 [INFO] [stdout] | [INFO] [stdout] 154 | visited[pos.0 as usize][pos.1 as usize][dir as usize] = Some(( [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `pos.1` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/16.rs:184:30 [INFO] [stdout] | [INFO] [stdout] 184 | let mut spaces_to_check: Vec<((usize, usize), Vec<(usize, usize)>)> = vec![( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/24.rs:95:55 [INFO] [stdout] | [INFO] [stdout] 95 | .for_each(|gate| gate.process(&mut wires, &wire_to_gate)); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `wire_to_gate` [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: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/16.rs:186:9 [INFO] [stdout] | [INFO] [stdout] 186 | / visited[end.0][end.1] [INFO] [stdout] 187 | | .iter() [INFO] [stdout] 188 | | .filter_map(|f| f.as_ref()) [INFO] [stdout] 189 | | .filter(|f| f.0 == best_score) [INFO] [stdout] 190 | | .flat_map(|f| f.1.iter()) [INFO] [stdout] 191 | | .map(|f| *f) [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] 186 ~ visited[end.0][end.1] [INFO] [stdout] 187 + .iter() [INFO] [stdout] 188 + .filter_map(|f| f.as_ref()) [INFO] [stdout] 189 + .filter(|f| f.0 == best_score) [INFO] [stdout] 190 + .flat_map(|f| f.1.iter()).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/24.rs:105:13 [INFO] [stdout] | [INFO] [stdout] 105 | acc = acc | (if *value { 1 } else { 0 } << i); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `acc |= (if *value { 1 } else { 0 } << i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/bin/24.rs:118:21 [INFO] [stdout] | [INFO] [stdout] 118 | let parts = vec![0b00, 0b01, 0b10, 0b11]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[0b00, 0b01, 0b10, 0b11]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.51s [INFO] running `Command { std: "docker" "inspect" "c465a3ca6b1197fb14624e550eca4f9fd5b81badd97e1c2de5780cedd49d9e2c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c465a3ca6b1197fb14624e550eca4f9fd5b81badd97e1c2de5780cedd49d9e2c", kill_on_drop: false }` [INFO] [stdout] c465a3ca6b1197fb14624e550eca4f9fd5b81badd97e1c2de5780cedd49d9e2c