[INFO] cloning repository https://github.com/abe-bb/AdventOfCode [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/abe-bb/AdventOfCode" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fabe-bb%2FAdventOfCode", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fabe-bb%2FAdventOfCode'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 7816a16055d8edac25fdc472364a3daf6881c2e8 [INFO] linting abe-bb/AdventOfCode against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fabe-bb%2FAdventOfCode" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/abe-bb/AdventOfCode [INFO] finished tweaking git repo https://github.com/abe-bb/AdventOfCode [INFO] tweaked toml for git repo https://github.com/abe-bb/AdventOfCode written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/abe-bb/AdventOfCode 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/abe-bb/AdventOfCode 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] Downloading crates ... [INFO] [stderr] Downloaded itertools v0.12.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 228ddbc5f9f739e988ac82e3e31cfa251acb82cf7504cd6268982045d28e0d0c [INFO] running `Command { std: "docker" "start" "-a" "228ddbc5f9f739e988ac82e3e31cfa251acb82cf7504cd6268982045d28e0d0c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "228ddbc5f9f739e988ac82e3e31cfa251acb82cf7504cd6268982045d28e0d0c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "228ddbc5f9f739e988ac82e3e31cfa251acb82cf7504cd6268982045d28e0d0c", kill_on_drop: false }` [INFO] [stdout] 228ddbc5f9f739e988ac82e3e31cfa251acb82cf7504cd6268982045d28e0d0c [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 84cdd41e305fcb20108b2aaa97e95c667b79d07ccaed53f50d6a08a9797fdd8c [INFO] running `Command { std: "docker" "start" "-a" "84cdd41e305fcb20108b2aaa97e95c667b79d07ccaed53f50d6a08a9797fdd8c", kill_on_drop: false }` [INFO] [stderr] Checking bytemuck v1.20.0 [INFO] [stderr] Compiling matrixmultiply v0.3.9 [INFO] [stderr] Checking memchr v2.7.4 [INFO] [stderr] Checking itertools v0.12.0 [INFO] [stderr] Checking num-integer v0.1.46 [INFO] [stderr] Checking num-complex v0.4.6 [INFO] [stderr] Checking approx v0.5.1 [INFO] [stderr] Compiling syn v2.0.90 [INFO] [stderr] Checking safe_arch v0.7.2 [INFO] [stderr] Checking num-rational v0.4.2 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking wide v0.7.30 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking simba v0.9.0 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Compiling nalgebra-macros v0.2.2 [INFO] [stderr] Checking nalgebra v0.33.2 [INFO] [stderr] Checking advent_of_code v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/years/year2023.rs:1261:13 [INFO] [stdout] | [INFO] [stdout] 1261 | 1 << wins - 1 [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (wins - 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] = note: `#[warn(clippy::precedence)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: operator precedence might not be obvious [INFO] [stdout] --> src/years/year2023.rs:1261:13 [INFO] [stdout] | [INFO] [stdout] 1261 | 1 << wins - 1 [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (wins - 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#precedence [INFO] [stdout] = note: `#[warn(clippy::precedence)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/years/year2022.rs:50:12 [INFO] [stdout] | [INFO] [stdout] 50 | if self.trees.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.trees.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/years/year2022.rs:136:12 [INFO] [stdout] | [INFO] [stdout] 136 | if self.trees.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.trees.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: manual implementation of `Iterator::find` [INFO] [stdout] --> src/years/year2022.rs:324:9 [INFO] [stdout] | [INFO] [stdout] 324 | / for item in self.contents.iter_mut() { [INFO] [stdout] 325 | | if item.name() == name { [INFO] [stdout] 326 | | return Some(item); [INFO] [stdout] ... | [INFO] [stdout] 329 | | None [INFO] [stdout] | |____________^ help: replace with an iterator: `self.contents.iter_mut().find(|item| item.name() == name).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [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/years/year2022.rs:481:33 [INFO] [stdout] | [INFO] [stdout] 481 | fn parse_cargo_line(cargo_hold: &mut Vec>, line: &str) { [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] 481 - fn parse_cargo_line(cargo_hold: &mut Vec>, line: &str) { [INFO] [stdout] 481 + fn parse_cargo_line(cargo_hold: &mut [Vec], line: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2022.rs:486:9 [INFO] [stdout] | [INFO] [stdout] 486 | / if i == 1 || (i >= 4 && ((i - 1) % 4) == 0) { [INFO] [stdout] 487 | | if current_crate.is_alphabetic() { [INFO] [stdout] 488 | | let index = i / 4; [INFO] [stdout] 489 | | cargo_hold[index].push(current_crate); [INFO] [stdout] 490 | | } [INFO] [stdout] 491 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 486 ~ if (i == 1 || (i >= 4 && ((i - 1) % 4) == 0)) { [INFO] [stdout] 487 ~ && current_crate.is_alphabetic() { [INFO] [stdout] 488 | let index = i / 4; [INFO] [stdout] 489 | cargo_hold[index].push(current_crate); [INFO] [stdout] 490 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/years/year2022.rs:536:14 [INFO] [stdout] | [INFO] [stdout] 536 | .filter(|item| item.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 537 | | .map(|item| item.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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/years/year2022.rs:634:13 [INFO] [stdout] | [INFO] [stdout] 634 | assert!(rucksacks.len() % group_size == 0, "Incomplete groups found in input"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `rucksacks.len().is_multiple_of(group_size)` [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: you seem to be trying to use `Box`. Consider using just `String` [INFO] [stdout] --> src/years/year2022.rs:651:12 [INFO] [stdout] | [INFO] [stdout] 651 | total: Box, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `String` is already on the heap, `Box` makes an extra allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#box_collection [INFO] [stdout] = note: `#[warn(clippy::box_collection)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/years/year2022.rs:661:17 [INFO] [stdout] | [INFO] [stdout] 661 | assert!(inventory.len() % 2 == 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `inventory.len().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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/years/year2022.rs:692:16 [INFO] [stdout] | [INFO] [stdout] 692 | if let None = common_item { panic!("Unable to find matching item in Rucksack") } [INFO] [stdout] | -------^^^^-------------- help: try: `if common_item.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RPS` contains a capitalized acronym [INFO] [stdout] --> src/years/year2022.rs:799:6 [INFO] [stdout] | [INFO] [stdout] 799 | enum RPS { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rps` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/years/year2022.rs:871:5 [INFO] [stdout] | [INFO] [stdout] 871 | / for line in lines_iter { [INFO] [stdout] 872 | | if let Ok(x) = line { [INFO] [stdout] 873 | | if x.trim().is_empty() { [INFO] [stdout] 874 | | total_calories.push(elf_total); [INFO] [stdout] ... | [INFO] [stdout] 882 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/years/year2022.rs:872:9 [INFO] [stdout] | [INFO] [stdout] 872 | / if let Ok(x) = line { [INFO] [stdout] 873 | | if x.trim().is_empty() { [INFO] [stdout] 874 | | total_calories.push(elf_total); [INFO] [stdout] 875 | | elf_total = 0; [INFO] [stdout] ... | [INFO] [stdout] 881 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 871 ~ for x in lines_iter.flatten() { [INFO] [stdout] 872 + if x.trim().is_empty() { [INFO] [stdout] 873 + total_calories.push(elf_total); [INFO] [stdout] 874 + elf_total = 0; [INFO] [stdout] 875 + } [INFO] [stdout] 876 + else { [INFO] [stdout] 877 + let single_item: usize = x.parse().expect("unable to parse a valid usize from input"); [INFO] [stdout] 878 + elf_total += single_item; [INFO] [stdout] 879 + } [INFO] [stdout] 880 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/years/year2023.rs:153:1 [INFO] [stdout] | [INFO] [stdout] 153 | / impl ToString for GalaxyMap { [INFO] [stdout] 154 | | fn to_string(&self) -> String { [INFO] [stdout] 155 | | self.map [INFO] [stdout] 156 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 168 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2023.rs:216:9 [INFO] [stdout] | [INFO] [stdout] 216 | / if row > 0 { [INFO] [stdout] 217 | | if (!self.grid[row - 1][col].visited || ignore_visited) [INFO] [stdout] 218 | | && current.connections[0] [INFO] [stdout] 219 | | && self.grid[row - 1][col].connections[2] [INFO] [stdout] ... | [INFO] [stdout] 223 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 216 ~ if row > 0 [INFO] [stdout] 217 ~ && (!self.grid[row - 1][col].visited || ignore_visited) [INFO] [stdout] 218 | && current.connections[0] [INFO] [stdout] ... [INFO] [stdout] 221 | connections.push((row - 1, col)); [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2023.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | / if row < (self.grid.len() - 1) { [INFO] [stdout] 226 | | if (!self.grid[row + 1][col].visited || ignore_visited) [INFO] [stdout] 227 | | && current.connections[2] [INFO] [stdout] 228 | | && self.grid[row + 1][col].connections[0] [INFO] [stdout] ... | [INFO] [stdout] 232 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 225 ~ if row < (self.grid.len() - 1) [INFO] [stdout] 226 ~ && (!self.grid[row + 1][col].visited || ignore_visited) [INFO] [stdout] 227 | && current.connections[2] [INFO] [stdout] ... [INFO] [stdout] 230 | connections.push((row + 1, col)); [INFO] [stdout] 231 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2023.rs:234:9 [INFO] [stdout] | [INFO] [stdout] 234 | / if col > 0 { [INFO] [stdout] 235 | | if (!self.grid[row][col - 1].visited || ignore_visited) [INFO] [stdout] 236 | | && current.connections[3] [INFO] [stdout] 237 | | && self.grid[row][col - 1].connections[1] [INFO] [stdout] ... | [INFO] [stdout] 241 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 234 ~ if col > 0 [INFO] [stdout] 235 ~ && (!self.grid[row][col - 1].visited || ignore_visited) [INFO] [stdout] 236 | && current.connections[3] [INFO] [stdout] ... [INFO] [stdout] 239 | connections.push((row, col - 1)); [INFO] [stdout] 240 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2023.rs:243:9 [INFO] [stdout] | [INFO] [stdout] 243 | / if col < self.grid[row].len() - 1 { [INFO] [stdout] 244 | | if (!self.grid[row][col + 1].visited || ignore_visited) [INFO] [stdout] 245 | | && current.connections[1] [INFO] [stdout] 246 | | && self.grid[row][col + 1].connections[3] [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 243 ~ if col < self.grid[row].len() - 1 [INFO] [stdout] 244 ~ && (!self.grid[row][col + 1].visited || ignore_visited) [INFO] [stdout] 245 | && current.connections[1] [INFO] [stdout] ... [INFO] [stdout] 248 | connections.push((row, col + 1)); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/years/year2023.rs:259:28 [INFO] [stdout] | [INFO] [stdout] 259 | p_queue.push_front(self.start.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.start` [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: length comparison to zero [INFO] [stdout] --> src/years/year2023.rs:522:16 [INFO] [stdout] | [INFO] [stdout] 522 | if differences.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!differences.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: manual implementation of an assign operation [INFO] [stdout] --> src/years/year2023.rs:548:9 [INFO] [stdout] | [INFO] [stdout] 548 | forward_prediction = diffs.last().unwrap() + forward_prediction; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `forward_prediction += diffs.last().unwrap()` [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: iterating on a map's keys [INFO] [stdout] --> src/years/year2023.rs:583:17 [INFO] [stdout] | [INFO] [stdout] 583 | let nodes = adjacency [INFO] [stdout] | _________________^ [INFO] [stdout] 584 | | .adjacency [INFO] [stdout] 585 | | .iter() [INFO] [stdout] 586 | | .filter_map(|(key, _)| -> Option<&str> { [INFO] [stdout] ... | [INFO] [stdout] 592 | | }) [INFO] [stdout] | |__________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 583 ~ let nodes = adjacency [INFO] [stdout] 584 + .adjacency.keys().filter_map(|key| { [INFO] [stdout] 585 + if key.as_bytes()[2] as char == 'A' { [INFO] [stdout] 586 + Some(key) [INFO] [stdout] 587 + } else { [INFO] [stdout] 588 + None [INFO] [stdout] 589 + } [INFO] [stdout] 590 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/years/year2023.rs:682:21 [INFO] [stdout] | [INFO] [stdout] 682 | pub fn turn<'a, 'b>(&'a self, node: &'b str, left: bool) -> &'a str { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 682 - pub fn turn<'a, 'b>(&'a self, node: &'b str, left: bool) -> &'a str { [INFO] [stdout] 682 + pub fn turn<'a>(&'a self, node: &str, left: bool) -> &'a str { [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/years/year2023.rs:701:23 [INFO] [stdout] | [INFO] [stdout] 701 | fn day7p2_logic(bids: &Vec<(Hand, u64)>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 701 - fn day7p2_logic(bids: &Vec<(Hand, u64)>) -> u64 { [INFO] [stdout] 701 + fn day7p2_logic(bids: &[(Hand, u64)]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/years/year2023.rs:876:14 [INFO] [stdout] | [INFO] [stdout] 876 | .zip(records.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 876 - .zip(records.into_iter()) [INFO] [stdout] 876 + .zip(records) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/years/year2023.rs:932:5 [INFO] [stdout] | [INFO] [stdout] 932 | location_ranges.sort_unstable_by(|span1, span2| span1.start.cmp(&span2.start)); [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] 932 - location_ranges.sort_unstable_by(|span1, span2| span1.start.cmp(&span2.start)); [INFO] [stdout] 932 + location_ranges.sort_unstable_by_key(|span1| span1.start); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/years/year2023.rs:974:5 [INFO] [stdout] | [INFO] [stdout] 974 | while let Some(line) = line_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in line_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `years::year2023::Span` [INFO] [stdout] --> src/years/year2023.rs:1027:5 [INFO] [stdout] | [INFO] [stdout] 1027 | / pub fn to_string(&self) -> String { [INFO] [stdout] 1028 | | format!("{}--{}", self.start, self.start + self.range) [INFO] [stdout] 1029 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `years::year2023::Span` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` 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/years/year2023.rs:1210:24 [INFO] [stdout] | [INFO] [stdout] 1210 | fn day4p1_logic(cards: &Vec) -> 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] 1210 - fn day4p1_logic(cards: &Vec) -> usize { [INFO] [stdout] 1210 + fn day4p1_logic(cards: &[Card]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/years/year2023.rs:1223:9 [INFO] [stdout] | [INFO] [stdout] 1223 | while let Some(token) = tokens_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for token in tokens_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/years/year2023.rs:1232:9 [INFO] [stdout] | [INFO] [stdout] 1232 | while let Some(token) = tokens_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for token in tokens_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `str::repeat` using iterators [INFO] [stdout] --> src/years/year2023.rs:1286:29 [INFO] [stdout] | [INFO] [stdout] 1286 | let prev_line: String = iter::repeat('.').take(line_length).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `".".repeat(line_length)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat [INFO] [stdout] = note: `#[warn(clippy::manual_str_repeat)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/years/year2023.rs:1286:29 [INFO] [stdout] | [INFO] [stdout] 1286 | let prev_line: String = iter::repeat('.').take(line_length).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('.', line_length)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/years/year2023.rs:1289:45 [INFO] [stdout] | [INFO] [stdout] 1289 | let mut reader_iter = reader_iter.chain(last_line.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 1289 - let mut reader_iter = reader_iter.chain(last_line.into_iter()); [INFO] [stdout] 1289 + let mut reader_iter = reader_iter.chain(last_line); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `line_num` is used as a loop counter [INFO] [stdout] --> src/years/year2023.rs:1300:5 [INFO] [stdout] | [INFO] [stdout] 1300 | for next_line in reader_iter { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (line_num, next_line) in reader_iter.enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/years/year2022.rs:50:12 [INFO] [stdout] | [INFO] [stdout] 50 | if self.trees.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.trees.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2023.rs:1385:12 [INFO] [stdout] | [INFO] [stdout] 1385 | gears: &mut Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1385 - gears: &mut Vec>, [INFO] [stdout] 1385 + gears: &mut [HashMap], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `lines` [INFO] [stdout] --> src/years/year2023.rs:1394:18 [INFO] [stdout] | [INFO] [stdout] 1394 | for i in from..to { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 1394 - for i in from..to { [INFO] [stdout] 1394 + for (i, ) in lines.iter().enumerate().take(to).skip(from) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `str::repeat` using iterators [INFO] [stdout] --> src/years/year2023.rs:1414:29 [INFO] [stdout] | [INFO] [stdout] 1414 | let prev_line: String = iter::repeat('.').take(line_length).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `".".repeat(line_length)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/years/year2023.rs:1414:29 [INFO] [stdout] | [INFO] [stdout] 1414 | let prev_line: String = iter::repeat('.').take(line_length).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('.', line_length)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/years/year2023.rs:1417:45 [INFO] [stdout] | [INFO] [stdout] 1417 | let mut reader_iter = reader_iter.chain(last_line.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 1417 - let mut reader_iter = reader_iter.chain(last_line.into_iter()); [INFO] [stdout] 1417 + let mut reader_iter = reader_iter.chain(last_line); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/years/year2022.rs:136:12 [INFO] [stdout] | [INFO] [stdout] 136 | if self.trees.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.trees.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: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/years/year2023.rs:1485:5 [INFO] [stdout] | [INFO] [stdout] 1485 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 1485 - print!("\n"); [INFO] [stdout] 1485 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/years/year2023.rs:1495:46 [INFO] [stdout] | [INFO] [stdout] 1495 | if !(arr[i].is_ascii_digit()) && !(arr[i] == '.') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `(arr[i] != '.')` [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: the loop variable `i` is only used to index `arr` [INFO] [stdout] --> src/years/year2023.rs:1494:18 [INFO] [stdout] | [INFO] [stdout] 1494 | for i in from..to { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 1494 - for i in from..to { [INFO] [stdout] 1494 + for in arr.iter().take(to).skip(from) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/years/year2022.rs:324:9 [INFO] [stdout] | [INFO] [stdout] 324 | / for item in self.contents.iter_mut() { [INFO] [stdout] 325 | | if item.name() == name { [INFO] [stdout] 326 | | return Some(item); [INFO] [stdout] ... | [INFO] [stdout] 329 | | None [INFO] [stdout] | |____________^ help: replace with an iterator: `self.contents.iter_mut().find(|item| item.name() == name).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Lines` [INFO] [stdout] --> src/years/year2023.rs:1513:17 [INFO] [stdout] | [INFO] [stdout] 1513 | for game in reader.lines().into_iter().map(|x| x.unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `reader.lines()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Lines` [INFO] [stdout] --> src/years/year2023.rs:1523:17 [INFO] [stdout] | [INFO] [stdout] 1523 | for game in reader.lines().into_iter().map(|x| x.unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `reader.lines()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [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/years/year2022.rs:481:33 [INFO] [stdout] | [INFO] [stdout] 481 | fn parse_cargo_line(cargo_hold: &mut Vec>, line: &str) { [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] 481 - fn parse_cargo_line(cargo_hold: &mut Vec>, line: &str) { [INFO] [stdout] 481 + fn parse_cargo_line(cargo_hold: &mut [Vec], line: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/years/year2023.rs:1632:14 [INFO] [stdout] | [INFO] [stdout] 1632 | .map(|x| recover_calibration_value(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `recover_calibration_value` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2022.rs:486:9 [INFO] [stdout] | [INFO] [stdout] 486 | / if i == 1 || (i >= 4 && ((i - 1) % 4) == 0) { [INFO] [stdout] 487 | | if current_crate.is_alphabetic() { [INFO] [stdout] 488 | | let index = i / 4; [INFO] [stdout] 489 | | cargo_hold[index].push(current_crate); [INFO] [stdout] 490 | | } [INFO] [stdout] 491 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 486 ~ if (i == 1 || (i >= 4 && ((i - 1) % 4) == 0)) { [INFO] [stdout] 487 ~ && current_crate.is_alphabetic() { [INFO] [stdout] 488 | let index = i / 4; [INFO] [stdout] 489 | cargo_hold[index].push(current_crate); [INFO] [stdout] 490 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/years/year2023.rs:1631:14 [INFO] [stdout] | [INFO] [stdout] 1631 | .map(|x| insert_digits_from_text(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `insert_digits_from_text` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/years/year2023.rs:1680:5 [INFO] [stdout] | [INFO] [stdout] 1679 | let result = result.parse::().unwrap(); [INFO] [stdout] | -------------------------------------------- unnecessary `let` binding [INFO] [stdout] 1680 | result [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] 1679 ~ [INFO] [stdout] 1680 ~ result.parse::().unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/years/year2023.rs:1670:16 [INFO] [stdout] | [INFO] [stdout] 1670 | if let None = digits[0] { [INFO] [stdout] | -------^^^^------------ help: try: `if digits[0].is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/years/year2022.rs:536:14 [INFO] [stdout] | [INFO] [stdout] 536 | .filter(|item| item.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 537 | | .map(|item| item.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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/years/year2022.rs:634:13 [INFO] [stdout] | [INFO] [stdout] 634 | assert!(rucksacks.len() % group_size == 0, "Incomplete groups found in input"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `rucksacks.len().is_multiple_of(group_size)` [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: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/years/year2023.rs:1870:9 [INFO] [stdout] | [INFO] [stdout] 1870 | location_ranges.sort_unstable_by(|span1, span2| span1.start.cmp(&span2.start)); [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] help: try [INFO] [stdout] | [INFO] [stdout] 1870 - location_ranges.sort_unstable_by(|span1, span2| span1.start.cmp(&span2.start)); [INFO] [stdout] 1870 + location_ranges.sort_unstable_by_key(|span1| span1.start); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `Box`. Consider using just `String` [INFO] [stdout] --> src/years/year2022.rs:651:12 [INFO] [stdout] | [INFO] [stdout] 651 | total: Box, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `String` is already on the heap, `Box` makes an extra allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#box_collection [INFO] [stdout] = note: `#[warn(clippy::box_collection)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/years/year2022.rs:661:17 [INFO] [stdout] | [INFO] [stdout] 661 | assert!(inventory.len() % 2 == 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `inventory.len().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: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/years/year2022.rs:692:16 [INFO] [stdout] | [INFO] [stdout] 692 | if let None = common_item { panic!("Unable to find matching item in Rucksack") } [INFO] [stdout] | -------^^^^-------------- help: try: `if common_item.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RPS` contains a capitalized acronym [INFO] [stdout] --> src/years/year2022.rs:799:6 [INFO] [stdout] | [INFO] [stdout] 799 | enum RPS { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rps` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/years/year2022.rs:871:5 [INFO] [stdout] | [INFO] [stdout] 871 | / for line in lines_iter { [INFO] [stdout] 872 | | if let Ok(x) = line { [INFO] [stdout] 873 | | if x.trim().is_empty() { [INFO] [stdout] 874 | | total_calories.push(elf_total); [INFO] [stdout] ... | [INFO] [stdout] 882 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/years/year2022.rs:872:9 [INFO] [stdout] | [INFO] [stdout] 872 | / if let Ok(x) = line { [INFO] [stdout] 873 | | if x.trim().is_empty() { [INFO] [stdout] 874 | | total_calories.push(elf_total); [INFO] [stdout] 875 | | elf_total = 0; [INFO] [stdout] ... | [INFO] [stdout] 881 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 871 ~ for x in lines_iter.flatten() { [INFO] [stdout] 872 + if x.trim().is_empty() { [INFO] [stdout] 873 + total_calories.push(elf_total); [INFO] [stdout] 874 + elf_total = 0; [INFO] [stdout] 875 + } [INFO] [stdout] 876 + else { [INFO] [stdout] 877 + let single_item: usize = x.parse().expect("unable to parse a valid usize from input"); [INFO] [stdout] 878 + elf_total += single_item; [INFO] [stdout] 879 + } [INFO] [stdout] 880 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:59:16 [INFO] [stdout] | [INFO] [stdout] 59 | fn day6p1(map: &mut Vec>, guard: &mut GuardLocation) -> (usize, 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] 59 - fn day6p1(map: &mut Vec>, guard: &mut GuardLocation) -> (usize, bool) { [INFO] [stdout] 59 + fn day6p1(map: &mut [Vec], guard: &mut GuardLocation) -> (usize, bool) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/years/year2023.rs:153:1 [INFO] [stdout] | [INFO] [stdout] 153 | / impl ToString for GalaxyMap { [INFO] [stdout] 154 | | fn to_string(&self) -> String { [INFO] [stdout] 155 | | self.map [INFO] [stdout] 156 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 168 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2023.rs:216:9 [INFO] [stdout] | [INFO] [stdout] 216 | / if row > 0 { [INFO] [stdout] 217 | | if (!self.grid[row - 1][col].visited || ignore_visited) [INFO] [stdout] 218 | | && current.connections[0] [INFO] [stdout] 219 | | && self.grid[row - 1][col].connections[2] [INFO] [stdout] ... | [INFO] [stdout] 223 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 216 ~ if row > 0 [INFO] [stdout] 217 ~ && (!self.grid[row - 1][col].visited || ignore_visited) [INFO] [stdout] 218 | && current.connections[0] [INFO] [stdout] ... [INFO] [stdout] 221 | connections.push((row - 1, col)); [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2023.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | / if row < (self.grid.len() - 1) { [INFO] [stdout] 226 | | if (!self.grid[row + 1][col].visited || ignore_visited) [INFO] [stdout] 227 | | && current.connections[2] [INFO] [stdout] 228 | | && self.grid[row + 1][col].connections[0] [INFO] [stdout] ... | [INFO] [stdout] 232 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 225 ~ if row < (self.grid.len() - 1) [INFO] [stdout] 226 ~ && (!self.grid[row + 1][col].visited || ignore_visited) [INFO] [stdout] 227 | && current.connections[2] [INFO] [stdout] ... [INFO] [stdout] 230 | connections.push((row + 1, col)); [INFO] [stdout] 231 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:218:58 [INFO] [stdout] | [INFO] [stdout] 218 | fn day5p2_logic(rules: &HashMap>, updates: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 218 - fn day5p2_logic(rules: &HashMap>, updates: &mut Vec>) { [INFO] [stdout] 218 + fn day5p2_logic(rules: &HashMap>, updates: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2023.rs:234:9 [INFO] [stdout] | [INFO] [stdout] 234 | / if col > 0 { [INFO] [stdout] 235 | | if (!self.grid[row][col - 1].visited || ignore_visited) [INFO] [stdout] 236 | | && current.connections[3] [INFO] [stdout] 237 | | && self.grid[row][col - 1].connections[1] [INFO] [stdout] ... | [INFO] [stdout] 241 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 234 ~ if col > 0 [INFO] [stdout] 235 ~ && (!self.grid[row][col - 1].visited || ignore_visited) [INFO] [stdout] 236 | && current.connections[3] [INFO] [stdout] ... [INFO] [stdout] 239 | connections.push((row, col - 1)); [INFO] [stdout] 240 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/years/year2023.rs:243:9 [INFO] [stdout] | [INFO] [stdout] 243 | / if col < self.grid[row].len() - 1 { [INFO] [stdout] 244 | | if (!self.grid[row][col + 1].visited || ignore_visited) [INFO] [stdout] 245 | | && current.connections[1] [INFO] [stdout] 246 | | && self.grid[row][col + 1].connections[3] [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 243 ~ if col < self.grid[row].len() - 1 [INFO] [stdout] 244 ~ && (!self.grid[row][col + 1].visited || ignore_visited) [INFO] [stdout] 245 | && current.connections[1] [INFO] [stdout] ... [INFO] [stdout] 248 | connections.push((row, col + 1)); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/years/year2023.rs:259:28 [INFO] [stdout] | [INFO] [stdout] 259 | p_queue.push_front(self.start.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.start` [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: the loop variable `j` is used to index `update` [INFO] [stdout] --> src/years/year2024.rs:227:18 [INFO] [stdout] | [INFO] [stdout] 227 | for j in 0..update.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 227 - for j in 0..update.len() { [INFO] [stdout] 227 + for (j, ) in update.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/years/year2023.rs:522:16 [INFO] [stdout] | [INFO] [stdout] 522 | if differences.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!differences.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: manual implementation of an assign operation [INFO] [stdout] --> src/years/year2023.rs:548:9 [INFO] [stdout] | [INFO] [stdout] 548 | forward_prediction = diffs.last().unwrap() + forward_prediction; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `forward_prediction += diffs.last().unwrap()` [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: iterating on a map's keys [INFO] [stdout] --> src/years/year2023.rs:583:17 [INFO] [stdout] | [INFO] [stdout] 583 | let nodes = adjacency [INFO] [stdout] | _________________^ [INFO] [stdout] 584 | | .adjacency [INFO] [stdout] 585 | | .iter() [INFO] [stdout] 586 | | .filter_map(|(key, _)| -> Option<&str> { [INFO] [stdout] ... | [INFO] [stdout] 592 | | }) [INFO] [stdout] | |__________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 583 ~ let nodes = adjacency [INFO] [stdout] 584 + .adjacency.keys().filter_map(|key| { [INFO] [stdout] 585 + if key.as_bytes()[2] as char == 'A' { [INFO] [stdout] 586 + Some(key) [INFO] [stdout] 587 + } else { [INFO] [stdout] 588 + None [INFO] [stdout] 589 + } [INFO] [stdout] 590 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'b [INFO] [stdout] --> src/years/year2023.rs:682:21 [INFO] [stdout] | [INFO] [stdout] 682 | pub fn turn<'a, 'b>(&'a self, node: &'b str, left: bool) -> &'a str { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 682 - pub fn turn<'a, 'b>(&'a self, node: &'b str, left: bool) -> &'a str { [INFO] [stdout] 682 + pub fn turn<'a>(&'a self, node: &str, left: bool) -> &'a str { [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/years/year2024.rs:513:26 [INFO] [stdout] | [INFO] [stdout] 513 | fn day2p1_logic(reports: &Vec>) -> i32 { [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] 513 - fn day2p1_logic(reports: &Vec>) -> i32 { [INFO] [stdout] 513 + fn day2p1_logic(reports: &[Vec]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/years/year2024.rs:519:20 [INFO] [stdout] | [INFO] [stdout] 519 | if report.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `report.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2023.rs:701:23 [INFO] [stdout] | [INFO] [stdout] 701 | fn day7p2_logic(bids: &Vec<(Hand, u64)>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 701 - fn day7p2_logic(bids: &Vec<(Hand, u64)>) -> u64 { [INFO] [stdout] 701 + fn day7p2_logic(bids: &[(Hand, u64)]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:553:26 [INFO] [stdout] | [INFO] [stdout] 553 | fn day2p2_logic(reports: &Vec>) -> i32 { [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] 553 - fn day2p2_logic(reports: &Vec>) -> i32 { [INFO] [stdout] 553 + fn day2p2_logic(reports: &[Vec]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/years/year2024.rs:559:20 [INFO] [stdout] | [INFO] [stdout] 559 | if report.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `report.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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:635:24 [INFO] [stdout] | [INFO] [stdout] 635 | fn day1p1_logic(list1: &mut Vec, list2: &mut Vec) -> i32 { [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] 635 - fn day1p1_logic(list1: &mut Vec, list2: &mut Vec) -> i32 { [INFO] [stdout] 635 + fn day1p1_logic(list1: &mut [i32], list2: &mut Vec) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:635:46 [INFO] [stdout] | [INFO] [stdout] 635 | fn day1p1_logic(list1: &mut Vec, list2: &mut Vec) -> i32 { [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] 635 - fn day1p1_logic(list1: &mut Vec, list2: &mut Vec) -> i32 { [INFO] [stdout] 635 + fn day1p1_logic(list1: &mut Vec, list2: &mut [i32]) -> i32 { [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/years/year2024.rs:649:24 [INFO] [stdout] | [INFO] [stdout] 649 | fn day1p2_logic(list1: &Vec, list2: &Vec) -> i32 { [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] 649 - fn day1p2_logic(list1: &Vec, list2: &Vec) -> i32 { [INFO] [stdout] 649 + fn day1p2_logic(list1: &[i32], list2: &Vec) -> i32 { [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/years/year2024.rs:649:42 [INFO] [stdout] | [INFO] [stdout] 649 | fn day1p2_logic(list1: &Vec, list2: &Vec) -> i32 { [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] 649 - fn day1p2_logic(list1: &Vec, list2: &Vec) -> i32 { [INFO] [stdout] 649 + fn day1p2_logic(list1: &Vec, list2: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/years/year2023.rs:876:14 [INFO] [stdout] | [INFO] [stdout] 876 | .zip(records.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 876 - .zip(records.into_iter()) [INFO] [stdout] 876 + .zip(records) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/years/year2024.rs:661:25 [INFO] [stdout] | [INFO] [stdout] 661 | .filter_map(|x| rep_counter.get(x).and_then(|y| Some(x * y))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rep_counter.get(x).map(|y| x * y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/years/year2023.rs:932:5 [INFO] [stdout] | [INFO] [stdout] 932 | location_ranges.sort_unstable_by(|span1, span2| span1.start.cmp(&span2.start)); [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] 932 - location_ranges.sort_unstable_by(|span1, span2| span1.start.cmp(&span2.start)); [INFO] [stdout] 932 + location_ranges.sort_unstable_by_key(|span1| span1.start); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/lib.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | / let mut years = vec![]; [INFO] [stdout] 5 | | [INFO] [stdout] 6 | | years.push(years::year2022::init()); [INFO] [stdout] 7 | | years.push(years::year2023::init()); [INFO] [stdout] 8 | | years.push(years::year2024::init()); [INFO] [stdout] | |________________________________________^ help: consider using the `vec![]` macro: `let years = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:51:12 [INFO] [stdout] | [INFO] [stdout] 51 | if self.days.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.days.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/years/year2023.rs:974:5 [INFO] [stdout] | [INFO] [stdout] 974 | while let Some(line) = line_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in line_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `current_year` is used as a loop counter [INFO] [stdout] --> src/lib.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | for year in years.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (current_year, year) in (years[0].year()..).zip(years.iter())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `years::year2023::Span` [INFO] [stdout] --> src/years/year2023.rs:1027:5 [INFO] [stdout] | [INFO] [stdout] 1027 | / pub fn to_string(&self) -> String { [INFO] [stdout] 1028 | | format!("{}--{}", self.start, self.start + self.range) [INFO] [stdout] 1029 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `years::year2023::Span` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` 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/years/year2023.rs:1210:24 [INFO] [stdout] | [INFO] [stdout] 1210 | fn day4p1_logic(cards: &Vec) -> 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] 1210 - fn day4p1_logic(cards: &Vec) -> usize { [INFO] [stdout] 1210 + fn day4p1_logic(cards: &[Card]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/years/year2023.rs:1223:9 [INFO] [stdout] | [INFO] [stdout] 1223 | while let Some(token) = tokens_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for token in tokens_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/years/year2023.rs:1232:9 [INFO] [stdout] | [INFO] [stdout] 1232 | while let Some(token) = tokens_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for token in tokens_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `str::repeat` using iterators [INFO] [stdout] --> src/years/year2023.rs:1286:29 [INFO] [stdout] | [INFO] [stdout] 1286 | let prev_line: String = iter::repeat('.').take(line_length).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `".".repeat(line_length)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat [INFO] [stdout] = note: `#[warn(clippy::manual_str_repeat)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/years/year2023.rs:1286:29 [INFO] [stdout] | [INFO] [stdout] 1286 | let prev_line: String = iter::repeat('.').take(line_length).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('.', line_length)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/years/year2023.rs:1289:45 [INFO] [stdout] | [INFO] [stdout] 1289 | let mut reader_iter = reader_iter.chain(last_line.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 1289 - let mut reader_iter = reader_iter.chain(last_line.into_iter()); [INFO] [stdout] 1289 + let mut reader_iter = reader_iter.chain(last_line); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `line_num` is used as a loop counter [INFO] [stdout] --> src/years/year2023.rs:1300:5 [INFO] [stdout] | [INFO] [stdout] 1300 | for next_line in reader_iter { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (line_num, next_line) in reader_iter.enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2023.rs:1385:12 [INFO] [stdout] | [INFO] [stdout] 1385 | gears: &mut Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1385 - gears: &mut Vec>, [INFO] [stdout] 1385 + gears: &mut [HashMap], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `lines` [INFO] [stdout] --> src/years/year2023.rs:1394:18 [INFO] [stdout] | [INFO] [stdout] 1394 | for i in from..to { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 1394 - for i in from..to { [INFO] [stdout] 1394 + for (i, ) in lines.iter().enumerate().take(to).skip(from) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `str::repeat` using iterators [INFO] [stdout] --> src/years/year2023.rs:1414:29 [INFO] [stdout] | [INFO] [stdout] 1414 | let prev_line: String = iter::repeat('.').take(line_length).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `".".repeat(line_length)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/years/year2023.rs:1414:29 [INFO] [stdout] | [INFO] [stdout] 1414 | let prev_line: String = iter::repeat('.').take(line_length).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n('.', line_length)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/years/year2023.rs:1417:45 [INFO] [stdout] | [INFO] [stdout] 1417 | let mut reader_iter = reader_iter.chain(last_line.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 1417 - let mut reader_iter = reader_iter.chain(last_line.into_iter()); [INFO] [stdout] 1417 + let mut reader_iter = reader_iter.chain(last_line); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/years/year2023.rs:1485:5 [INFO] [stdout] | [INFO] [stdout] 1485 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 1485 - print!("\n"); [INFO] [stdout] 1485 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/years/year2023.rs:1495:46 [INFO] [stdout] | [INFO] [stdout] 1495 | if !(arr[i].is_ascii_digit()) && !(arr[i] == '.') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `(arr[i] != '.')` [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: the loop variable `i` is only used to index `arr` [INFO] [stdout] --> src/years/year2023.rs:1494:18 [INFO] [stdout] | [INFO] [stdout] 1494 | for i in from..to { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 1494 - for i in from..to { [INFO] [stdout] 1494 + for in arr.iter().take(to).skip(from) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Lines` [INFO] [stdout] --> src/years/year2023.rs:1513:17 [INFO] [stdout] | [INFO] [stdout] 1513 | for game in reader.lines().into_iter().map(|x| x.unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `reader.lines()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::io::Lines` [INFO] [stdout] --> src/years/year2023.rs:1523:17 [INFO] [stdout] | [INFO] [stdout] 1523 | for game in reader.lines().into_iter().map(|x| x.unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `reader.lines()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/years/year2023.rs:1632:14 [INFO] [stdout] | [INFO] [stdout] 1632 | .map(|x| recover_calibration_value(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `recover_calibration_value` [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/years/year2023.rs:1631:14 [INFO] [stdout] | [INFO] [stdout] 1631 | .map(|x| insert_digits_from_text(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `insert_digits_from_text` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/years/year2023.rs:1680:5 [INFO] [stdout] | [INFO] [stdout] 1679 | let result = result.parse::().unwrap(); [INFO] [stdout] | -------------------------------------------- unnecessary `let` binding [INFO] [stdout] 1680 | result [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] 1679 ~ [INFO] [stdout] 1680 ~ result.parse::().unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/years/year2023.rs:1670:16 [INFO] [stdout] | [INFO] [stdout] 1670 | if let None = digits[0] { [INFO] [stdout] | -------^^^^------------ help: try: `if digits[0].is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [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/years/year2024.rs:59:16 [INFO] [stdout] | [INFO] [stdout] 59 | fn day6p1(map: &mut Vec>, guard: &mut GuardLocation) -> (usize, 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] 59 - fn day6p1(map: &mut Vec>, guard: &mut GuardLocation) -> (usize, bool) { [INFO] [stdout] 59 + fn day6p1(map: &mut [Vec], guard: &mut GuardLocation) -> (usize, bool) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:218:58 [INFO] [stdout] | [INFO] [stdout] 218 | fn day5p2_logic(rules: &HashMap>, updates: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 218 - fn day5p2_logic(rules: &HashMap>, updates: &mut Vec>) { [INFO] [stdout] 218 + fn day5p2_logic(rules: &HashMap>, updates: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `update` [INFO] [stdout] --> src/years/year2024.rs:227:18 [INFO] [stdout] | [INFO] [stdout] 227 | for j in 0..update.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 227 - for j in 0..update.len() { [INFO] [stdout] 227 + for (j, ) in update.iter().enumerate() { [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/years/year2024.rs:513:26 [INFO] [stdout] | [INFO] [stdout] 513 | fn day2p1_logic(reports: &Vec>) -> i32 { [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] 513 - fn day2p1_logic(reports: &Vec>) -> i32 { [INFO] [stdout] 513 + fn day2p1_logic(reports: &[Vec]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/years/year2024.rs:519:20 [INFO] [stdout] | [INFO] [stdout] 519 | if report.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `report.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:553:26 [INFO] [stdout] | [INFO] [stdout] 553 | fn day2p2_logic(reports: &Vec>) -> i32 { [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] 553 - fn day2p2_logic(reports: &Vec>) -> i32 { [INFO] [stdout] 553 + fn day2p2_logic(reports: &[Vec]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/years/year2024.rs:559:20 [INFO] [stdout] | [INFO] [stdout] 559 | if report.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `report.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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:635:24 [INFO] [stdout] | [INFO] [stdout] 635 | fn day1p1_logic(list1: &mut Vec, list2: &mut Vec) -> i32 { [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] 635 - fn day1p1_logic(list1: &mut Vec, list2: &mut Vec) -> i32 { [INFO] [stdout] 635 + fn day1p1_logic(list1: &mut [i32], list2: &mut Vec) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/years/year2024.rs:635:46 [INFO] [stdout] | [INFO] [stdout] 635 | fn day1p1_logic(list1: &mut Vec, list2: &mut Vec) -> i32 { [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] 635 - fn day1p1_logic(list1: &mut Vec, list2: &mut Vec) -> i32 { [INFO] [stdout] 635 + fn day1p1_logic(list1: &mut Vec, list2: &mut [i32]) -> i32 { [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/years/year2024.rs:649:24 [INFO] [stdout] | [INFO] [stdout] 649 | fn day1p2_logic(list1: &Vec, list2: &Vec) -> i32 { [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] 649 - fn day1p2_logic(list1: &Vec, list2: &Vec) -> i32 { [INFO] [stdout] 649 + fn day1p2_logic(list1: &[i32], list2: &Vec) -> i32 { [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/years/year2024.rs:649:42 [INFO] [stdout] | [INFO] [stdout] 649 | fn day1p2_logic(list1: &Vec, list2: &Vec) -> i32 { [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] 649 - fn day1p2_logic(list1: &Vec, list2: &Vec) -> i32 { [INFO] [stdout] 649 + fn day1p2_logic(list1: &Vec, list2: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/years/year2024.rs:661:25 [INFO] [stdout] | [INFO] [stdout] 661 | .filter_map(|x| rep_counter.get(x).and_then(|y| Some(x * y))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rep_counter.get(x).map(|y| x * y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/lib.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | / let mut years = vec![]; [INFO] [stdout] 5 | | [INFO] [stdout] 6 | | years.push(years::year2022::init()); [INFO] [stdout] 7 | | years.push(years::year2023::init()); [INFO] [stdout] 8 | | years.push(years::year2024::init()); [INFO] [stdout] | |________________________________________^ help: consider using the `vec![]` macro: `let years = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/lib.rs:51:12 [INFO] [stdout] | [INFO] [stdout] 51 | if self.days.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.days.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `current_year` is used as a loop counter [INFO] [stdout] --> src/lib.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | for year in years.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (current_year, year) in (years[0].year()..).zip(years.iter())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/main.rs:13:14 [INFO] [stdout] | [INFO] [stdout] 13 | .expect(&format!("{} is not a valid year", args[1])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{} is not a valid year", args[1]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/main.rs:19:14 [INFO] [stdout] | [INFO] [stdout] 19 | .expect(&format!("{} is not a valid day", args[2])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{} is not a valid day", args[2]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/main.rs:13:14 [INFO] [stdout] | [INFO] [stdout] 13 | .expect(&format!("{} is not a valid year", args[1])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{} is not a valid year", args[1]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/main.rs:19:14 [INFO] [stdout] | [INFO] [stdout] 19 | .expect(&format!("{} is not a valid day", args[2])); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("{} is not a valid day", args[2]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 16.40s [INFO] running `Command { std: "docker" "inspect" "84cdd41e305fcb20108b2aaa97e95c667b79d07ccaed53f50d6a08a9797fdd8c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "84cdd41e305fcb20108b2aaa97e95c667b79d07ccaed53f50d6a08a9797fdd8c", kill_on_drop: false }` [INFO] [stdout] 84cdd41e305fcb20108b2aaa97e95c667b79d07ccaed53f50d6a08a9797fdd8c