[INFO] cloning repository https://github.com/aziegler/aoc2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/aziegler/aoc2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faziegler%2Faoc2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faziegler%2Faoc2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c2aaaddeae9a610c75c1ce7dbba9a5950603506e [INFO] linting aziegler/aoc2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faziegler%2Faoc2024" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-0-tc1/source/.cargo/config.toml [INFO] started tweaking git repo https://github.com/aziegler/aoc2024 [INFO] finished tweaking git repo https://github.com/aziegler/aoc2024 [INFO] tweaked toml for git repo https://github.com/aziegler/aoc2024 written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/aziegler/aoc2024 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/aziegler/aoc2024 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 codspeed v2.7.2 [INFO] [stderr] Downloaded codspeed-criterion-compat v2.7.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] ffb53065ab3d74df91fdd3173077b8b5e707fefc9a214ef8925958c93fafb905 [INFO] running `Command { std: "docker" "start" "-a" "ffb53065ab3d74df91fdd3173077b8b5e707fefc9a214ef8925958c93fafb905", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "ffb53065ab3d74df91fdd3173077b8b5e707fefc9a214ef8925958c93fafb905", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ffb53065ab3d74df91fdd3173077b8b5e707fefc9a214ef8925958c93fafb905", kill_on_drop: false }` [INFO] [stdout] ffb53065ab3d74df91fdd3173077b8b5e707fefc9a214ef8925958c93fafb905 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 3fb58dab3053382035e8fc89f42319d19ab5c3b329aa02a1fa869c0323830025 [INFO] running `Command { std: "docker" "start" "-a" "3fb58dab3053382035e8fc89f42319d19ab5c3b329aa02a1fa869c0323830025", kill_on_drop: false }` [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking memchr v2.6.4 [INFO] [stderr] Checking either v1.13.0 [INFO] [stderr] Compiling proc-macro2 v1.0.92 [INFO] [stderr] Compiling serde v1.0.215 [INFO] [stderr] Compiling serde_json v1.0.133 [INFO] [stderr] Compiling libc v0.2.150 [INFO] [stderr] Checking half v2.4.1 [INFO] [stderr] Checking rayon v1.10.0 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Checking clap_lex v0.7.3 [INFO] [stderr] Checking clap_builder v4.5.21 [INFO] [stderr] Checking ciborium-ll v0.2.2 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Checking colored v2.1.0 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Checking num-complex v0.4.6 [INFO] [stderr] Compiling quote v1.0.37 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Checking num-iter v0.1.45 [INFO] [stderr] Compiling syn v2.0.90 [INFO] [stderr] Checking criterion-plot v0.5.0 [INFO] [stderr] Checking plotters v0.3.7 [INFO] [stderr] Checking is-terminal v0.4.13 [INFO] [stderr] Checking oorandom v11.1.4 [INFO] [stderr] Compiling codspeed-criterion-compat v2.7.2 [INFO] [stderr] Checking clap v4.5.21 [INFO] [stderr] Checking num-rational v0.4.2 [INFO] [stderr] Checking num v0.4.3 [INFO] [stderr] Checking advent_of_code v0.11.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs: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: unused imports: `cmp::min` and `usize::MAX` [INFO] [stdout] --> src/bin/13.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cmp::min, usize::MAX}; [INFO] [stdout] | ^^^^^^^^ ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/13.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | a: a, [INFO] [stdout] | ^^^^ help: replace it with: `a` [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/13.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | b: b, [INFO] [stdout] | ^^^^ help: replace it with: `b` [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: redundant field names in struct initialization [INFO] [stdout] --> src/bin/13.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | prize: prize, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `prize` [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: unused import: `HashSet` [INFO] [stdout] --> src/bin/19.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ops::BitXor` [INFO] [stdout] --> src/bin/22.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | ops::BitXor, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `for` iterator expression [INFO] [stdout] --> src/bin/22.rs:43:14 [INFO] [stdout] | [INFO] [stdout] 43 | for i in (0..3) { [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] 43 - for i in (0..3) { [INFO] [stdout] 43 + for i in 0..3 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `for` iterator expression [INFO] [stdout] --> src/bin/22.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 49 | for i in (3..iteration) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 49 - for i in (3..iteration) { [INFO] [stdout] 49 + for i in 3..iteration { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `vec.get(0)` [INFO] [stdout] --> src/bin/04.rs:7:63 [INFO] [stdout] | [INFO] [stdout] 7 | let starting_points = (0..vec.len()).cartesian_product(0..vec.get(0).unwrap().len()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `vec.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `vec.get(0)` [INFO] [stdout] --> src/bin/04.rs:23:63 [INFO] [stdout] | [INFO] [stdout] 23 | let starting_points = (0..vec.len()).cartesian_product(0..vec.get(0).unwrap().len()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `vec.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/04.rs:37:22 [INFO] [stdout] | [INFO] [stdout] 37 | pub fn access(input: &Vec>, i: usize, j: usize) -> char { [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] 37 - pub fn access(input: &Vec>, i: usize, j: usize) -> char { [INFO] [stdout] 37 + pub fn access(input: &[Vec], i: usize, j: usize) -> char { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/bin/04.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | / input [INFO] [stdout] 39 | | .get(i) [INFO] [stdout] 40 | | .unwrap_or(&vec![' ']) [INFO] [stdout] 41 | | .get(j) [INFO] [stdout] 42 | | .unwrap_or(&' ') [INFO] [stdout] 43 | | .clone() [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 38 ~ *input [INFO] [stdout] 39 + .get(i) [INFO] [stdout] 40 + .unwrap_or(&vec![' ']) [INFO] [stdout] 41 + .get(j) [INFO] [stdout] 42 + .unwrap_or(&' ') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/bin/04.rs:49:27 [INFO] [stdout] | [INFO] [stdout] 49 | u.overflowing_sub(i.abs() as usize).0 [INFO] [stdout] | ^^^^^^^ help: replace with: `i.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/04.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | return (diag_1 == vec!['M', 'S']) && (diag_2 == vec!['M', 'S']); [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] 71 - return (diag_1 == vec!['M', 'S']) && (diag_2 == vec!['M', 'S']); [INFO] [stdout] 71 + (diag_1 == vec!['M', 'S']) && (diag_2 == vec!['M', 'S']) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/04.rs:86:12 [INFO] [stdout] | [INFO] [stdout] 86 | if !(*to_test.get(idx as usize).unwrap() == access(input, i, j)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*to_test.get(idx as usize).unwrap() != access(input, i, j))` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/04.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 91 - return true; [INFO] [stdout] 91 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `init_secret` [INFO] [stdout] --> src/bin/22.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | let init_secret = secret; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_init_secret` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/19.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 82 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/22.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | for i in (0..3) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/22.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | for i in (3..iteration) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/22.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | u128, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `u128::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/bin/22.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / let _ = input_numbers.for_each(|c| { [INFO] [stdout] 21 | | compute_iter(c, 2000, values); [INFO] [stdout] 22 | | }); [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 20 - let _ = input_numbers.for_each(|c| { [INFO] [stdout] 20 + input_numbers.for_each(|c| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/19.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | return finishes; [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] 59 - return finishes; [INFO] [stdout] 59 + finishes [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/22.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [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/22.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/22.rs:75:5 [INFO] [stdout] | [INFO] [stdout] 75 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/19.rs:37:30 [INFO] [stdout] | [INFO] [stdout] 37 | let next = sub_trie.get(&word.chars().nth(0).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `word.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:50:57 [INFO] [stdout] | [INFO] [stdout] 50 | let finishes = recursive_find(s, &next_node.childs, &whole_trie, eliminated); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `whole_trie` [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: length comparison to zero [INFO] [stdout] --> src/bin/19.rs:63:8 [INFO] [stdout] | [INFO] [stdout] 63 | if word.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `word.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/19.rs:67:24 [INFO] [stdout] | [INFO] [stdout] 67 | let first_letter = word.chars().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `word.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:70:9 [INFO] [stdout] | [INFO] [stdout] 70 | / &mut current_node.childs.entry(first_letter).or_insert(TrieNode { [INFO] [stdout] 71 | | is_end: false, [INFO] [stdout] 72 | | childs: HashMap::new(), [INFO] [stdout] 73 | | }), [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 70 ~ current_node.childs.entry(first_letter).or_insert(TrieNode { [INFO] [stdout] 71 + is_end: false, [INFO] [stdout] 72 + childs: HashMap::new(), [INFO] [stdout] 73 ~ }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing a legacy numeric constant [INFO] [stdout] --> src/bin/13.rs:1:21 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cmp::min, usize::MAX}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import and use the associated constant `usize::MAX` from the primitive type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/bin/13.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 23 | .filter(|c| c.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 24 | | .map(|c| c.unwrap()) [INFO] [stdout] | |________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/03.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | if input.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `input.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/03.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | if input.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `input.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/bin/13.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | .filter(|c| c.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 42 | | .map(|c| c.unwrap()) [INFO] [stdout] | |________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/13.rs:66:5 [INFO] [stdout] | [INFO] [stdout] 66 | / return Ok(( [INFO] [stdout] 67 | | rem, [INFO] [stdout] 68 | | ClawMachine { [INFO] [stdout] 69 | | a: a, [INFO] [stdout] ... | [INFO] [stdout] 72 | | }, [INFO] [stdout] 73 | | )); [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] 66 ~ Ok(( [INFO] [stdout] 67 + rem, [INFO] [stdout] 68 + ClawMachine { [INFO] [stdout] 69 + a: a, [INFO] [stdout] 70 + b: b, [INFO] [stdout] 71 + prize: prize, [INFO] [stdout] 72 + }, [INFO] [stdout] 73 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `match` scrutinee expression [INFO] [stdout] --> src/bin/16.rs:14:38 [INFO] [stdout] | [INFO] [stdout] 14 | .map(|(x, ch)| match (ch) { [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] 14 - .map(|(x, ch)| match (ch) { [INFO] [stdout] 14 + .map(|(x, ch)| match ch { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:76:17 [INFO] [stdout] | [INFO] [stdout] 76 | deer: deer, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `deer` [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: unneeded late initialization [INFO] [stdout] --> src/bin/11.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 45 | let result; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `result` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 45 ~ [INFO] [stdout] 46 ~ let result = if digit_count % 2 == 0 { [INFO] [stdout] 47 | let k1 = value / 10u64.pow((digit_count / 2) as u32); [INFO] [stdout] 48 | let k2 = value % 10u64.pow((digit_count / 2) as u32); [INFO] [stdout] 49 ~ with_memo(k1, step - 1, &mut memo) + with_memo(k2, step - 1, &mut memo) [INFO] [stdout] 50 | } else { [INFO] [stdout] 51 ~ with_memo(value * 2024, step - 1, &mut memo) [INFO] [stdout] 52 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/11.rs:46:8 [INFO] [stdout] | [INFO] [stdout] 46 | if digit_count % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `digit_count.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/11.rs:49:42 [INFO] [stdout] | [INFO] [stdout] 49 | result = with_memo(k1, step - 1, &mut memo) + with_memo(k2, step - 1, &mut memo); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `memo` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/11.rs:49:79 [INFO] [stdout] | [INFO] [stdout] 49 | result = with_memo(k1, step - 1, &mut memo) + with_memo(k2, step - 1, &mut memo); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `memo` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/11.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | result = with_memo(value * 2024, step - 1, &mut memo) [INFO] [stdout] | ^^^^^^^^^ help: change this to: `memo` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/14.rs:25:12 [INFO] [stdout] | [INFO] [stdout] 25 | if (mean_variation.0 < 30 && mean_variation.1 < 30) { [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] 25 - if (mean_variation.0 < 30 && mean_variation.1 < 30) { [INFO] [stdout] 25 + if mean_variation.0 < 30 && mean_variation.1 < 30 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/14.rs:111:8 [INFO] [stdout] | [INFO] [stdout] 111 | if (return_val < 0 || return_val >= bound as isize) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 111 - if (return_val < 0 || return_val >= bound as isize) { [INFO] [stdout] 111 + if return_val < 0 || return_val >= bound as isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/11.rs:64:16 [INFO] [stdout] | [INFO] [stdout] 64 | if digit_count % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `digit_count.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/11.rs:77:20 [INFO] [stdout] | [INFO] [stdout] 77 | pub fn step(state: &mut Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 77 - pub fn step(state: &mut Vec) -> Vec { [INFO] [stdout] 77 + pub fn step(state: &mut [u64]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/11.rs:80:10 [INFO] [stdout] | [INFO] [stdout] 80 | .map(|s| { [INFO] [stdout] | __________^ [INFO] [stdout] 81 | | let mut vec = Vec::new(); [INFO] [stdout] 82 | | if *s == 0 { [INFO] [stdout] 83 | | vec.push(1); [INFO] [stdout] ... | [INFO] [stdout] 102 | | }) [INFO] [stdout] 103 | | .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] 80 ~ .flat_map(|s| { [INFO] [stdout] 81 + let mut vec = Vec::new(); [INFO] [stdout] 82 + if *s == 0 { [INFO] [stdout] 83 + vec.push(1); [INFO] [stdout] 84 + return vec; [INFO] [stdout] 85 + } [INFO] [stdout] 86 + let string_value = s.to_string(); [INFO] [stdout] 87 + if string_value.len() % 2 == 0 { [INFO] [stdout] 88 + vec.push( [INFO] [stdout] 89 + string_value[0..string_value.len() / 2] [INFO] [stdout] 90 + .parse::() [INFO] [stdout] 91 + .unwrap(), [INFO] [stdout] 92 + ); [INFO] [stdout] 93 + vec.push( [INFO] [stdout] 94 + string_value[string_value.len() / 2..] [INFO] [stdout] 95 + .parse::() [INFO] [stdout] 96 + .unwrap(), [INFO] [stdout] 97 + ); [INFO] [stdout] 98 + return vec; [INFO] [stdout] 99 + } [INFO] [stdout] 100 + vec.push(s * 2024); [INFO] [stdout] 101 + return vec; [INFO] [stdout] 102 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/11.rs:101:13 [INFO] [stdout] | [INFO] [stdout] 101 | return vec; [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] 101 - return vec; [INFO] [stdout] 101 + vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/16.rs:39:17 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:17:38 [INFO] [stdout] | [INFO] [stdout] 17 | start_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:17:58 [INFO] [stdout] | [INFO] [stdout] 17 | start_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:21:36 [INFO] [stdout] | [INFO] [stdout] 21 | end_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:21:56 [INFO] [stdout] | [INFO] [stdout] 21 | end_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `isize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:50:24 [INFO] [stdout] | [INFO] [stdout] 50 | let distance = dist.get(&deer_pos).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*dist.get(&deer_pos).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `match` scrutinee expression [INFO] [stdout] --> src/bin/20.rs:17:38 [INFO] [stdout] | [INFO] [stdout] 17 | .map(|(x, ch)| match (ch) { [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] 17 - .map(|(x, ch)| match (ch) { [INFO] [stdout] 17 + .map(|(x, ch)| match ch { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/bin/16.rs:184:1 [INFO] [stdout] | [INFO] [stdout] 184 | / impl PartialOrd for Node { [INFO] [stdout] 185 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 186 | | other.cost.partial_cmp(&self.cost) [INFO] [stdout] 187 | | } [INFO] [stdout] 188 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 185 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 186 - other.cost.partial_cmp(&self.cost) [INFO] [stdout] 187 - } [INFO] [stdout] 185 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/14.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `collections::HashMap` and `usize::MAX` [INFO] [stdout] --> src/bin/05.rs:1:26 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cmp::Ordering, collections::HashMap, usize::MAX}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `newline` [INFO] [stdout] --> src/bin/05.rs:5:48 [INFO] [stdout] | [INFO] [stdout] 5 | character::complete::{digit1, line_ending, newline}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> src/bin/08.rs:24:16 [INFO] [stdout] | [INFO] [stdout] 24 | .map(|(c, locs)| { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/14.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | return (sum.0 / robots.len(), sum.1 / robots.len()); [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] 50 - return (sum.0 / robots.len(), sum.1 / robots.len()); [INFO] [stdout] 50 + (sum.0 / robots.len(), sum.1 / robots.len()) [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:44:31 [INFO] [stdout] | [INFO] [stdout] 44 | pub fn mean_variation(robots: &Vec) -> (usize, usize) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - pub fn mean_variation(robots: &Vec) -> (usize, usize) { [INFO] [stdout] 44 + pub fn mean_variation(robots: &[Robot]) -> (usize, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | return (true, v[0] - v[1]); [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] 28 - return (true, v[0] - v[1]); [INFO] [stdout] 28 + (true, v[0] - v[1]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing a legacy numeric constant [INFO] [stdout] --> src/bin/08.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | usize::MAX, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import and use the associated constant `usize::MAX` from the primitive type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/14.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | pub fn display(robots: &Vec, field_size: (usize, usize)) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 60 - pub fn display(robots: &Vec, field_size: (usize, usize)) -> String { [INFO] [stdout] 60 + pub fn display(robots: &[Robot], field_size: (usize, usize)) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/bin/14.rs:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | map_vis.push_str("."); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `map_vis.push('.')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/14.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | return quadrants[0] * quadrants[1] * quadrants[2] * quadrants[3]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 95 - return quadrants[0] * quadrants[1] * quadrants[2] * quadrants[3]; [INFO] [stdout] 95 + quadrants[0] * quadrants[1] * quadrants[2] * quadrants[3] [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:76:22 [INFO] [stdout] | [INFO] [stdout] 76 | pub fn score(robots: &Vec, field_size: (usize, usize)) -> isize { [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] 76 - pub fn score(robots: &Vec, field_size: (usize, usize)) -> isize { [INFO] [stdout] 76 + pub fn score(robots: &[Robot], field_size: (usize, usize)) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/02.rs:43:23 [INFO] [stdout] | [INFO] [stdout] 43 | input.lines().map(|l| parse_line(l)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/08.rs:24:10 [INFO] [stdout] | [INFO] [stdout] 24 | .map(|(c, locs)| { [INFO] [stdout] | __________^ [INFO] [stdout] 25 | | let set: HashSet<(usize, usize)> = locs [INFO] [stdout] 26 | | .iter() [INFO] [stdout] 27 | | .combinations(2) [INFO] [stdout] ... | [INFO] [stdout] 35 | | }) [INFO] [stdout] 36 | | .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] 24 ~ .flat_map(|(c, locs)| { [INFO] [stdout] 25 + let set: HashSet<(usize, usize)> = locs [INFO] [stdout] 26 + .iter() [INFO] [stdout] 27 + .combinations(2) [INFO] [stdout] 28 + .flat_map(|v| { [INFO] [stdout] 29 + let a1 = v.get(0).unwrap(); [INFO] [stdout] 30 + let a2 = v.get(1).unwrap(); [INFO] [stdout] 31 + find_antinodes(**a1, **a2, field.size, part_one) [INFO] [stdout] 32 + }) [INFO] [stdout] 33 + .collect(); [INFO] [stdout] 34 + set [INFO] [stdout] 35 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `v.get(0)` [INFO] [stdout] --> src/bin/08.rs:29:30 [INFO] [stdout] | [INFO] [stdout] 29 | let a1 = v.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^ help: try: `v.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/bin/08.rs:52:63 [INFO] [stdout] | [INFO] [stdout] 52 | (limits.0).checked_div(x2.abs_diff(x1)).unwrap_or(MAX), [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 52 | (limits.0).checked_div(x2.abs_diff(x1)).unwrap_or(usize::MAX), [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/bin/08.rs:53:63 [INFO] [stdout] | [INFO] [stdout] 53 | (limits.1).checked_div(y2.abs_diff(y2)).unwrap_or(MAX), [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 53 | (limits.1).checked_div(y2.abs_diff(y2)).unwrap_or(usize::MAX), [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/08.rs:82:12 [INFO] [stdout] | [INFO] [stdout] 82 | if line.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/bin/08.rs:92:22 [INFO] [stdout] | [INFO] [stdout] 92 | .or_insert(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: unused variable: `input` [INFO] [stdout] --> src/bin/20.rs:90:17 [INFO] [stdout] | [INFO] [stdout] 90 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:20:38 [INFO] [stdout] | [INFO] [stdout] 20 | start_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:20:58 [INFO] [stdout] | [INFO] [stdout] 20 | start_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:24:36 [INFO] [stdout] | [INFO] [stdout] 24 | end_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:24:56 [INFO] [stdout] | [INFO] [stdout] 24 | end_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/bin/01.rs:15:43 [INFO] [stdout] | [INFO] [stdout] 15 | .fold(0, |acc, (left, right)| (acc + abs(left - right))), [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] 15 - .fold(0, |acc, (left, right)| (acc + abs(left - right))), [INFO] [stdout] 15 + .fold(0, |acc, (left, right)| acc + abs(left - right) ), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `maze.get(0)` [INFO] [stdout] --> src/bin/20.rs:47:42 [INFO] [stdout] | [INFO] [stdout] 47 | && ((p.pos.0 as usize) < maze.get(0).unwrap().len()) [INFO] [stdout] | ^^^^^^^^^^^ help: try: `maze.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/bin/20.rs:64:48 [INFO] [stdout] | [INFO] [stdout] 64 | let walls: usize = new_maze.iter().flat_map(|c| c).filter(|d| **d).count(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [INFO] [stdout] = note: `#[warn(clippy::flat_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/bin/20.rs:65:49 [INFO] [stdout] | [INFO] [stdout] 65 | let init_walls: usize = maze.iter().flat_map(|c| c).filter(|d| **d).count(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [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:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | &new_maze, [INFO] [stdout] | ^^^^^^^^^ help: change this to: `new_maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/20.rs:95:11 [INFO] [stdout] | [INFO] [stdout] 95 | maze: &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] 95 - maze: &Vec>, [INFO] [stdout] 95 + maze: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `isize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:109:24 [INFO] [stdout] | [INFO] [stdout] 109 | let distance = dist.get(&pos).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*dist.get(&pos).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `possible_pos` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/09.rs:41:34 [INFO] [stdout] | [INFO] [stdout] 40 | if possible_pos.is_some() && possible_pos.unwrap().1.begin < current_slot.begin { [INFO] [stdout] | ---------------------- the check is happening here [INFO] [stdout] 41 | let (idx, new_pos) = possible_pos.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `remaining_space` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/09.rs:57:39 [INFO] [stdout] | [INFO] [stdout] 56 | if remaining_space.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = remaining_space` [INFO] [stdout] 57 | freespace.insert(idx, remaining_space.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/09.rs:64:33 [INFO] [stdout] | [INFO] [stdout] 64 | fn find_possible_pos(freespace: &Vec, size: u32) -> Option<(usize, &DiskSlot)> { [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] 64 - fn find_possible_pos(freespace: &Vec, size: u32) -> Option<(usize, &DiskSlot)> { [INFO] [stdout] 64 + fn find_possible_pos(freespace: &[DiskSlot], size: u32) -> Option<(usize, &DiskSlot)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/09.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | current_idx = current_idx + count; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `current_idx += count` [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: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/bin/20.rs:180:1 [INFO] [stdout] | [INFO] [stdout] 180 | / impl PartialOrd for Node { [INFO] [stdout] 181 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 182 | | other.cost.partial_cmp(&self.cost) [INFO] [stdout] 183 | | } [INFO] [stdout] 184 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 181 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 182 - other.cost.partial_cmp(&self.cost) [INFO] [stdout] 183 - } [INFO] [stdout] 181 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing a legacy numeric constant [INFO] [stdout] --> src/bin/05.rs:1:48 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cmp::Ordering, collections::HashMap, usize::MAX}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import and use the associated constant `usize::MAX` from the primitive type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/05.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | .map(|x| take_middle(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `take_middle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/06.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | board: board, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `board` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:39:27 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn take_middle(input: &Vec) -> u32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - pub fn take_middle(input: &Vec) -> u32 { [INFO] [stdout] 39 + pub fn take_middle(input: &[u32]) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:44:27 [INFO] [stdout] | [INFO] [stdout] 44 | pub fn check_issue(issue: &Vec, rules: Vec<(u32, u32)>) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - pub fn check_issue(issue: &Vec, rules: Vec<(u32, u32)>) -> bool { [INFO] [stdout] 44 + pub fn check_issue(issue: &[u32], rules: Vec<(u32, u32)>) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `newline` [INFO] [stdout] --> src/bin/07.rs:5:48 [INFO] [stdout] | [INFO] [stdout] 5 | character::complete::{digit1, line_ending, newline}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:113:17 [INFO] [stdout] | [INFO] [stdout] 113 | result: result, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `result` [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/07.rs:114:17 [INFO] [stdout] | [INFO] [stdout] 114 | inputs: inputs, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `inputs` [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/05.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return Ordering::Greater; [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] 67 - return Ordering::Greater; [INFO] [stdout] 67 + Ordering::Greater [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:62:37 [INFO] [stdout] | [INFO] [stdout] 62 | pub fn order(a: u32, b: u32, rules: &Vec<(u32, u32)>) -> Ordering { [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] 62 - pub fn order(a: u32, b: u32, rules: &Vec<(u32, u32)>) -> Ordering { [INFO] [stdout] 62 + pub fn order(a: u32, b: u32, rules: &[(u32, u32)]) -> Ordering { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/bin/05.rs:80:5 [INFO] [stdout] | [INFO] [stdout] 71 | / let value = map_res( [INFO] [stdout] 72 | | separated_pair(many1(update), line_ending, many1(issues)), [INFO] [stdout] 73 | | |f| { [INFO] [stdout] 74 | | Ok::<_, nom::error::Error<&str>>(Input { [INFO] [stdout] ... | [INFO] [stdout] 78 | | }, [INFO] [stdout] 79 | | )(input); [INFO] [stdout] | |_____________- unnecessary `let` binding [INFO] [stdout] 80 | value [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 71 ~ [INFO] [stdout] 72 ~ map_res( [INFO] [stdout] 73 + separated_pair(many1(update), line_ending, many1(issues)), [INFO] [stdout] 74 + |f| { [INFO] [stdout] 75 + Ok::<_, nom::error::Error<&str>>(Input { [INFO] [stdout] 76 + update: f.0, [INFO] [stdout] 77 + issues: f.1, [INFO] [stdout] 78 + }) [INFO] [stdout] 79 + }, [INFO] [stdout] 80 + )(input) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `opt` and `terminated` [INFO] [stdout] --> src/bin/17.rs:7:27 [INFO] [stdout] | [INFO] [stdout] 7 | combinator::{map_res, opt}, [INFO] [stdout] | ^^^ [INFO] [stdout] 8 | multi::{many1, separated_list1}, [INFO] [stdout] 9 | sequence::{preceded, separated_pair, terminated}, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `while` condition [INFO] [stdout] --> src/bin/17.rs:23:11 [INFO] [stdout] | [INFO] [stdout] 23 | while (addr < program.len()) { [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] 23 - while (addr < program.len()) { [INFO] [stdout] 23 + while addr < program.len() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `while` condition [INFO] [stdout] --> src/bin/17.rs:81:11 [INFO] [stdout] | [INFO] [stdout] 81 | while (addr < program.len()) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 81 - while (addr < program.len()) { [INFO] [stdout] 81 + while addr < program.len() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return Some(pos.len()); [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] 10 - return Some(pos.len()); [INFO] [stdout] 10 + Some(pos.len()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:29:34 [INFO] [stdout] | [INFO] [stdout] 29 | (StepResult::LOOP, _) => return 1, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - (StepResult::LOOP, _) => return 1, [INFO] [stdout] 29 + (StepResult::LOOP, _) => 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:30:14 [INFO] [stdout] | [INFO] [stdout] 30 | _ => return 0, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - _ => return 0, [INFO] [stdout] 30 + _ => 0, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LOOP` contains a capitalized acronym [INFO] [stdout] --> src/bin/06.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | LOOP, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Loop` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EXIT` contains a capitalized acronym [INFO] [stdout] --> src/bin/06.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | EXIT, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Exit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CONTINUE` contains a capitalized acronym [INFO] [stdout] --> src/bin/06.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | CONTINUE, [INFO] [stdout] | ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Continue` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `board.get(0)` [INFO] [stdout] --> src/bin/06.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 138 | let size = (board.get(0).unwrap().len(), board.len()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `board.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:97:8 [INFO] [stdout] | [INFO] [stdout] 97 | if (step == '<') { [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] 97 - if (step == '<') { [INFO] [stdout] 97 + if step == '<' { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:101:20 [INFO] [stdout] | [INFO] [stdout] 101 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 101 - if (do_it) { [INFO] [stdout] 101 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:108:20 [INFO] [stdout] | [INFO] [stdout] 108 | if (move_crate(map, step, (new_crate_pos.0 - 1, new_crate_pos.1), do_it)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 108 - if (move_crate(map, step, (new_crate_pos.0 - 1, new_crate_pos.1), do_it)) { [INFO] [stdout] 108 + if move_crate(map, step, (new_crate_pos.0 - 1, new_crate_pos.1), do_it) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:109:24 [INFO] [stdout] | [INFO] [stdout] 109 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 109 - if (do_it) { [INFO] [stdout] 109 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:118:15 [INFO] [stdout] | [INFO] [stdout] 118 | } else if (step == '>') { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 118 - } else if (step == '>') { [INFO] [stdout] 118 + } else if step == '>' { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:127:20 [INFO] [stdout] | [INFO] [stdout] 127 | if (move_crate(map, step, compute_second_pos(new_crate_pos), do_it)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 127 - if (move_crate(map, step, compute_second_pos(new_crate_pos), do_it)) { [INFO] [stdout] 127 + if move_crate(map, step, compute_second_pos(new_crate_pos), do_it) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:128:24 [INFO] [stdout] | [INFO] [stdout] 128 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 128 - if (do_it) { [INFO] [stdout] 128 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:141:20 [INFO] [stdout] | [INFO] [stdout] 141 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 141 - if (do_it) { [INFO] [stdout] 141 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:147:20 [INFO] [stdout] | [INFO] [stdout] 147 | if (move_crate(map, step, new_crate_pos, do_it)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 147 - if (move_crate(map, step, new_crate_pos, do_it)) { [INFO] [stdout] 147 + if move_crate(map, step, new_crate_pos, do_it) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:148:24 [INFO] [stdout] | [INFO] [stdout] 148 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 148 - if (do_it) { [INFO] [stdout] 148 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:158:24 [INFO] [stdout] | [INFO] [stdout] 158 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 158 - if (do_it) { [INFO] [stdout] 158 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:168:24 [INFO] [stdout] | [INFO] [stdout] 168 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 168 - if (do_it) { [INFO] [stdout] 168 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:180:24 [INFO] [stdout] | [INFO] [stdout] 180 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 180 - if (do_it) { [INFO] [stdout] 180 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Crate_Left` should have an upper camel case name [INFO] [stdout] --> src/bin/15.rs:257:5 [INFO] [stdout] | [INFO] [stdout] 257 | Crate_Left, [INFO] [stdout] | ^^^^^^^^^^ help: convert the identifier to upper camel case: `CrateLeft` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Crate_Right` should have an upper camel case name [INFO] [stdout] --> src/bin/15.rs:258:5 [INFO] [stdout] | [INFO] [stdout] 258 | Crate_Right, [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to upper camel case: `CrateRight` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/07.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::usize; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/07.rs:32:37 [INFO] [stdout] | [INFO] [stdout] 32 | .filter(|l| is_possible(&l, &possible_ops)) [INFO] [stdout] | ^^ help: change this to: `l` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/18.rs:43:38 [INFO] [stdout] | [INFO] [stdout] 43 | .get(&Position { x: x, y: y }) [INFO] [stdout] | ^^^^ help: replace it with: `x` [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/18.rs:43:44 [INFO] [stdout] | [INFO] [stdout] 43 | .get(&Position { x: x, y: y }) [INFO] [stdout] | ^^^^ help: replace it with: `y` [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: unnecessary parentheses around `for` iterator expression [INFO] [stdout] --> src/bin/18.rs:120:14 [INFO] [stdout] | [INFO] [stdout] 120 | for i in (1024..obstacles.len()) { [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] 120 - for i in (1024..obstacles.len()) { [INFO] [stdout] 120 + for i in 1024..obstacles.len() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/07.rs:100:9 [INFO] [stdout] | [INFO] [stdout] 100 | return self.inputs.len() - 1; [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] 100 - return self.inputs.len() - 1; [INFO] [stdout] 100 + self.inputs.len() - 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/15.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `rem` [INFO] [stdout] --> src/bin/17.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | let (rem, program) = program(rem).unwrap(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_rem` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `pause` is never used [INFO] [stdout] --> src/bin/15.rs:24:4 [INFO] [stdout] | [INFO] [stdout] 24 | fn pause() { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `map.get(0)` [INFO] [stdout] --> src/bin/10.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | let size = (map.get(0).unwrap().len(), map.len()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `map.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/10.rs:12:16 [INFO] [stdout] | [INFO] [stdout] 12 | if head.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!head.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `map.get(0)` [INFO] [stdout] --> src/bin/10.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | let size = (map.get(0).unwrap().len(), map.len()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `map.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/bin/10.rs:55:20 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn reachable_9<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `rem` [INFO] [stdout] --> src/bin/17.rs:41:10 [INFO] [stdout] | [INFO] [stdout] 41 | let (rem, program) = program(rem).unwrap(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_rem` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/12.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | usize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/12.rs:10:29 [INFO] [stdout] | [INFO] [stdout] 10 | Some(regions.iter().map(|r| size(r)).sum()) [INFO] [stdout] | ^^^^^^^^^^^ help: replace the closure with the function itself: `size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/12.rs:15:29 [INFO] [stdout] | [INFO] [stdout] 15 | Some(regions.iter().map(|r| size_part_two(r)).sum()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `size_part_two` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/12.rs:18:21 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn size(region: &Vec<(usize, usize)>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 18 - pub fn size(region: &Vec<(usize, usize)>) -> usize { [INFO] [stdout] 18 + pub fn size(region: &[(usize, usize)]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `pos` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/12.rs:77:42 [INFO] [stdout] | [INFO] [stdout] 75 | if pos.is_some() { [INFO] [stdout] | ---------------- help: try: `if let Some() = pos` [INFO] [stdout] 76 | current_side.push(neighbor); [INFO] [stdout] 77 | let neighbor = border.remove(pos.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/12.rs:66:5 [INFO] [stdout] | [INFO] [stdout] 66 | let neighbors: Vec<(usize, usize)>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `neighbors` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 66 ~ [INFO] [stdout] 67 ~ let neighbors: Vec<(usize, usize)> = if horizontal { [INFO] [stdout] 68 ~ get_horizontal_neighbors(point) [INFO] [stdout] 69 | } else { [INFO] [stdout] 70 ~ get_vertical_neighbors(point) [INFO] [stdout] 71 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/bin/12.rs:100:5 [INFO] [stdout] | [INFO] [stdout] 100 | / regions [INFO] [stdout] 101 | | .into_iter() [INFO] [stdout] 102 | | .flat_map(|(_, region)| split_region(region)) [INFO] [stdout] | |_____________________________________________________^ help: try: `regions.into_values().flat_map(|region| split_region(region))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` 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/12.rs:121:13 [INFO] [stdout] | [INFO] [stdout] 121 | region: &Vec<(usize, usize)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 121 - region: &Vec<(usize, usize)>, [INFO] [stdout] 121 + region: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/17.rs:26:30 [INFO] [stdout] | [INFO] [stdout] 25 | if result.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = result` [INFO] [stdout] 26 | result_list.push(result.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/17.rs:20:45 [INFO] [stdout] | [INFO] [stdout] 20 | let mut registers: HashMap<&str, u64> = registers.iter().map(|c| *c).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `registers.iter().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: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/17.rs:42:41 [INFO] [stdout] | [INFO] [stdout] 42 | let registers: HashMap<&str, u64> = registers.iter().map(|c| *c).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `registers.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/17.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 55 | if value % 10000 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `value.is_multiple_of(10000)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/17.rs:84:30 [INFO] [stdout] | [INFO] [stdout] 83 | if result.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = result` [INFO] [stdout] 84 | result_list.push(result.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/17.rs:82:46 [INFO] [stdout] | [INFO] [stdout] 82 | let (next, result) = run_instruction(&mut registers, &program, addr); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `registers` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/17.rs:82:62 [INFO] [stdout] | [INFO] [stdout] 82 | let (next, result) = run_instruction(&mut registers, &program, addr); [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/17.rs:135:17 [INFO] [stdout] | [INFO] [stdout] 135 | return (idx + 1, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 135 - return (idx + 1, None); [INFO] [stdout] 135 + (idx + 1, None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/17.rs:137:17 [INFO] [stdout] | [INFO] [stdout] 137 | return (eval_operand(registers, *opcode) as usize, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 137 - return (eval_operand(registers, *opcode) as usize, None); [INFO] [stdout] 137 + (eval_operand(registers, *opcode) as usize, None) [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:106:14 [INFO] [stdout] | [INFO] [stdout] 106 | program: &Vec<(u8, u8)>, [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] 106 - program: &Vec<(u8, u8)>, [INFO] [stdout] 106 + program: &[(u8, u8)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `val` is never read [INFO] [stdout] --> src/bin/18.rs:119:19 [INFO] [stdout] | [INFO] [stdout] 119 | let mut val = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/bin/18.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | map.push_str("#"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `map.push('#')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/18.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | return find_exit(next_pos.unwrap(), obstacles, distances, next, max); [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] 82 - return find_exit(next_pos.unwrap(), obstacles, distances, next, max); [INFO] [stdout] 82 + find_exit(next_pos.unwrap(), obstacles, distances, next, max) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map_or(None, ..)` on an `Option` value [INFO] [stdout] --> src/bin/18.rs:80:16 [INFO] [stdout] | [INFO] [stdout] 80 | return distances.get(&max).map_or(None, |f| Some(*f)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `map`: `distances.get(&max).map(|f| *f)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_or_none [INFO] [stdout] = note: `#[warn(clippy::option_map_or_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/18.rs:153:9 [INFO] [stdout] | [INFO] [stdout] 153 | return (self.x + self.y).cmp(&(other.x + other.y)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 153 - return (self.x + self.y).cmp(&(other.x + other.y)); [INFO] [stdout] 153 + (self.x + self.y).cmp(&(other.x + other.y)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling serde_derive v1.0.215 [INFO] [stderr] Checking ciborium v0.2.2 [INFO] [stderr] Checking tinytemplate v1.2.1 [INFO] [stderr] Checking codspeed v2.7.2 [INFO] [stderr] Checking criterion v0.5.1 [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/11.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 45 | let result; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `result` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 45 ~ [INFO] [stdout] 46 ~ let result = if digit_count % 2 == 0 { [INFO] [stdout] 47 | let k1 = value / 10u64.pow((digit_count / 2) as u32); [INFO] [stdout] 48 | let k2 = value % 10u64.pow((digit_count / 2) as u32); [INFO] [stdout] 49 ~ with_memo(k1, step - 1, &mut memo) + with_memo(k2, step - 1, &mut memo) [INFO] [stdout] 50 | } else { [INFO] [stdout] 51 ~ with_memo(value * 2024, step - 1, &mut memo) [INFO] [stdout] 52 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/11.rs:46:8 [INFO] [stdout] | [INFO] [stdout] 46 | if digit_count % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `digit_count.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/11.rs:49:42 [INFO] [stdout] | [INFO] [stdout] 49 | result = with_memo(k1, step - 1, &mut memo) + with_memo(k2, step - 1, &mut memo); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `memo` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/11.rs:49:79 [INFO] [stdout] | [INFO] [stdout] 49 | result = with_memo(k1, step - 1, &mut memo) + with_memo(k2, step - 1, &mut memo); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `memo` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/11.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | result = with_memo(value * 2024, step - 1, &mut memo) [INFO] [stdout] | ^^^^^^^^^ help: change this to: `memo` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/11.rs:64:16 [INFO] [stdout] | [INFO] [stdout] 64 | if digit_count % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `digit_count.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/11.rs:77:20 [INFO] [stdout] | [INFO] [stdout] 77 | pub fn step(state: &mut Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 77 - pub fn step(state: &mut Vec) -> Vec { [INFO] [stdout] 77 + pub fn step(state: &mut [u64]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/11.rs:80:10 [INFO] [stdout] | [INFO] [stdout] 80 | .map(|s| { [INFO] [stdout] | __________^ [INFO] [stdout] 81 | | let mut vec = Vec::new(); [INFO] [stdout] 82 | | if *s == 0 { [INFO] [stdout] 83 | | vec.push(1); [INFO] [stdout] ... | [INFO] [stdout] 102 | | }) [INFO] [stdout] 103 | | .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] 80 ~ .flat_map(|s| { [INFO] [stdout] 81 + let mut vec = Vec::new(); [INFO] [stdout] 82 + if *s == 0 { [INFO] [stdout] 83 + vec.push(1); [INFO] [stdout] 84 + return vec; [INFO] [stdout] 85 + } [INFO] [stdout] 86 + let string_value = s.to_string(); [INFO] [stdout] 87 + if string_value.len() % 2 == 0 { [INFO] [stdout] 88 + vec.push( [INFO] [stdout] 89 + string_value[0..string_value.len() / 2] [INFO] [stdout] 90 + .parse::() [INFO] [stdout] 91 + .unwrap(), [INFO] [stdout] 92 + ); [INFO] [stdout] 93 + vec.push( [INFO] [stdout] 94 + string_value[string_value.len() / 2..] [INFO] [stdout] 95 + .parse::() [INFO] [stdout] 96 + .unwrap(), [INFO] [stdout] 97 + ); [INFO] [stdout] 98 + return vec; [INFO] [stdout] 99 + } [INFO] [stdout] 100 + vec.push(s * 2024); [INFO] [stdout] 101 + return vec; [INFO] [stdout] 102 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/11.rs:101:13 [INFO] [stdout] | [INFO] [stdout] 101 | return vec; [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] 101 - return vec; [INFO] [stdout] 101 + vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `collections::HashMap` and `usize::MAX` [INFO] [stdout] --> src/bin/05.rs:1:26 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cmp::Ordering, collections::HashMap, usize::MAX}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `newline` [INFO] [stdout] --> src/bin/05.rs:5:48 [INFO] [stdout] | [INFO] [stdout] 5 | character::complete::{digit1, line_ending, newline}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/06.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | board: board, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `board` [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: unnecessary parentheses around `match` scrutinee expression [INFO] [stdout] --> src/bin/16.rs:14:38 [INFO] [stdout] | [INFO] [stdout] 14 | .map(|(x, ch)| match (ch) { [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] 14 - .map(|(x, ch)| match (ch) { [INFO] [stdout] 14 + .map(|(x, ch)| match ch { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:76:17 [INFO] [stdout] | [INFO] [stdout] 76 | deer: deer, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `deer` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | return (true, v[0] - v[1]); [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] 28 - return (true, v[0] - v[1]); [INFO] [stdout] 28 + (true, v[0] - v[1]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/02.rs:43:23 [INFO] [stdout] | [INFO] [stdout] 43 | input.lines().map(|l| parse_line(l)).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | return Some(pos.len()); [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] 10 - return Some(pos.len()); [INFO] [stdout] 10 + Some(pos.len()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:29:34 [INFO] [stdout] | [INFO] [stdout] 29 | (StepResult::LOOP, _) => return 1, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - (StepResult::LOOP, _) => return 1, [INFO] [stdout] 29 + (StepResult::LOOP, _) => 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/06.rs:30:14 [INFO] [stdout] | [INFO] [stdout] 30 | _ => return 0, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - _ => return 0, [INFO] [stdout] 30 + _ => 0, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `LOOP` contains a capitalized acronym [INFO] [stdout] --> src/bin/06.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | LOOP, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Loop` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EXIT` contains a capitalized acronym [INFO] [stdout] --> src/bin/06.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | EXIT, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Exit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CONTINUE` contains a capitalized acronym [INFO] [stdout] --> src/bin/06.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | CONTINUE, [INFO] [stdout] | ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Continue` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `board.get(0)` [INFO] [stdout] --> src/bin/06.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 138 | let size = (board.get(0).unwrap().len(), board.len()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `board.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `opt` and `terminated` [INFO] [stdout] --> src/bin/17.rs:7:27 [INFO] [stdout] | [INFO] [stdout] 7 | combinator::{map_res, opt}, [INFO] [stdout] | ^^^ [INFO] [stdout] 8 | multi::{many1, separated_list1}, [INFO] [stdout] 9 | sequence::{preceded, separated_pair, terminated}, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `while` condition [INFO] [stdout] --> src/bin/17.rs:23:11 [INFO] [stdout] | [INFO] [stdout] 23 | while (addr < program.len()) { [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] 23 - while (addr < program.len()) { [INFO] [stdout] 23 + while addr < program.len() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `while` condition [INFO] [stdout] --> src/bin/17.rs:81:11 [INFO] [stdout] | [INFO] [stdout] 81 | while (addr < program.len()) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 81 - while (addr < program.len()) { [INFO] [stdout] 81 + while addr < program.len() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `cmp::min` and `usize::MAX` [INFO] [stdout] --> src/bin/13.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cmp::min, usize::MAX}; [INFO] [stdout] | ^^^^^^^^ ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/13.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | a: a, [INFO] [stdout] | ^^^^ help: replace it with: `a` [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/13.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | b: b, [INFO] [stdout] | ^^^^ help: replace it with: `b` [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: redundant field names in struct initialization [INFO] [stdout] --> src/bin/13.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | prize: prize, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `prize` [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: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/14.rs:25:12 [INFO] [stdout] | [INFO] [stdout] 25 | if (mean_variation.0 < 30 && mean_variation.1 < 30) { [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] 25 - if (mean_variation.0 < 30 && mean_variation.1 < 30) { [INFO] [stdout] 25 + if mean_variation.0 < 30 && mean_variation.1 < 30 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/14.rs:111:8 [INFO] [stdout] | [INFO] [stdout] 111 | if (return_val < 0 || return_val >= bound as isize) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 111 - if (return_val < 0 || return_val >= bound as isize) { [INFO] [stdout] 111 + if return_val < 0 || return_val >= bound as isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing a legacy numeric constant [INFO] [stdout] --> src/bin/05.rs:1:48 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cmp::Ordering, collections::HashMap, usize::MAX}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import and use the associated constant `usize::MAX` from the primitive type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/05.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | .map(|x| take_middle(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `take_middle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:39:27 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn take_middle(input: &Vec) -> u32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - pub fn take_middle(input: &Vec) -> u32 { [INFO] [stdout] 39 + pub fn take_middle(input: &[u32]) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:44:27 [INFO] [stdout] | [INFO] [stdout] 44 | pub fn check_issue(issue: &Vec, rules: Vec<(u32, u32)>) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - pub fn check_issue(issue: &Vec, rules: Vec<(u32, u32)>) -> bool { [INFO] [stdout] 44 + pub fn check_issue(issue: &[u32], rules: Vec<(u32, u32)>) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/05.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return Ordering::Greater; [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] 67 - return Ordering::Greater; [INFO] [stdout] 67 + Ordering::Greater [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:62:37 [INFO] [stdout] | [INFO] [stdout] 62 | pub fn order(a: u32, b: u32, rules: &Vec<(u32, u32)>) -> Ordering { [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] 62 - pub fn order(a: u32, b: u32, rules: &Vec<(u32, u32)>) -> Ordering { [INFO] [stdout] 62 + pub fn order(a: u32, b: u32, rules: &[(u32, u32)]) -> Ordering { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/bin/05.rs:80:5 [INFO] [stdout] | [INFO] [stdout] 71 | / let value = map_res( [INFO] [stdout] 72 | | separated_pair(many1(update), line_ending, many1(issues)), [INFO] [stdout] 73 | | |f| { [INFO] [stdout] 74 | | Ok::<_, nom::error::Error<&str>>(Input { [INFO] [stdout] ... | [INFO] [stdout] 78 | | }, [INFO] [stdout] 79 | | )(input); [INFO] [stdout] | |_____________- unnecessary `let` binding [INFO] [stdout] 80 | value [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 71 ~ [INFO] [stdout] 72 ~ map_res( [INFO] [stdout] 73 + separated_pair(many1(update), line_ending, many1(issues)), [INFO] [stdout] 74 + |f| { [INFO] [stdout] 75 + Ok::<_, nom::error::Error<&str>>(Input { [INFO] [stdout] 76 + update: f.0, [INFO] [stdout] 77 + issues: f.1, [INFO] [stdout] 78 + }) [INFO] [stdout] 79 + }, [INFO] [stdout] 80 + )(input) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/16.rs:39:17 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `rem` [INFO] [stdout] --> src/bin/17.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | let (rem, program) = program(rem).unwrap(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_rem` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:17:38 [INFO] [stdout] | [INFO] [stdout] 17 | start_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:17:58 [INFO] [stdout] | [INFO] [stdout] 17 | start_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:21:36 [INFO] [stdout] | [INFO] [stdout] 21 | end_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:21:56 [INFO] [stdout] | [INFO] [stdout] 21 | end_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `isize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/16.rs:50:24 [INFO] [stdout] | [INFO] [stdout] 50 | let distance = dist.get(&deer_pos).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*dist.get(&deer_pos).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/bin/16.rs:184:1 [INFO] [stdout] | [INFO] [stdout] 184 | / impl PartialOrd for Node { [INFO] [stdout] 185 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 186 | | other.cost.partial_cmp(&self.cost) [INFO] [stdout] 187 | | } [INFO] [stdout] 188 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 185 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 186 - other.cost.partial_cmp(&self.cost) [INFO] [stdout] 187 - } [INFO] [stdout] 185 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `rem` [INFO] [stdout] --> src/bin/17.rs:41:10 [INFO] [stdout] | [INFO] [stdout] 41 | let (rem, program) = program(rem).unwrap(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_rem` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/14.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `vec.get(0)` [INFO] [stdout] --> src/bin/04.rs:7:63 [INFO] [stdout] | [INFO] [stdout] 7 | let starting_points = (0..vec.len()).cartesian_product(0..vec.get(0).unwrap().len()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `vec.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `vec.get(0)` [INFO] [stdout] --> src/bin/04.rs:23:63 [INFO] [stdout] | [INFO] [stdout] 23 | let starting_points = (0..vec.len()).cartesian_product(0..vec.get(0).unwrap().len()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `vec.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/04.rs:37:22 [INFO] [stdout] | [INFO] [stdout] 37 | pub fn access(input: &Vec>, i: usize, j: usize) -> char { [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] 37 - pub fn access(input: &Vec>, i: usize, j: usize) -> char { [INFO] [stdout] 37 + pub fn access(input: &[Vec], i: usize, j: usize) -> char { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/bin/04.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | / input [INFO] [stdout] 39 | | .get(i) [INFO] [stdout] 40 | | .unwrap_or(&vec![' ']) [INFO] [stdout] 41 | | .get(j) [INFO] [stdout] 42 | | .unwrap_or(&' ') [INFO] [stdout] 43 | | .clone() [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 38 ~ *input [INFO] [stdout] 39 + .get(i) [INFO] [stdout] 40 + .unwrap_or(&vec![' ']) [INFO] [stdout] 41 + .get(j) [INFO] [stdout] 42 + .unwrap_or(&' ') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting the result of `i32::abs()` to usize [INFO] [stdout] --> src/bin/04.rs:49:27 [INFO] [stdout] | [INFO] [stdout] 49 | u.overflowing_sub(i.abs() as usize).0 [INFO] [stdout] | ^^^^^^^ help: replace with: `i.unsigned_abs()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned [INFO] [stdout] = note: `#[warn(clippy::cast_abs_to_unsigned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/04.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | return (diag_1 == vec!['M', 'S']) && (diag_2 == vec!['M', 'S']); [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] 71 - return (diag_1 == vec!['M', 'S']) && (diag_2 == vec!['M', 'S']); [INFO] [stdout] 71 + (diag_1 == vec!['M', 'S']) && (diag_2 == vec!['M', 'S']) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/04.rs:86:12 [INFO] [stdout] | [INFO] [stdout] 86 | if !(*to_test.get(idx as usize).unwrap() == access(input, i, j)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*to_test.get(idx as usize).unwrap() != access(input, i, j))` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/04.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 91 - return true; [INFO] [stdout] 91 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/17.rs:26:30 [INFO] [stdout] | [INFO] [stdout] 25 | if result.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = result` [INFO] [stdout] 26 | result_list.push(result.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/17.rs:20:45 [INFO] [stdout] | [INFO] [stdout] 20 | let mut registers: HashMap<&str, u64> = registers.iter().map(|c| *c).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `registers.iter().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: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/17.rs:42:41 [INFO] [stdout] | [INFO] [stdout] 42 | let registers: HashMap<&str, u64> = registers.iter().map(|c| *c).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `registers.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/17.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 55 | if value % 10000 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace with: `value.is_multiple_of(10000)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/17.rs:84:30 [INFO] [stdout] | [INFO] [stdout] 83 | if result.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = result` [INFO] [stdout] 84 | result_list.push(result.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/17.rs:82:46 [INFO] [stdout] | [INFO] [stdout] 82 | let (next, result) = run_instruction(&mut registers, &program, addr); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `registers` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/17.rs:82:62 [INFO] [stdout] | [INFO] [stdout] 82 | let (next, result) = run_instruction(&mut registers, &program, addr); [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/17.rs:135:17 [INFO] [stdout] | [INFO] [stdout] 135 | return (idx + 1, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 135 - return (idx + 1, None); [INFO] [stdout] 135 + (idx + 1, None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/17.rs:137:17 [INFO] [stdout] | [INFO] [stdout] 137 | return (eval_operand(registers, *opcode) as usize, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 137 - return (eval_operand(registers, *opcode) as usize, None); [INFO] [stdout] 137 + (eval_operand(registers, *opcode) as usize, None) [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:106:14 [INFO] [stdout] | [INFO] [stdout] 106 | program: &Vec<(u8, u8)>, [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] 106 - program: &Vec<(u8, u8)>, [INFO] [stdout] 106 + program: &[(u8, u8)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing a legacy numeric constant [INFO] [stdout] --> src/bin/13.rs:1:21 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{cmp::min, usize::MAX}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import and use the associated constant `usize::MAX` from the primitive type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/bin/13.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 23 | .filter(|c| c.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 24 | | .map(|c| c.unwrap()) [INFO] [stdout] | |________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/bin/13.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | .filter(|c| c.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 42 | | .map(|c| c.unwrap()) [INFO] [stdout] | |________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/13.rs:66:5 [INFO] [stdout] | [INFO] [stdout] 66 | / return Ok(( [INFO] [stdout] 67 | | rem, [INFO] [stdout] 68 | | ClawMachine { [INFO] [stdout] 69 | | a: a, [INFO] [stdout] ... | [INFO] [stdout] 72 | | }, [INFO] [stdout] 73 | | )); [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] 66 ~ Ok(( [INFO] [stdout] 67 + rem, [INFO] [stdout] 68 + ClawMachine { [INFO] [stdout] 69 + a: a, [INFO] [stdout] 70 + b: b, [INFO] [stdout] 71 + prize: prize, [INFO] [stdout] 72 + }, [INFO] [stdout] 73 ~ )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/14.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | return (sum.0 / robots.len(), sum.1 / robots.len()); [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] 50 - return (sum.0 / robots.len(), sum.1 / robots.len()); [INFO] [stdout] 50 + (sum.0 / robots.len(), sum.1 / robots.len()) [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:44:31 [INFO] [stdout] | [INFO] [stdout] 44 | pub fn mean_variation(robots: &Vec) -> (usize, usize) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - pub fn mean_variation(robots: &Vec) -> (usize, usize) { [INFO] [stdout] 44 + pub fn mean_variation(robots: &[Robot]) -> (usize, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/14.rs:60:24 [INFO] [stdout] | [INFO] [stdout] 60 | pub fn display(robots: &Vec, field_size: (usize, usize)) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 60 - pub fn display(robots: &Vec, field_size: (usize, usize)) -> String { [INFO] [stdout] 60 + pub fn display(robots: &[Robot], field_size: (usize, usize)) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/bin/14.rs:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | map_vis.push_str("."); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `map_vis.push('.')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/14.rs:95:5 [INFO] [stdout] | [INFO] [stdout] 95 | return quadrants[0] * quadrants[1] * quadrants[2] * quadrants[3]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 95 - return quadrants[0] * quadrants[1] * quadrants[2] * quadrants[3]; [INFO] [stdout] 95 + quadrants[0] * quadrants[1] * quadrants[2] * quadrants[3] [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:76:22 [INFO] [stdout] | [INFO] [stdout] 76 | pub fn score(robots: &Vec, field_size: (usize, usize)) -> isize { [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] 76 - pub fn score(robots: &Vec, field_size: (usize, usize)) -> isize { [INFO] [stdout] 76 + pub fn score(robots: &[Robot], field_size: (usize, usize)) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `possible_pos` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/09.rs:41:34 [INFO] [stdout] | [INFO] [stdout] 40 | if possible_pos.is_some() && possible_pos.unwrap().1.begin < current_slot.begin { [INFO] [stdout] | ---------------------- the check is happening here [INFO] [stdout] 41 | let (idx, new_pos) = possible_pos.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `remaining_space` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/09.rs:57:39 [INFO] [stdout] | [INFO] [stdout] 56 | if remaining_space.is_some() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = remaining_space` [INFO] [stdout] 57 | freespace.insert(idx, remaining_space.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/09.rs:64:33 [INFO] [stdout] | [INFO] [stdout] 64 | fn find_possible_pos(freespace: &Vec, size: u32) -> Option<(usize, &DiskSlot)> { [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] 64 - fn find_possible_pos(freespace: &Vec, size: u32) -> Option<(usize, &DiskSlot)> { [INFO] [stdout] 64 + fn find_possible_pos(freespace: &[DiskSlot], size: u32) -> Option<(usize, &DiskSlot)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/09.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | current_idx = current_idx + count; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `current_idx += count` [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: unused variable: `c` [INFO] [stdout] --> src/bin/08.rs:24:16 [INFO] [stdout] | [INFO] [stdout] 24 | .map(|(c, locs)| { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ops::BitXor` [INFO] [stdout] --> src/bin/22.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | ops::BitXor, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `for` iterator expression [INFO] [stdout] --> src/bin/22.rs:43:14 [INFO] [stdout] | [INFO] [stdout] 43 | for i in (0..3) { [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] 43 - for i in (0..3) { [INFO] [stdout] 43 + for i in 0..3 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `for` iterator expression [INFO] [stdout] --> src/bin/22.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 49 | for i in (3..iteration) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 49 - for i in (3..iteration) { [INFO] [stdout] 49 + for i in 3..iteration { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing a legacy numeric constant [INFO] [stdout] --> src/bin/08.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | usize::MAX, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import and use the associated constant `usize::MAX` from the primitive type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/bin/08.rs:24:10 [INFO] [stdout] | [INFO] [stdout] 24 | .map(|(c, locs)| { [INFO] [stdout] | __________^ [INFO] [stdout] 25 | | let set: HashSet<(usize, usize)> = locs [INFO] [stdout] 26 | | .iter() [INFO] [stdout] 27 | | .combinations(2) [INFO] [stdout] ... | [INFO] [stdout] 35 | | }) [INFO] [stdout] 36 | | .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] 24 ~ .flat_map(|(c, locs)| { [INFO] [stdout] 25 + let set: HashSet<(usize, usize)> = locs [INFO] [stdout] 26 + .iter() [INFO] [stdout] 27 + .combinations(2) [INFO] [stdout] 28 + .flat_map(|v| { [INFO] [stdout] 29 + let a1 = v.get(0).unwrap(); [INFO] [stdout] 30 + let a2 = v.get(1).unwrap(); [INFO] [stdout] 31 + find_antinodes(**a1, **a2, field.size, part_one) [INFO] [stdout] 32 + }) [INFO] [stdout] 33 + .collect(); [INFO] [stdout] 34 + set [INFO] [stdout] 35 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `init_secret` [INFO] [stdout] --> src/bin/22.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | let init_secret = secret; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_init_secret` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/22.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | for i in (0..3) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/22.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | for i in (3..iteration) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `v.get(0)` [INFO] [stdout] --> src/bin/08.rs:29:30 [INFO] [stdout] | [INFO] [stdout] 29 | let a1 = v.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^ help: try: `v.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/22.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | u128, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `u128::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/bin/22.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / let _ = input_numbers.for_each(|c| { [INFO] [stdout] 21 | | compute_iter(c, 2000, values); [INFO] [stdout] 22 | | }); [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 20 - let _ = input_numbers.for_each(|c| { [INFO] [stdout] 20 + input_numbers.for_each(|c| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/22.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [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/22.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/22.rs:75:5 [INFO] [stdout] | [INFO] [stdout] 75 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [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: usage of a legacy numeric constant [INFO] [stdout] --> src/bin/08.rs:52:63 [INFO] [stdout] | [INFO] [stdout] 52 | (limits.0).checked_div(x2.abs_diff(x1)).unwrap_or(MAX), [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 52 | (limits.0).checked_div(x2.abs_diff(x1)).unwrap_or(usize::MAX), [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/bin/22.rs:95:33 [INFO] [stdout] | [INFO] [stdout] 95 | let result: Vec = vec![1, 10, 100, 2024] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1, 10, 100, 2024]` [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: usage of a legacy numeric constant [INFO] [stdout] --> src/bin/08.rs:53:63 [INFO] [stdout] | [INFO] [stdout] 53 | (limits.1).checked_div(y2.abs_diff(y2)).unwrap_or(MAX), [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 53 | (limits.1).checked_div(y2.abs_diff(y2)).unwrap_or(usize::MAX), [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/08.rs:82:12 [INFO] [stdout] | [INFO] [stdout] 82 | if line.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/bin/08.rs:92:22 [INFO] [stdout] | [INFO] [stdout] 92 | .or_insert(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: unused import: `HashSet` [INFO] [stdout] --> src/bin/19.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/18.rs:43:38 [INFO] [stdout] | [INFO] [stdout] 43 | .get(&Position { x: x, y: y }) [INFO] [stdout] | ^^^^ help: replace it with: `x` [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/18.rs:43:44 [INFO] [stdout] | [INFO] [stdout] 43 | .get(&Position { x: x, y: y }) [INFO] [stdout] | ^^^^ help: replace it with: `y` [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: unnecessary parentheses around `for` iterator expression [INFO] [stdout] --> src/bin/18.rs:120:14 [INFO] [stdout] | [INFO] [stdout] 120 | for i in (1024..obstacles.len()) { [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] 120 - for i in (1024..obstacles.len()) { [INFO] [stdout] 120 + for i in 1024..obstacles.len() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/bin/01.rs:15:43 [INFO] [stdout] | [INFO] [stdout] 15 | .fold(0, |acc, (left, right)| (acc + abs(left - right))), [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] 15 - .fold(0, |acc, (left, right)| (acc + abs(left - right))), [INFO] [stdout] 15 + .fold(0, |acc, (left, right)| acc + abs(left - right) ), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `val` is never read [INFO] [stdout] --> src/bin/18.rs:119:19 [INFO] [stdout] | [INFO] [stdout] 119 | let mut val = None; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/bin/18.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | map.push_str("#"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `map.push('#')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/18.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | return find_exit(next_pos.unwrap(), obstacles, distances, next, max); [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] 82 - return find_exit(next_pos.unwrap(), obstacles, distances, next, max); [INFO] [stdout] 82 + find_exit(next_pos.unwrap(), obstacles, distances, next, max) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map_or(None, ..)` on an `Option` value [INFO] [stdout] --> src/bin/18.rs:80:16 [INFO] [stdout] | [INFO] [stdout] 80 | return distances.get(&max).map_or(None, |f| Some(*f)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `map`: `distances.get(&max).map(|f| *f)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_or_none [INFO] [stdout] = note: `#[warn(clippy::option_map_or_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/18.rs:153:9 [INFO] [stdout] | [INFO] [stdout] 153 | return (self.x + self.y).cmp(&(other.x + other.y)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 153 - return (self.x + self.y).cmp(&(other.x + other.y)); [INFO] [stdout] 153 + (self.x + self.y).cmp(&(other.x + other.y)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/12.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | usize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/12.rs:10:29 [INFO] [stdout] | [INFO] [stdout] 10 | Some(regions.iter().map(|r| size(r)).sum()) [INFO] [stdout] | ^^^^^^^^^^^ help: replace the closure with the function itself: `size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:97:8 [INFO] [stdout] | [INFO] [stdout] 97 | if (step == '<') { [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] 97 - if (step == '<') { [INFO] [stdout] 97 + if step == '<' { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:101:20 [INFO] [stdout] | [INFO] [stdout] 101 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 101 - if (do_it) { [INFO] [stdout] 101 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:108:20 [INFO] [stdout] | [INFO] [stdout] 108 | if (move_crate(map, step, (new_crate_pos.0 - 1, new_crate_pos.1), do_it)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 108 - if (move_crate(map, step, (new_crate_pos.0 - 1, new_crate_pos.1), do_it)) { [INFO] [stdout] 108 + if move_crate(map, step, (new_crate_pos.0 - 1, new_crate_pos.1), do_it) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/12.rs:15:29 [INFO] [stdout] | [INFO] [stdout] 15 | Some(regions.iter().map(|r| size_part_two(r)).sum()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `size_part_two` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/12.rs:18:21 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn size(region: &Vec<(usize, usize)>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 18 - pub fn size(region: &Vec<(usize, usize)>) -> usize { [INFO] [stdout] 18 + pub fn size(region: &[(usize, usize)]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:109:24 [INFO] [stdout] | [INFO] [stdout] 109 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 109 - if (do_it) { [INFO] [stdout] 109 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:118:15 [INFO] [stdout] | [INFO] [stdout] 118 | } else if (step == '>') { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 118 - } else if (step == '>') { [INFO] [stdout] 118 + } else if step == '>' { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:127:20 [INFO] [stdout] | [INFO] [stdout] 127 | if (move_crate(map, step, compute_second_pos(new_crate_pos), do_it)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 127 - if (move_crate(map, step, compute_second_pos(new_crate_pos), do_it)) { [INFO] [stdout] 127 + if move_crate(map, step, compute_second_pos(new_crate_pos), do_it) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:128:24 [INFO] [stdout] | [INFO] [stdout] 128 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 128 - if (do_it) { [INFO] [stdout] 128 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:141:20 [INFO] [stdout] | [INFO] [stdout] 141 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 141 - if (do_it) { [INFO] [stdout] 141 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:147:20 [INFO] [stdout] | [INFO] [stdout] 147 | if (move_crate(map, step, new_crate_pos, do_it)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 147 - if (move_crate(map, step, new_crate_pos, do_it)) { [INFO] [stdout] 147 + if move_crate(map, step, new_crate_pos, do_it) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:148:24 [INFO] [stdout] | [INFO] [stdout] 148 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 148 - if (do_it) { [INFO] [stdout] 148 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:158:24 [INFO] [stdout] | [INFO] [stdout] 158 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 158 - if (do_it) { [INFO] [stdout] 158 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:168:24 [INFO] [stdout] | [INFO] [stdout] 168 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 168 - if (do_it) { [INFO] [stdout] 168 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/15.rs:180:24 [INFO] [stdout] | [INFO] [stdout] 180 | if (do_it) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 180 - if (do_it) { [INFO] [stdout] 180 + if do_it { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Crate_Left` should have an upper camel case name [INFO] [stdout] --> src/bin/15.rs:257:5 [INFO] [stdout] | [INFO] [stdout] 257 | Crate_Left, [INFO] [stdout] | ^^^^^^^^^^ help: convert the identifier to upper camel case: `CrateLeft` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Crate_Right` should have an upper camel case name [INFO] [stdout] --> src/bin/15.rs:258:5 [INFO] [stdout] | [INFO] [stdout] 258 | Crate_Right, [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to upper camel case: `CrateRight` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `map.get(0)` [INFO] [stdout] --> src/bin/10.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | let size = (map.get(0).unwrap().len(), map.len()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `map.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/10.rs:12:16 [INFO] [stdout] | [INFO] [stdout] 12 | if head.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!head.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `map.get(0)` [INFO] [stdout] --> src/bin/10.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | let size = (map.get(0).unwrap().len(), map.len()); [INFO] [stdout] | ^^^^^^^^^^ help: try: `map.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/bin/10.rs:55:20 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn reachable_9<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `pos` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/12.rs:77:42 [INFO] [stdout] | [INFO] [stdout] 75 | if pos.is_some() { [INFO] [stdout] | ---------------- help: try: `if let Some() = pos` [INFO] [stdout] 76 | current_side.push(neighbor); [INFO] [stdout] 77 | let neighbor = border.remove(pos.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/12.rs:66:5 [INFO] [stdout] | [INFO] [stdout] 66 | let neighbors: Vec<(usize, usize)>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `neighbors` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 66 ~ [INFO] [stdout] 67 ~ let neighbors: Vec<(usize, usize)> = if horizontal { [INFO] [stdout] 68 ~ get_horizontal_neighbors(point) [INFO] [stdout] 69 | } else { [INFO] [stdout] 70 ~ get_vertical_neighbors(point) [INFO] [stdout] 71 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/bin/12.rs:100:5 [INFO] [stdout] | [INFO] [stdout] 100 | / regions [INFO] [stdout] 101 | | .into_iter() [INFO] [stdout] 102 | | .flat_map(|(_, region)| split_region(region)) [INFO] [stdout] | |_____________________________________________________^ help: try: `regions.into_values().flat_map(|region| split_region(region))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` 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/12.rs:121:13 [INFO] [stdout] | [INFO] [stdout] 121 | region: &Vec<(usize, usize)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 121 - region: &Vec<(usize, usize)>, [INFO] [stdout] 121 + region: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/19.rs:82:17 [INFO] [stdout] | [INFO] [stdout] 82 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/03.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | if input.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `input.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/03.rs:35:12 [INFO] [stdout] | [INFO] [stdout] 35 | if input.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `input.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/15.rs:20:17 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/19.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | return finishes; [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] 59 - return finishes; [INFO] [stdout] 59 + finishes [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/19.rs:37:30 [INFO] [stdout] | [INFO] [stdout] 37 | let next = sub_trie.get(&word.chars().nth(0).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `word.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:50:57 [INFO] [stdout] | [INFO] [stdout] 50 | let finishes = recursive_find(s, &next_node.childs, &whole_trie, eliminated); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `whole_trie` [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: length comparison to zero [INFO] [stdout] --> src/bin/19.rs:63:8 [INFO] [stdout] | [INFO] [stdout] 63 | if word.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `word.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/19.rs:67:24 [INFO] [stdout] | [INFO] [stdout] 67 | let first_letter = word.chars().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `word.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:70:9 [INFO] [stdout] | [INFO] [stdout] 70 | / &mut current_node.childs.entry(first_letter).or_insert(TrieNode { [INFO] [stdout] 71 | | is_end: false, [INFO] [stdout] 72 | | childs: HashMap::new(), [INFO] [stdout] 73 | | }), [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 70 ~ current_node.childs.entry(first_letter).or_insert(TrieNode { [INFO] [stdout] 71 + is_end: false, [INFO] [stdout] 72 + childs: HashMap::new(), [INFO] [stdout] 73 ~ }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `newline` [INFO] [stdout] --> src/bin/07.rs:5:48 [INFO] [stdout] | [INFO] [stdout] 5 | character::complete::{digit1, line_ending, newline}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:113:17 [INFO] [stdout] | [INFO] [stdout] 113 | result: result, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `result` [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/07.rs:114:17 [INFO] [stdout] | [INFO] [stdout] 114 | inputs: inputs, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `inputs` [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: function `pause` is never used [INFO] [stdout] --> src/bin/15.rs:24:4 [INFO] [stdout] | [INFO] [stdout] 24 | fn pause() { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/19.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | assert_eq!(a_child.is_end, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 120 - assert_eq!(a_child.is_end, false); [INFO] [stdout] 120 + assert!(!a_child.is_end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/19.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | assert_eq!(c_child.is_end, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 123 - assert_eq!(c_child.is_end, true); [INFO] [stdout] 123 + assert!(c_child.is_end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/19.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | assert_eq!(e_child.is_end, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 139 - assert_eq!(e_child.is_end, true); [INFO] [stdout] 139 + assert!(e_child.is_end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/19.rs:142:9 [INFO] [stdout] | [INFO] [stdout] 142 | assert_eq!(a_child.is_end, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 142 - assert_eq!(a_child.is_end, false); [INFO] [stdout] 142 + assert!(!a_child.is_end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/bin/19.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 145 | assert_eq!(c_child.is_end, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 145 - assert_eq!(c_child.is_end, true); [INFO] [stdout] 145 + assert!(c_child.is_end); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/bin/19.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | let words = vec!["ab", "ac"]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: you can use an array directly: `["ab", "ac"]` [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: useless use of `vec!` [INFO] [stdout] --> src/bin/19.rs:129:21 [INFO] [stdout] | [INFO] [stdout] 129 | let words = vec!["ab", "ac", "acd", "e", "acd"]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `["ab", "ac", "acd", "e", "acd"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `match` scrutinee expression [INFO] [stdout] --> src/bin/20.rs:17:38 [INFO] [stdout] | [INFO] [stdout] 17 | .map(|(x, ch)| match (ch) { [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] 17 - .map(|(x, ch)| match (ch) { [INFO] [stdout] 17 + .map(|(x, ch)| match ch { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/07.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::usize; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/07.rs:32:37 [INFO] [stdout] | [INFO] [stdout] 32 | .filter(|l| is_possible(&l, &possible_ops)) [INFO] [stdout] | ^^ help: change this to: `l` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/07.rs:100:9 [INFO] [stdout] | [INFO] [stdout] 100 | return self.inputs.len() - 1; [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] 100 - return self.inputs.len() - 1; [INFO] [stdout] 100 + self.inputs.len() - 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/20.rs:90:17 [INFO] [stdout] | [INFO] [stdout] 90 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:20:38 [INFO] [stdout] | [INFO] [stdout] 20 | start_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:20:58 [INFO] [stdout] | [INFO] [stdout] 20 | start_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:24:36 [INFO] [stdout] | [INFO] [stdout] 24 | end_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:24:56 [INFO] [stdout] | [INFO] [stdout] 24 | end_pos = (x.clone() as isize, y.clone() as isize); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `maze.get(0)` [INFO] [stdout] --> src/bin/20.rs:47:42 [INFO] [stdout] | [INFO] [stdout] 47 | && ((p.pos.0 as usize) < maze.get(0).unwrap().len()) [INFO] [stdout] | ^^^^^^^^^^^ help: try: `maze.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/bin/20.rs:64:48 [INFO] [stdout] | [INFO] [stdout] 64 | let walls: usize = new_maze.iter().flat_map(|c| c).filter(|d| **d).count(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [INFO] [stdout] = note: `#[warn(clippy::flat_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/bin/20.rs:65:49 [INFO] [stdout] | [INFO] [stdout] 65 | let init_walls: usize = maze.iter().flat_map(|c| c).filter(|d| **d).count(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [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:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | &new_maze, [INFO] [stdout] | ^^^^^^^^^ help: change this to: `new_maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/20.rs:95:11 [INFO] [stdout] | [INFO] [stdout] 95 | maze: &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] 95 - maze: &Vec>, [INFO] [stdout] 95 + maze: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `isize` which implements the `Copy` trait [INFO] [stdout] --> src/bin/20.rs:109:24 [INFO] [stdout] | [INFO] [stdout] 109 | let distance = dist.get(&pos).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*dist.get(&pos).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/bin/20.rs:180:1 [INFO] [stdout] | [INFO] [stdout] 180 | / impl PartialOrd for Node { [INFO] [stdout] 181 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 182 | | other.cost.partial_cmp(&self.cost) [INFO] [stdout] 183 | | } [INFO] [stdout] 184 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 181 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 182 - other.cost.partial_cmp(&self.cost) [INFO] [stdout] 183 - } [INFO] [stdout] 181 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 32.24s [INFO] running `Command { std: "docker" "inspect" "3fb58dab3053382035e8fc89f42319d19ab5c3b329aa02a1fa869c0323830025", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3fb58dab3053382035e8fc89f42319d19ab5c3b329aa02a1fa869c0323830025", kill_on_drop: false }` [INFO] [stdout] 3fb58dab3053382035e8fc89f42319d19ab5c3b329aa02a1fa869c0323830025