[INFO] cloning repository https://github.com/shrav-k/aoc_2022 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/shrav-k/aoc_2022" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fshrav-k%2Faoc_2022", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fshrav-k%2Faoc_2022'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c9243928403dc7872ff5fac4a0d69ed6cdd37b23 [INFO] linting shrav-k/aoc_2022 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fshrav-k%2Faoc_2022" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/shrav-k/aoc_2022 [INFO] finished tweaking git repo https://github.com/shrav-k/aoc_2022 [INFO] tweaked toml for git repo https://github.com/shrav-k/aoc_2022 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/shrav-k/aoc_2022 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/shrav-k/aoc_2022 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded min-max-heap v1.3.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 8f5f836a379cebe5501bc058cd45da30c19d4a06acb0c1f15a447cb365a839b1 [INFO] running `Command { std: "docker" "start" "-a" "8f5f836a379cebe5501bc058cd45da30c19d4a06acb0c1f15a447cb365a839b1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "8f5f836a379cebe5501bc058cd45da30c19d4a06acb0c1f15a447cb365a839b1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8f5f836a379cebe5501bc058cd45da30c19d4a06acb0c1f15a447cb365a839b1", kill_on_drop: false }` [INFO] [stdout] 8f5f836a379cebe5501bc058cd45da30c19d4a06acb0c1f15a447cb365a839b1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] feba6442255156aef8c205a5213fab6cd74fd720bcfdbc6cd27b573ba73c2574 [INFO] running `Command { std: "docker" "start" "-a" "feba6442255156aef8c205a5213fab6cd74fd720bcfdbc6cd27b573ba73c2574", kill_on_drop: false }` [INFO] [stderr] Checking min-max-heap v1.3.0 [INFO] [stderr] Checking aoc_2022 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::cmp::Ordering` [INFO] [stdout] --> src/solutions/expedition/snack.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::cmp::Ordering; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp::Ordering` [INFO] [stdout] --> src/solutions/expedition/snack.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::cmp::Ordering; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/solutions/directory.rs:52:21 [INFO] [stdout] | [INFO] [stdout] 52 | let mut dir = dir_map.get_mut(&curr_dir).unwrap(); [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/solutions/directory.rs:124:9 [INFO] [stdout] | [INFO] [stdout] 124 | let mut dir = dir_map.get_mut(curr_dir).unwrap(); [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `solutions::directory::Directory` is more private than the item `solutions::directory::DirectoryMap` [INFO] [stdout] --> src/solutions/directory.rs:9:1 [INFO] [stdout] | [INFO] [stdout] 9 | pub type DirectoryMap = Arc>>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ type alias `solutions::directory::DirectoryMap` is reachable at visibility `pub(crate)` [INFO] [stdout] | [INFO] [stdout] note: but type `solutions::directory::Directory` is only usable at visibility `pub(self)` [INFO] [stdout] --> src/solutions/directory.rs:12:1 [INFO] [stdout] | [INFO] [stdout] 12 | struct Directory { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(private_interfaces)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_cleanup` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_cleanup(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_cleanup_2` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn read_cleanup_2(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `overlap` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:33:4 [INFO] [stdout] | [INFO] [stdout] 33 | fn overlap(ranges: Vec) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `contained` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:40:4 [INFO] [stdout] | [INFO] [stdout] 40 | fn contained(ranges: Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_ranges` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:45:4 [INFO] [stdout] | [INFO] [stdout] 45 | fn get_ranges(sections: String) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_crates` is never used [INFO] [stdout] --> src/solutions/crates.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_crates(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `index_map` is never used [INFO] [stdout] --> src/solutions/crates.rs:87:4 [INFO] [stdout] | [INFO] [stdout] 87 | fn index_map(index: &str, original: &str) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `addr_of` is never used [INFO] [stdout] --> src/solutions/crates.rs:91:4 [INFO] [stdout] | [INFO] [stdout] 91 | fn addr_of(s: &str) -> usize { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_datastream` is never used [INFO] [stdout] --> src/solutions/datastream.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn read_datastream(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `non_repeating` is never used [INFO] [stdout] --> src/solutions/datastream.rs:9:4 [INFO] [stdout] | [INFO] [stdout] 9 | fn non_repeating(line: String) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `DirectoryMap` is never used [INFO] [stdout] --> src/solutions/directory.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | pub type DirectoryMap = Arc>>; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Directory` is never constructed [INFO] [stdout] --> src/solutions/directory.rs:12:8 [INFO] [stdout] | [INFO] [stdout] 12 | struct Directory { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_directory` is never used [INFO] [stdout] --> src/solutions/directory.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn read_directory(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `small_sizes` is never used [INFO] [stdout] --> src/solutions/directory.rs:102:4 [INFO] [stdout] | [INFO] [stdout] 102 | fn small_sizes(dir_map_lock: DirectoryMap, curr_dir: &str) -> (u64, u64) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parent` is never used [INFO] [stdout] --> src/solutions/directory.rs:131:4 [INFO] [stdout] | [INFO] [stdout] 131 | fn parent(path: &str) -> &str { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Expedition` is never constructed [INFO] [stdout] --> src/solutions/expedition.rs:11:12 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct Expedition { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_elf`, `most_calories`, and `top_k_calories` are never used [INFO] [stdout] --> src/solutions/expedition.rs:16:12 [INFO] [stdout] | [INFO] [stdout] 15 | impl Expedition { [INFO] [stdout] | --------------- methods in this implementation [INFO] [stdout] 16 | pub fn add_elf(&mut self, elf: Elf) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 20 | pub fn most_calories(&self) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 27 | pub fn top_k_calories(&mut self, k: u64) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_expedition` is never used [INFO] [stdout] --> src/solutions/expedition.rs:39:8 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn read_expedition(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Elf` is never constructed [INFO] [stdout] --> src/solutions/expedition/elf.rs:7:12 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct Elf { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_snack` and `add_snacks` are never used [INFO] [stdout] --> src/solutions/expedition/elf.rs:33:12 [INFO] [stdout] | [INFO] [stdout] 32 | impl Elf { [INFO] [stdout] | -------- methods in this implementation [INFO] [stdout] 33 | pub fn add_snack(&mut self, calories: u64) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 41 | pub fn add_snacks(&mut self, cal_vec: &Vec) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Snack` is never constructed [INFO] [stdout] --> src/solutions/expedition/snack.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Snack { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rope` is never used [INFO] [stdout] --> src/solutions/rope.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_rope(path: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rope_2` is never used [INFO] [stdout] --> src/solutions/rope.rs:50:8 [INFO] [stdout] | [INFO] [stdout] 50 | pub fn read_rope_2(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `tail_move` is never used [INFO] [stdout] --> src/solutions/rope.rs:104:4 [INFO] [stdout] | [INFO] [stdout] 104 | fn tail_move(head: (i32, i32), tail: (i32, i32)) -> (i32, i32) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rps` is never used [INFO] [stdout] --> src/solutions/rps.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_rps(path: &str) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rps_2` is never used [INFO] [stdout] --> src/solutions/rps.rs:26:8 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn read_rps_2(path: &str) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rucksack_2` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_rucksack_2(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_badge_value` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:21:4 [INFO] [stdout] | [INFO] [stdout] 21 | fn get_badge_value(rucksacks: &Vec) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_badge` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:34:4 [INFO] [stdout] | [INFO] [stdout] 34 | fn get_badge(first: &str, second: &str, third: &str) -> char { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rucksack` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn read_rucksack(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_shared_priority` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:56:4 [INFO] [stdout] | [INFO] [stdout] 56 | fn get_shared_priority(items: String) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_shared_char` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:67:4 [INFO] [stdout] | [INFO] [stdout] 67 | fn get_shared_char(first: &str, second: &str) -> char { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_priority` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:76:4 [INFO] [stdout] | [INFO] [stdout] 76 | fn get_priority(c: char) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_signal` is never used [INFO] [stdout] --> src/solutions/signal.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn read_signal(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_trees` is never used [INFO] [stdout] --> src/solutions/trees.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn read_trees(path: &str) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `visible_trees` is never used [INFO] [stdout] --> src/solutions/trees.rs:21:4 [INFO] [stdout] | [INFO] [stdout] 21 | fn visible_trees(trees: Vec>) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `max_scenic_score` is never used [INFO] [stdout] --> src/solutions/trees.rs:99:4 [INFO] [stdout] | [INFO] [stdout] 99 | fn max_scenic_score(trees: Vec>) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/cleanup.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | / for line in lines { [INFO] [stdout] 7 | | if let Ok(sections) = line { [INFO] [stdout] 8 | | let ranges = get_ranges(sections); [INFO] [stdout] 9 | | if contained(ranges) { [INFO] [stdout] ... | [INFO] [stdout] 13 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/cleanup.rs:7:13 [INFO] [stdout] | [INFO] [stdout] 7 | / if let Ok(sections) = line { [INFO] [stdout] 8 | | let ranges = get_ranges(sections); [INFO] [stdout] 9 | | if contained(ranges) { [INFO] [stdout] 10 | | pairs += 1 [INFO] [stdout] 11 | | } [INFO] [stdout] 12 | | } [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] 6 ~ for sections in lines.flatten() { [INFO] [stdout] 7 + let ranges = get_ranges(sections); [INFO] [stdout] 8 + if contained(ranges) { [INFO] [stdout] 9 + pairs += 1 [INFO] [stdout] 10 + } [INFO] [stdout] 11 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/cleanup.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | / for line in lines { [INFO] [stdout] 22 | | if let Ok(sections) = line { [INFO] [stdout] 23 | | let ranges = get_ranges(sections); [INFO] [stdout] 24 | | if overlap(ranges) { [INFO] [stdout] ... | [INFO] [stdout] 28 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/cleanup.rs:22:13 [INFO] [stdout] | [INFO] [stdout] 22 | / if let Ok(sections) = line { [INFO] [stdout] 23 | | let ranges = get_ranges(sections); [INFO] [stdout] 24 | | if overlap(ranges) { [INFO] [stdout] 25 | | pairs += 1 [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 21 ~ for sections in lines.flatten() { [INFO] [stdout] 22 + let ranges = get_ranges(sections); [INFO] [stdout] 23 + if overlap(ranges) { [INFO] [stdout] 24 + pairs += 1 [INFO] [stdout] 25 + } [INFO] [stdout] 26 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/cleanup.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | / (ranges[0] <= ranges[2] && ranges[1] >= ranges[2]) || [INFO] [stdout] 35 | | (ranges[0] <= ranges[2] && ranges[1] >= ranges[3]) || [INFO] [stdout] | |______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 34 - (ranges[0] <= ranges[2] && ranges[1] >= ranges[2]) || [INFO] [stdout] 35 - (ranges[0] <= ranges[2] && ranges[1] >= ranges[3]) || [INFO] [stdout] 34 + !(ranges[0] > ranges[2] || ranges[1] < ranges[2] && ranges[1] < ranges[3]) || [INFO] [stdout] | [INFO] [stdout] 34 - (ranges[0] <= ranges[2] && ranges[1] >= ranges[2]) || [INFO] [stdout] 35 - (ranges[0] <= ranges[2] && ranges[1] >= ranges[3]) || [INFO] [stdout] 34 + (ranges[1] >= ranges[3] || ranges[1] >= ranges[2]) && ranges[0] <= ranges[2] || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/crates.rs:33:16 [INFO] [stdout] | [INFO] [stdout] 33 | if c >= 'A' && c <= 'Z' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `('A'..='Z').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/solutions/crates.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | / match s.parse::() { [INFO] [stdout] 47 | | Ok(n) => crate_indices.push(n), [INFO] [stdout] 48 | | Err(_) => {} [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ help: try: `if let Ok(n) = s.parse::() { crate_indices.push(n) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/crates.rs:51:12 [INFO] [stdout] | [INFO] [stdout] 51 | if crate_indices.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!crate_indices.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/solutions/crates.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | (addr_of(index) - addr_of(original)).into() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(addr_of(index) - addr_of(original))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `chars` [INFO] [stdout] --> src/solutions/datastream.rs:12:14 [INFO] [stdout] | [INFO] [stdout] 12 | for i in 0..chars.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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 12 - for i in 0..chars.len() { [INFO] [stdout] 12 + for (i, ) in chars.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/solutions/expedition/elf.rs:41:43 [INFO] [stdout] | [INFO] [stdout] 41 | pub fn add_snacks(&mut self, cal_vec: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 41 - pub fn add_snacks(&mut self, cal_vec: &Vec) { [INFO] [stdout] 41 + pub fn add_snacks(&mut self, cal_vec: &[u64]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `cal_vec` [INFO] [stdout] --> src/solutions/expedition/elf.rs:42:18 [INFO] [stdout] | [INFO] [stdout] 42 | for i in 0..cal_vec.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 42 - for i in 0..cal_vec.len() { [INFO] [stdout] 42 + for in &cal_vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/expedition.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | / for line in lines { [INFO] [stdout] 44 | | if let Ok(s) = line { [INFO] [stdout] 45 | | match s.parse::() { [INFO] [stdout] 46 | | Ok(calories) => cal_vec.push(calories), [INFO] [stdout] ... | [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/expedition.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | / if let Ok(s) = line { [INFO] [stdout] 45 | | match s.parse::() { [INFO] [stdout] 46 | | Ok(calories) => cal_vec.push(calories), [INFO] [stdout] 47 | | Err(_) => { [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 43 ~ for s in lines.flatten() { [INFO] [stdout] 44 + match s.parse::() { [INFO] [stdout] 45 + Ok(calories) => cal_vec.push(calories), [INFO] [stdout] 46 + Err(_) => { [INFO] [stdout] 47 + let mut elf = Elf::default(); [INFO] [stdout] 48 + elf.add_snacks(&cal_vec); [INFO] [stdout] 49 + exp.add_elf(elf); [INFO] [stdout] 50 + cal_vec.clear(); [INFO] [stdout] 51 + } [INFO] [stdout] 52 + } [INFO] [stdout] 53 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/rps.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | / for line in lines { [INFO] [stdout] 7 | | if let Ok(code) = line { [INFO] [stdout] 8 | | match code.as_str() { [INFO] [stdout] 9 | | "A X" => score += 4, [INFO] [stdout] ... | [INFO] [stdout] 21 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/rps.rs:7:13 [INFO] [stdout] | [INFO] [stdout] 7 | / if let Ok(code) = line { [INFO] [stdout] 8 | | match code.as_str() { [INFO] [stdout] 9 | | "A X" => score += 4, [INFO] [stdout] 10 | | "A Y" => score += 8, [INFO] [stdout] ... | [INFO] [stdout] 20 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 ~ for code in lines.flatten() { [INFO] [stdout] 7 + match code.as_str() { [INFO] [stdout] 8 + "A X" => score += 4, [INFO] [stdout] 9 + "A Y" => score += 8, [INFO] [stdout] 10 + "A Z" => score += 3, [INFO] [stdout] 11 + "B X" => score += 1, [INFO] [stdout] 12 + "B Y" => score += 5, [INFO] [stdout] 13 + "B Z" => score += 9, [INFO] [stdout] 14 + "C X" => score += 7, [INFO] [stdout] 15 + "C Y" => score += 2, [INFO] [stdout] 16 + "C Z" => score += 6, [INFO] [stdout] 17 + _ => {} [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/rps.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / for line in lines { [INFO] [stdout] 30 | | if let Ok(code) = line { [INFO] [stdout] 31 | | match code.as_str() { [INFO] [stdout] 32 | | "A X" => score += 3, [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/rps.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | / if let Ok(code) = line { [INFO] [stdout] 31 | | match code.as_str() { [INFO] [stdout] 32 | | "A X" => score += 3, [INFO] [stdout] 33 | | "A Y" => score += 4, [INFO] [stdout] ... | [INFO] [stdout] 43 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 29 ~ for code in lines.flatten() { [INFO] [stdout] 30 + match code.as_str() { [INFO] [stdout] 31 + "A X" => score += 3, [INFO] [stdout] 32 + "A Y" => score += 4, [INFO] [stdout] 33 + "A Z" => score += 8, [INFO] [stdout] 34 + "B X" => score += 1, [INFO] [stdout] 35 + "B Y" => score += 5, [INFO] [stdout] 36 + "B Z" => score += 9, [INFO] [stdout] 37 + "C X" => score += 2, [INFO] [stdout] 38 + "C Y" => score += 6, [INFO] [stdout] 39 + "C Z" => score += 7, [INFO] [stdout] 40 + _ => {} [INFO] [stdout] 41 + } [INFO] [stdout] 42 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/rucksack.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | / for line in lines { [INFO] [stdout] 8 | | if let Ok(items) = line { [INFO] [stdout] 9 | | rucksacks.push(items); [INFO] [stdout] 10 | | if rucksacks.len() >= 3 { [INFO] [stdout] ... | [INFO] [stdout] 16 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/rucksack.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | / if let Ok(items) = line { [INFO] [stdout] 9 | | rucksacks.push(items); [INFO] [stdout] 10 | | if rucksacks.len() >= 3 { [INFO] [stdout] 11 | | let to_add: u64 = get_badge_value(&rucksacks).into(); [INFO] [stdout] ... | [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 7 ~ for items in lines.flatten() { [INFO] [stdout] 8 + rucksacks.push(items); [INFO] [stdout] 9 + if rucksacks.len() >= 3 { [INFO] [stdout] 10 + let to_add: u64 = get_badge_value(&rucksacks).into(); [INFO] [stdout] 11 + badge_sum += to_add; [INFO] [stdout] 12 + rucksacks.clear(); [INFO] [stdout] 13 + } [INFO] [stdout] 14 + } [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/solutions/rucksack.rs:21:31 [INFO] [stdout] | [INFO] [stdout] 21 | fn get_badge_value(rucksacks: &Vec) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 21 - fn get_badge_value(rucksacks: &Vec) -> u8 { [INFO] [stdout] 21 + fn get_badge_value(rucksacks: &[String]) -> u8 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/rucksack.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | return '0' [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 40 - return '0' [INFO] [stdout] 40 + '0' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/rucksack.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | / for line in lines { [INFO] [stdout] 47 | | if let Ok(items) = line { [INFO] [stdout] 48 | | let to_add: u64 = get_shared_priority(items).into(); [INFO] [stdout] 49 | | priority_sum += to_add; [INFO] [stdout] 50 | | } [INFO] [stdout] 51 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/rucksack.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | / if let Ok(items) = line { [INFO] [stdout] 48 | | let to_add: u64 = get_shared_priority(items).into(); [INFO] [stdout] 49 | | priority_sum += to_add; [INFO] [stdout] 50 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 46 ~ for items in lines.flatten() { [INFO] [stdout] 47 + let to_add: u64 = get_shared_priority(items).into(); [INFO] [stdout] 48 + priority_sum += to_add; [INFO] [stdout] 49 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/solutions/rucksack.rs:64:5 [INFO] [stdout] | [INFO] [stdout] 62 | let priority = get_priority(shared); [INFO] [stdout] | ------------------------------------ unnecessary `let` binding [INFO] [stdout] 63 | [INFO] [stdout] 64 | priority [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] 62 ~ [INFO] [stdout] 63 | [INFO] [stdout] 64 ~ get_priority(shared) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/rucksack.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | return '0' [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 73 - return '0' [INFO] [stdout] 73 + '0' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/rucksack.rs:78:8 [INFO] [stdout] | [INFO] [stdout] 78 | if code >= 65 && code <= 90 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(65..=90).contains(&code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/rucksack.rs:80:15 [INFO] [stdout] | [INFO] [stdout] 80 | } else if code >= 97 && code <= 122 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(97..=122).contains(&code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `display` [INFO] [stdout] --> src/solutions/signal.rs:78:14 [INFO] [stdout] | [INFO] [stdout] 78 | for i in 0..240 { [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] 78 - for i in 0..240 { [INFO] [stdout] 78 + for (i, ) in display.iter().enumerate().take(240) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/solutions/signal.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/solutions/trees.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | / match c.to_digit(10) { [INFO] [stdout] 9 | | Some(n) => row.push(n), [INFO] [stdout] 10 | | None => {} [INFO] [stdout] 11 | | } [INFO] [stdout] | |_____________^ help: try: `if let Some(n) = c.to_digit(10) { row.push(n) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/solutions/trees.rs:29:13 [INFO] [stdout] | [INFO] [stdout] 29 | row.push(false); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![false;SIZE]` [INFO] [stdout] = help: or `row.extend(std::iter::repeat_n(false, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:39:22 [INFO] [stdout] | [INFO] [stdout] 39 | for k in 0..i { [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] 39 - for k in 0..i { [INFO] [stdout] 39 + for in trees.iter().take(i) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:51:22 [INFO] [stdout] | [INFO] [stdout] 51 | for k in (i+1)..row_len { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 51 - for k in (i+1)..row_len { [INFO] [stdout] 51 + for in trees.iter().take(row_len).skip((i+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:63:22 [INFO] [stdout] | [INFO] [stdout] 63 | for k in 0..j { [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] 63 - for k in 0..j { [INFO] [stdout] 63 + for in trees.iter().take(j) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:74:22 [INFO] [stdout] | [INFO] [stdout] 74 | for k in (j+1)..col_len { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 74 - for k in (j+1)..col_len { [INFO] [stdout] 74 + for in trees.iter().take(col_len).skip((j+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `visible` [INFO] [stdout] --> src/solutions/trees.rs:89:14 [INFO] [stdout] | [INFO] [stdout] 89 | for i in 0..row_len { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 89 - for i in 0..row_len { [INFO] [stdout] 89 + for in visible.iter().take(row_len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `visible` [INFO] [stdout] --> src/solutions/trees.rs:90:18 [INFO] [stdout] | [INFO] [stdout] 90 | for j in 0..col_len { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 90 - for j in 0..col_len { [INFO] [stdout] 90 + for in visible.iter().take(col_len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/solutions/directory.rs:52:21 [INFO] [stdout] | [INFO] [stdout] 52 | let mut dir = dir_map.get_mut(&curr_dir).unwrap(); [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:118:22 [INFO] [stdout] | [INFO] [stdout] 118 | for k in (i+1)..row_len { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 118 - for k in (i+1)..row_len { [INFO] [stdout] 118 + for in trees.iter().take(row_len).skip((i+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:136:22 [INFO] [stdout] | [INFO] [stdout] 136 | for k in (j+1)..col_len { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 136 - for k in (j+1)..col_len { [INFO] [stdout] 136 + for in trees.iter().take(col_len).skip((j+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/solutions/trees.rs:146:17 [INFO] [stdout] | [INFO] [stdout] 146 | score = score * count; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `score *= count` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/utils/read.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | / for line in lines { [INFO] [stdout] 9 | | if let Ok(s) = line { [INFO] [stdout] 10 | | strings.push(s); [INFO] [stdout] 11 | | } [INFO] [stdout] 12 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/utils/read.rs:9:13 [INFO] [stdout] | [INFO] [stdout] 9 | / if let Ok(s) = line { [INFO] [stdout] 10 | | strings.push(s); [INFO] [stdout] 11 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 8 ~ for s in lines.flatten() { [INFO] [stdout] 9 + strings.push(s); [INFO] [stdout] 10 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/rope.rs:53:21 [INFO] [stdout] | [INFO] [stdout] 53 | let mut knots = vec![(0,0); 10]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: you can use an array directly: `[(0,0); 10]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/signal.rs:3:22 [INFO] [stdout] | [INFO] [stdout] 3 | let thresholds = vec![20, 60, 100, 140, 180, 220]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[20, 60, 100, 140, 180, 220]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/solutions/directory.rs:124:9 [INFO] [stdout] | [INFO] [stdout] 124 | let mut dir = dir_map.get_mut(curr_dir).unwrap(); [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `solutions::directory::Directory` is more private than the item `solutions::directory::DirectoryMap` [INFO] [stdout] --> src/solutions/directory.rs:9:1 [INFO] [stdout] | [INFO] [stdout] 9 | pub type DirectoryMap = Arc>>; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ type alias `solutions::directory::DirectoryMap` is reachable at visibility `pub(crate)` [INFO] [stdout] | [INFO] [stdout] note: but type `solutions::directory::Directory` is only usable at visibility `pub(self)` [INFO] [stdout] --> src/solutions/directory.rs:12:1 [INFO] [stdout] | [INFO] [stdout] 12 | struct Directory { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(private_interfaces)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_cleanup` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_cleanup(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_cleanup_2` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn read_cleanup_2(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `overlap` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:33:4 [INFO] [stdout] | [INFO] [stdout] 33 | fn overlap(ranges: Vec) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `contained` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:40:4 [INFO] [stdout] | [INFO] [stdout] 40 | fn contained(ranges: Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_ranges` is never used [INFO] [stdout] --> src/solutions/cleanup.rs:45:4 [INFO] [stdout] | [INFO] [stdout] 45 | fn get_ranges(sections: String) -> Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_crates` is never used [INFO] [stdout] --> src/solutions/crates.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_crates(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `index_map` is never used [INFO] [stdout] --> src/solutions/crates.rs:87:4 [INFO] [stdout] | [INFO] [stdout] 87 | fn index_map(index: &str, original: &str) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `addr_of` is never used [INFO] [stdout] --> src/solutions/crates.rs:91:4 [INFO] [stdout] | [INFO] [stdout] 91 | fn addr_of(s: &str) -> usize { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_datastream` is never used [INFO] [stdout] --> src/solutions/datastream.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn read_datastream(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `non_repeating` is never used [INFO] [stdout] --> src/solutions/datastream.rs:9:4 [INFO] [stdout] | [INFO] [stdout] 9 | fn non_repeating(line: String) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `DirectoryMap` is never used [INFO] [stdout] --> src/solutions/directory.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | pub type DirectoryMap = Arc>>; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Directory` is never constructed [INFO] [stdout] --> src/solutions/directory.rs:12:8 [INFO] [stdout] | [INFO] [stdout] 12 | struct Directory { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_directory` is never used [INFO] [stdout] --> src/solutions/directory.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn read_directory(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `small_sizes` is never used [INFO] [stdout] --> src/solutions/directory.rs:102:4 [INFO] [stdout] | [INFO] [stdout] 102 | fn small_sizes(dir_map_lock: DirectoryMap, curr_dir: &str) -> (u64, u64) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `parent` is never used [INFO] [stdout] --> src/solutions/directory.rs:131:4 [INFO] [stdout] | [INFO] [stdout] 131 | fn parent(path: &str) -> &str { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Expedition` is never constructed [INFO] [stdout] --> src/solutions/expedition.rs:11:12 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct Expedition { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_elf`, `most_calories`, and `top_k_calories` are never used [INFO] [stdout] --> src/solutions/expedition.rs:16:12 [INFO] [stdout] | [INFO] [stdout] 15 | impl Expedition { [INFO] [stdout] | --------------- methods in this implementation [INFO] [stdout] 16 | pub fn add_elf(&mut self, elf: Elf) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 20 | pub fn most_calories(&self) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 27 | pub fn top_k_calories(&mut self, k: u64) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_expedition` is never used [INFO] [stdout] --> src/solutions/expedition.rs:39:8 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn read_expedition(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Elf` is never constructed [INFO] [stdout] --> src/solutions/expedition/elf.rs:7:12 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct Elf { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_snack` and `add_snacks` are never used [INFO] [stdout] --> src/solutions/expedition/elf.rs:33:12 [INFO] [stdout] | [INFO] [stdout] 32 | impl Elf { [INFO] [stdout] | -------- methods in this implementation [INFO] [stdout] 33 | pub fn add_snack(&mut self, calories: u64) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 41 | pub fn add_snacks(&mut self, cal_vec: &Vec) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Snack` is never constructed [INFO] [stdout] --> src/solutions/expedition/snack.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Snack { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rope` is never used [INFO] [stdout] --> src/solutions/rope.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_rope(path: &str) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rope_2` is never used [INFO] [stdout] --> src/solutions/rope.rs:50:8 [INFO] [stdout] | [INFO] [stdout] 50 | pub fn read_rope_2(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `tail_move` is never used [INFO] [stdout] --> src/solutions/rope.rs:104:4 [INFO] [stdout] | [INFO] [stdout] 104 | fn tail_move(head: (i32, i32), tail: (i32, i32)) -> (i32, i32) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rps` is never used [INFO] [stdout] --> src/solutions/rps.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_rps(path: &str) { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rps_2` is never used [INFO] [stdout] --> src/solutions/rps.rs:26:8 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn read_rps_2(path: &str) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rucksack_2` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn read_rucksack_2(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_badge_value` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:21:4 [INFO] [stdout] | [INFO] [stdout] 21 | fn get_badge_value(rucksacks: &Vec) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_badge` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:34:4 [INFO] [stdout] | [INFO] [stdout] 34 | fn get_badge(first: &str, second: &str, third: &str) -> char { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_rucksack` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn read_rucksack(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_shared_priority` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:56:4 [INFO] [stdout] | [INFO] [stdout] 56 | fn get_shared_priority(items: String) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_shared_char` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:67:4 [INFO] [stdout] | [INFO] [stdout] 67 | fn get_shared_char(first: &str, second: &str) -> char { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_priority` is never used [INFO] [stdout] --> src/solutions/rucksack.rs:76:4 [INFO] [stdout] | [INFO] [stdout] 76 | fn get_priority(c: char) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_signal` is never used [INFO] [stdout] --> src/solutions/signal.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn read_signal(path: &str) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_trees` is never used [INFO] [stdout] --> src/solutions/trees.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn read_trees(path: &str) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `visible_trees` is never used [INFO] [stdout] --> src/solutions/trees.rs:21:4 [INFO] [stdout] | [INFO] [stdout] 21 | fn visible_trees(trees: Vec>) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `max_scenic_score` is never used [INFO] [stdout] --> src/solutions/trees.rs:99:4 [INFO] [stdout] | [INFO] [stdout] 99 | fn max_scenic_score(trees: Vec>) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/cleanup.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | / for line in lines { [INFO] [stdout] 7 | | if let Ok(sections) = line { [INFO] [stdout] 8 | | let ranges = get_ranges(sections); [INFO] [stdout] 9 | | if contained(ranges) { [INFO] [stdout] ... | [INFO] [stdout] 13 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/cleanup.rs:7:13 [INFO] [stdout] | [INFO] [stdout] 7 | / if let Ok(sections) = line { [INFO] [stdout] 8 | | let ranges = get_ranges(sections); [INFO] [stdout] 9 | | if contained(ranges) { [INFO] [stdout] 10 | | pairs += 1 [INFO] [stdout] 11 | | } [INFO] [stdout] 12 | | } [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] 6 ~ for sections in lines.flatten() { [INFO] [stdout] 7 + let ranges = get_ranges(sections); [INFO] [stdout] 8 + if contained(ranges) { [INFO] [stdout] 9 + pairs += 1 [INFO] [stdout] 10 + } [INFO] [stdout] 11 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/cleanup.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | / for line in lines { [INFO] [stdout] 22 | | if let Ok(sections) = line { [INFO] [stdout] 23 | | let ranges = get_ranges(sections); [INFO] [stdout] 24 | | if overlap(ranges) { [INFO] [stdout] ... | [INFO] [stdout] 28 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/cleanup.rs:22:13 [INFO] [stdout] | [INFO] [stdout] 22 | / if let Ok(sections) = line { [INFO] [stdout] 23 | | let ranges = get_ranges(sections); [INFO] [stdout] 24 | | if overlap(ranges) { [INFO] [stdout] 25 | | pairs += 1 [INFO] [stdout] 26 | | } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 21 ~ for sections in lines.flatten() { [INFO] [stdout] 22 + let ranges = get_ranges(sections); [INFO] [stdout] 23 + if overlap(ranges) { [INFO] [stdout] 24 + pairs += 1 [INFO] [stdout] 25 + } [INFO] [stdout] 26 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/cleanup.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | / (ranges[0] <= ranges[2] && ranges[1] >= ranges[2]) || [INFO] [stdout] 35 | | (ranges[0] <= ranges[2] && ranges[1] >= ranges[3]) || [INFO] [stdout] | |______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 34 - (ranges[0] <= ranges[2] && ranges[1] >= ranges[2]) || [INFO] [stdout] 35 - (ranges[0] <= ranges[2] && ranges[1] >= ranges[3]) || [INFO] [stdout] 34 + !(ranges[0] > ranges[2] || ranges[1] < ranges[2] && ranges[1] < ranges[3]) || [INFO] [stdout] | [INFO] [stdout] 34 - (ranges[0] <= ranges[2] && ranges[1] >= ranges[2]) || [INFO] [stdout] 35 - (ranges[0] <= ranges[2] && ranges[1] >= ranges[3]) || [INFO] [stdout] 34 + (ranges[1] >= ranges[3] || ranges[1] >= ranges[2]) && ranges[0] <= ranges[2] || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/crates.rs:33:16 [INFO] [stdout] | [INFO] [stdout] 33 | if c >= 'A' && c <= 'Z' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `('A'..='Z').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/solutions/crates.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | / match s.parse::() { [INFO] [stdout] 47 | | Ok(n) => crate_indices.push(n), [INFO] [stdout] 48 | | Err(_) => {} [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ help: try: `if let Ok(n) = s.parse::() { crate_indices.push(n) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/crates.rs:51:12 [INFO] [stdout] | [INFO] [stdout] 51 | if crate_indices.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!crate_indices.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/solutions/crates.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | (addr_of(index) - addr_of(original)).into() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `(addr_of(index) - addr_of(original))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `chars` [INFO] [stdout] --> src/solutions/datastream.rs:12:14 [INFO] [stdout] | [INFO] [stdout] 12 | for i in 0..chars.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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 12 - for i in 0..chars.len() { [INFO] [stdout] 12 + for (i, ) in chars.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/solutions/expedition/elf.rs:41:43 [INFO] [stdout] | [INFO] [stdout] 41 | pub fn add_snacks(&mut self, cal_vec: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 41 - pub fn add_snacks(&mut self, cal_vec: &Vec) { [INFO] [stdout] 41 + pub fn add_snacks(&mut self, cal_vec: &[u64]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `cal_vec` [INFO] [stdout] --> src/solutions/expedition/elf.rs:42:18 [INFO] [stdout] | [INFO] [stdout] 42 | for i in 0..cal_vec.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 42 - for i in 0..cal_vec.len() { [INFO] [stdout] 42 + for in &cal_vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/expedition.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | / for line in lines { [INFO] [stdout] 44 | | if let Ok(s) = line { [INFO] [stdout] 45 | | match s.parse::() { [INFO] [stdout] 46 | | Ok(calories) => cal_vec.push(calories), [INFO] [stdout] ... | [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/expedition.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | / if let Ok(s) = line { [INFO] [stdout] 45 | | match s.parse::() { [INFO] [stdout] 46 | | Ok(calories) => cal_vec.push(calories), [INFO] [stdout] 47 | | Err(_) => { [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 43 ~ for s in lines.flatten() { [INFO] [stdout] 44 + match s.parse::() { [INFO] [stdout] 45 + Ok(calories) => cal_vec.push(calories), [INFO] [stdout] 46 + Err(_) => { [INFO] [stdout] 47 + let mut elf = Elf::default(); [INFO] [stdout] 48 + elf.add_snacks(&cal_vec); [INFO] [stdout] 49 + exp.add_elf(elf); [INFO] [stdout] 50 + cal_vec.clear(); [INFO] [stdout] 51 + } [INFO] [stdout] 52 + } [INFO] [stdout] 53 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/rps.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | / for line in lines { [INFO] [stdout] 7 | | if let Ok(code) = line { [INFO] [stdout] 8 | | match code.as_str() { [INFO] [stdout] 9 | | "A X" => score += 4, [INFO] [stdout] ... | [INFO] [stdout] 21 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/rps.rs:7:13 [INFO] [stdout] | [INFO] [stdout] 7 | / if let Ok(code) = line { [INFO] [stdout] 8 | | match code.as_str() { [INFO] [stdout] 9 | | "A X" => score += 4, [INFO] [stdout] 10 | | "A Y" => score += 8, [INFO] [stdout] ... | [INFO] [stdout] 20 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 ~ for code in lines.flatten() { [INFO] [stdout] 7 + match code.as_str() { [INFO] [stdout] 8 + "A X" => score += 4, [INFO] [stdout] 9 + "A Y" => score += 8, [INFO] [stdout] 10 + "A Z" => score += 3, [INFO] [stdout] 11 + "B X" => score += 1, [INFO] [stdout] 12 + "B Y" => score += 5, [INFO] [stdout] 13 + "B Z" => score += 9, [INFO] [stdout] 14 + "C X" => score += 7, [INFO] [stdout] 15 + "C Y" => score += 2, [INFO] [stdout] 16 + "C Z" => score += 6, [INFO] [stdout] 17 + _ => {} [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/rps.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / for line in lines { [INFO] [stdout] 30 | | if let Ok(code) = line { [INFO] [stdout] 31 | | match code.as_str() { [INFO] [stdout] 32 | | "A X" => score += 3, [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/rps.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | / if let Ok(code) = line { [INFO] [stdout] 31 | | match code.as_str() { [INFO] [stdout] 32 | | "A X" => score += 3, [INFO] [stdout] 33 | | "A Y" => score += 4, [INFO] [stdout] ... | [INFO] [stdout] 43 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 29 ~ for code in lines.flatten() { [INFO] [stdout] 30 + match code.as_str() { [INFO] [stdout] 31 + "A X" => score += 3, [INFO] [stdout] 32 + "A Y" => score += 4, [INFO] [stdout] 33 + "A Z" => score += 8, [INFO] [stdout] 34 + "B X" => score += 1, [INFO] [stdout] 35 + "B Y" => score += 5, [INFO] [stdout] 36 + "B Z" => score += 9, [INFO] [stdout] 37 + "C X" => score += 2, [INFO] [stdout] 38 + "C Y" => score += 6, [INFO] [stdout] 39 + "C Z" => score += 7, [INFO] [stdout] 40 + _ => {} [INFO] [stdout] 41 + } [INFO] [stdout] 42 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/rucksack.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | / for line in lines { [INFO] [stdout] 8 | | if let Ok(items) = line { [INFO] [stdout] 9 | | rucksacks.push(items); [INFO] [stdout] 10 | | if rucksacks.len() >= 3 { [INFO] [stdout] ... | [INFO] [stdout] 16 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/rucksack.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | / if let Ok(items) = line { [INFO] [stdout] 9 | | rucksacks.push(items); [INFO] [stdout] 10 | | if rucksacks.len() >= 3 { [INFO] [stdout] 11 | | let to_add: u64 = get_badge_value(&rucksacks).into(); [INFO] [stdout] ... | [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 7 ~ for items in lines.flatten() { [INFO] [stdout] 8 + rucksacks.push(items); [INFO] [stdout] 9 + if rucksacks.len() >= 3 { [INFO] [stdout] 10 + let to_add: u64 = get_badge_value(&rucksacks).into(); [INFO] [stdout] 11 + badge_sum += to_add; [INFO] [stdout] 12 + rucksacks.clear(); [INFO] [stdout] 13 + } [INFO] [stdout] 14 + } [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/solutions/rucksack.rs:21:31 [INFO] [stdout] | [INFO] [stdout] 21 | fn get_badge_value(rucksacks: &Vec) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 21 - fn get_badge_value(rucksacks: &Vec) -> u8 { [INFO] [stdout] 21 + fn get_badge_value(rucksacks: &[String]) -> u8 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/rucksack.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | return '0' [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 40 - return '0' [INFO] [stdout] 40 + '0' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/solutions/rucksack.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | / for line in lines { [INFO] [stdout] 47 | | if let Ok(items) = line { [INFO] [stdout] 48 | | let to_add: u64 = get_shared_priority(items).into(); [INFO] [stdout] 49 | | priority_sum += to_add; [INFO] [stdout] 50 | | } [INFO] [stdout] 51 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/solutions/rucksack.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | / if let Ok(items) = line { [INFO] [stdout] 48 | | let to_add: u64 = get_shared_priority(items).into(); [INFO] [stdout] 49 | | priority_sum += to_add; [INFO] [stdout] 50 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 46 ~ for items in lines.flatten() { [INFO] [stdout] 47 + let to_add: u64 = get_shared_priority(items).into(); [INFO] [stdout] 48 + priority_sum += to_add; [INFO] [stdout] 49 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/solutions/rucksack.rs:64:5 [INFO] [stdout] | [INFO] [stdout] 62 | let priority = get_priority(shared); [INFO] [stdout] | ------------------------------------ unnecessary `let` binding [INFO] [stdout] 63 | [INFO] [stdout] 64 | priority [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] 62 ~ [INFO] [stdout] 63 | [INFO] [stdout] 64 ~ get_priority(shared) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/solutions/rucksack.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | return '0' [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 73 - return '0' [INFO] [stdout] 73 + '0' [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/rucksack.rs:78:8 [INFO] [stdout] | [INFO] [stdout] 78 | if code >= 65 && code <= 90 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(65..=90).contains(&code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/rucksack.rs:80:15 [INFO] [stdout] | [INFO] [stdout] 80 | } else if code >= 97 && code <= 122 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(97..=122).contains(&code)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `display` [INFO] [stdout] --> src/solutions/signal.rs:78:14 [INFO] [stdout] | [INFO] [stdout] 78 | for i in 0..240 { [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] 78 - for i in 0..240 { [INFO] [stdout] 78 + for (i, ) in display.iter().enumerate().take(240) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/solutions/signal.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/solutions/trees.rs:8:13 [INFO] [stdout] | [INFO] [stdout] 8 | / match c.to_digit(10) { [INFO] [stdout] 9 | | Some(n) => row.push(n), [INFO] [stdout] 10 | | None => {} [INFO] [stdout] 11 | | } [INFO] [stdout] | |_____________^ help: try: `if let Some(n) = c.to_digit(10) { row.push(n) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/solutions/trees.rs:29:13 [INFO] [stdout] | [INFO] [stdout] 29 | row.push(false); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![false;SIZE]` [INFO] [stdout] = help: or `row.extend(std::iter::repeat_n(false, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:39:22 [INFO] [stdout] | [INFO] [stdout] 39 | for k in 0..i { [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] 39 - for k in 0..i { [INFO] [stdout] 39 + for in trees.iter().take(i) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:51:22 [INFO] [stdout] | [INFO] [stdout] 51 | for k in (i+1)..row_len { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 51 - for k in (i+1)..row_len { [INFO] [stdout] 51 + for in trees.iter().take(row_len).skip((i+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:63:22 [INFO] [stdout] | [INFO] [stdout] 63 | for k in 0..j { [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] 63 - for k in 0..j { [INFO] [stdout] 63 + for in trees.iter().take(j) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:74:22 [INFO] [stdout] | [INFO] [stdout] 74 | for k in (j+1)..col_len { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 74 - for k in (j+1)..col_len { [INFO] [stdout] 74 + for in trees.iter().take(col_len).skip((j+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `visible` [INFO] [stdout] --> src/solutions/trees.rs:89:14 [INFO] [stdout] | [INFO] [stdout] 89 | for i in 0..row_len { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 89 - for i in 0..row_len { [INFO] [stdout] 89 + for in visible.iter().take(row_len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `visible` [INFO] [stdout] --> src/solutions/trees.rs:90:18 [INFO] [stdout] | [INFO] [stdout] 90 | for j in 0..col_len { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 90 - for j in 0..col_len { [INFO] [stdout] 90 + for in visible.iter().take(col_len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:118:22 [INFO] [stdout] | [INFO] [stdout] 118 | for k in (i+1)..row_len { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 118 - for k in (i+1)..row_len { [INFO] [stdout] 118 + for in trees.iter().take(row_len).skip((i+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `trees` [INFO] [stdout] --> src/solutions/trees.rs:136:22 [INFO] [stdout] | [INFO] [stdout] 136 | for k in (j+1)..col_len { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 136 - for k in (j+1)..col_len { [INFO] [stdout] 136 + for in trees.iter().take(col_len).skip((j+1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/solutions/trees.rs:146:17 [INFO] [stdout] | [INFO] [stdout] 146 | score = score * count; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `score *= count` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/utils/read.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | / for line in lines { [INFO] [stdout] 9 | | if let Ok(s) = line { [INFO] [stdout] 10 | | strings.push(s); [INFO] [stdout] 11 | | } [INFO] [stdout] 12 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/utils/read.rs:9:13 [INFO] [stdout] | [INFO] [stdout] 9 | / if let Ok(s) = line { [INFO] [stdout] 10 | | strings.push(s); [INFO] [stdout] 11 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 8 ~ for s in lines.flatten() { [INFO] [stdout] 9 + strings.push(s); [INFO] [stdout] 10 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/rope.rs:53:21 [INFO] [stdout] | [INFO] [stdout] 53 | let mut knots = vec![(0,0); 10]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: you can use an array directly: `[(0,0); 10]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/signal.rs:3:22 [INFO] [stdout] | [INFO] [stdout] 3 | let thresholds = vec![20, 60, 100, 140, 180, 220]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[20, 60, 100, 140, 180, 220]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.89s [INFO] running `Command { std: "docker" "inspect" "feba6442255156aef8c205a5213fab6cd74fd720bcfdbc6cd27b573ba73c2574", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "feba6442255156aef8c205a5213fab6cd74fd720bcfdbc6cd27b573ba73c2574", kill_on_drop: false }` [INFO] [stdout] feba6442255156aef8c205a5213fab6cd74fd720bcfdbc6cd27b573ba73c2574