[INFO] cloning repository https://github.com/benmonty/advent [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/benmonty/advent" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbenmonty%2Fadvent", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbenmonty%2Fadvent'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 1118c23c10a778299bf2052ea48a726d78eaa6cc [INFO] linting benmonty/advent against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbenmonty%2Fadvent" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/benmonty/advent [INFO] finished tweaking git repo https://github.com/benmonty/advent [INFO] tweaked toml for git repo https://github.com/benmonty/advent written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/benmonty/advent 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/benmonty/advent already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 31261bd9ba2a7ec651e173f6d4cb8fb5268da3a8f3e3dd61ead13629f06ef924 [INFO] running `Command { std: "docker" "start" "-a" "31261bd9ba2a7ec651e173f6d4cb8fb5268da3a8f3e3dd61ead13629f06ef924", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "31261bd9ba2a7ec651e173f6d4cb8fb5268da3a8f3e3dd61ead13629f06ef924", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "31261bd9ba2a7ec651e173f6d4cb8fb5268da3a8f3e3dd61ead13629f06ef924", kill_on_drop: false }` [INFO] [stdout] 31261bd9ba2a7ec651e173f6d4cb8fb5268da3a8f3e3dd61ead13629f06ef924 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 3e057070d45523bcc941ed828e8954efa06a667fc661edf6982eb60895ccdf51 [INFO] running `Command { std: "docker" "start" "-a" "3e057070d45523bcc941ed828e8954efa06a667fc661edf6982eb60895ccdf51", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.93 [INFO] [stderr] Compiling libc v0.2.169 [INFO] [stderr] Checking rustc-hash v2.1.0 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Compiling quote v1.0.38 [INFO] [stderr] Compiling syn v2.0.96 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Checking ppv-lite86 v0.2.20 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking advent v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:147:13 [INFO] [stdout] | [INFO] [stdout] 147 | nodes: nodes, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `nodes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:235:29 [INFO] [stdout] | [INFO] [stdout] 235 | ... cost: cost, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:241:29 [INFO] [stdout] | [INFO] [stdout] 241 | ... cost: cost, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:252:25 [INFO] [stdout] | [INFO] [stdout] 252 | cost: cost, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:257:25 [INFO] [stdout] | [INFO] [stdout] 257 | cost: cost, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:272:13 [INFO] [stdout] | [INFO] [stdout] 272 | levels: levels, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `levels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fmt::write` [INFO] [stdout] --> src/day10.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::fmt::write; [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::min` [INFO] [stdout] --> src/day14.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use std::cmp::min; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> src/day17.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `FxHashMap` and `FxHashSet` [INFO] [stdout] --> src/day17.rs:6:18 [INFO] [stdout] | [INFO] [stdout] 6 | use rustc_hash::{FxHashMap,FxHashSet}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::VecDeque` [INFO] [stdout] --> src/day19.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> src/day19.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FxHashMap` [INFO] [stdout] --> src/day19.rs:6:29 [INFO] [stdout] | [INFO] [stdout] 6 | use rustc_hash::{FxHashSet, FxHashMap}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `fmt::write` [INFO] [stdout] --> src/day23.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{fmt::write, fs}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:147:13 [INFO] [stdout] | [INFO] [stdout] 147 | nodes: nodes, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `nodes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:235:29 [INFO] [stdout] | [INFO] [stdout] 235 | ... cost: cost, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:241:29 [INFO] [stdout] | [INFO] [stdout] 241 | ... cost: cost, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:252:25 [INFO] [stdout] | [INFO] [stdout] 252 | cost: cost, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:257:25 [INFO] [stdout] | [INFO] [stdout] 257 | cost: cost, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/day2.rs:272:13 [INFO] [stdout] | [INFO] [stdout] 272 | levels: levels, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `levels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fmt::write` [INFO] [stdout] --> src/day10.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::fmt::write; [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::min` [INFO] [stdout] --> src/day14.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use std::cmp::min; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> src/day17.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `FxHashMap` and `FxHashSet` [INFO] [stdout] --> src/day17.rs:6:18 [INFO] [stdout] | [INFO] [stdout] 6 | use rustc_hash::{FxHashMap,FxHashSet}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::VecDeque` [INFO] [stdout] --> src/day19.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::VecDeque; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> src/day19.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FxHashMap` [INFO] [stdout] --> src/day19.rs:6:29 [INFO] [stdout] | [INFO] [stdout] 6 | use rustc_hash::{FxHashSet, FxHashMap}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `self` [INFO] [stdout] --> src/day19.rs:239:25 [INFO] [stdout] | [INFO] [stdout] 239 | use crate::common::{self, get_test_data_path}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::common` [INFO] [stdout] --> src/day21.rs:541:9 [INFO] [stdout] | [INFO] [stdout] 541 | use crate::common; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `fmt::write` [INFO] [stdout] --> src/day23.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{fmt::write, fs}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b_press` [INFO] [stdout] --> src/day13.rs:215:9 [INFO] [stdout] | [INFO] [stdout] 215 | for b_press in 0..max_press_count { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_b_press` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_a_presses` [INFO] [stdout] --> src/day13.rs:291:33 [INFO] [stdout] | [INFO] [stdout] 291 | ... let num_a_presses = a_moves_x + k*(conf.b_offset.x/gcd_x); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_a_presses` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_b_presses` [INFO] [stdout] --> src/day13.rs:292:33 [INFO] [stdout] | [INFO] [stdout] 292 | ... let num_b_presses = b_moves_x - k*(conf.a_offset.x/gcd_x); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_b_presses` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `src_entity` [INFO] [stdout] --> src/day15.rs:185:13 [INFO] [stdout] | [INFO] [stdout] 185 | let src_entity = self.map.get(&src).unwrap(); [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_src_entity` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `device` [INFO] [stdout] --> src/day24.rs:214:14 [INFO] [stdout] | [INFO] [stdout] 214 | fn rand_test(device: &Device, gate_overrides: &Vec, iterations: isize) -> isize { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_device` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `total_fails` is assigned to, but never used [INFO] [stdout] --> src/day24.rs:232:9 [INFO] [stdout] | [INFO] [stdout] 232 | let mut total_fails = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_total_fails` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:246:17 [INFO] [stdout] | [INFO] [stdout] 246 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:260:17 [INFO] [stdout] | [INFO] [stdout] 260 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:274:17 [INFO] [stdout] | [INFO] [stdout] 274 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `total_fails` is assigned to, but never used [INFO] [stdout] --> src/day24.rs:281:9 [INFO] [stdout] | [INFO] [stdout] 281 | let mut total_fails = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_total_fails` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:294:17 [INFO] [stdout] | [INFO] [stdout] 294 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:308:17 [INFO] [stdout] | [INFO] [stdout] 308 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:322:17 [INFO] [stdout] | [INFO] [stdout] 322 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:336:17 [INFO] [stdout] | [INFO] [stdout] 336 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/day25.rs:119:19 [INFO] [stdout] | [INFO] [stdout] 119 | pub fn _solution2(input: &String) -> usize { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `day2::Report` is more private than the item `day2::count_reports` [INFO] [stdout] --> src/day2.rs:300:1 [INFO] [stdout] | [INFO] [stdout] 300 | pub fn count_reports bool>(file_path: PathBuf, filter: F) -> Result> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `day2::count_reports` is reachable at visibility `pub` [INFO] [stdout] | [INFO] [stdout] note: but type `day2::Report` is only usable at visibility `pub(self)` [INFO] [stdout] --> src/day2.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | struct Report { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(private_bounds)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `LocError` is never used [INFO] [stdout] --> src/day1.rs:14:6 [INFO] [stdout] | [INFO] [stdout] 14 | enum LocError { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/day4.rs:83:8 [INFO] [stdout] | [INFO] [stdout] 81 | impl Query { [INFO] [stdout] | ---------- associated function in this implementation [INFO] [stdout] 82 | [INFO] [stdout] 83 | fn from(coord: &Coord, value: char) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `take_obstacle` and `count_tiles` are never used [INFO] [stdout] --> src/day6.rs:178:8 [INFO] [stdout] | [INFO] [stdout] 107 | impl LabMap { [INFO] [stdout] | ----------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 178 | fn take_obstacle(&mut self, pos: Pos) -> Obstacle { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 256 | fn count_tiles(&self, filter: Box bool>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `num_rows` and `num_cols` are never read [INFO] [stdout] --> src/day8.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 13 | struct CityMap { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 16 | num_rows: isize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 17 | num_cols: isize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `step`, `build_children`, and `count_leaf_nodes` are never used [INFO] [stdout] --> src/day11.rs:132:12 [INFO] [stdout] | [INFO] [stdout] 40 | impl StoneTree { [INFO] [stdout] | -------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 132 | pub fn step(&mut self) -> () { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 156 | pub fn build_children(&mut self) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 174 | pub fn count_leaf_nodes(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `plant_type` is never read [INFO] [stdout] --> src/day12.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 23 | pub struct Region { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] 24 | plant_type: PlantType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `src_deer` is never read [INFO] [stdout] --> src/day16.rs:159:5 [INFO] [stdout] | [INFO] [stdout] 157 | pub struct Move { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 158 | actions: Vec, [INFO] [stdout] 159 | src_deer: Deer, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Move` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/day17.rs:49:20 [INFO] [stdout] | [INFO] [stdout] 49 | pub struct Ignored(isize); [INFO] [stdout] | ------- ^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this struct [INFO] [stdout] | [INFO] [stdout] = help: consider removing this field [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `chunkiest_solution` is never used [INFO] [stdout] --> src/day19.rs:55:4 [INFO] [stdout] | [INFO] [stdout] 55 | fn chunkiest_solution<'a>(towels: &'a FxHashSet, design: &'a str, mut max_len: usize) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `width` and `height` are never read [INFO] [stdout] --> src/day20.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct Dimensions { [INFO] [stdout] | ---------- fields in this struct [INFO] [stdout] 12 | width: isize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 13 | height: isize, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `dim` is never read [INFO] [stdout] --> src/day20.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct Track { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] ... [INFO] [stdout] 29 | dim: Dimensions, [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/common.rs:7:13 [INFO] [stdout] | [INFO] [stdout] 7 | pb.push(&rel_path); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `rel_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/common.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | pb.push(&rel_path); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `rel_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day2.rs:42:24 [INFO] [stdout] | [INFO] [stdout] 42 | if !(*level > prev_level) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*level <= prev_level)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day2.rs:47:24 [INFO] [stdout] | [INFO] [stdout] 47 | if !(*level < prev_level) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*level >= prev_level)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day2.rs:23:25 [INFO] [stdout] | [INFO] [stdout] 23 | fn get_ordering(levels: &Vec) -> LevelOrdering { [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] 23 - fn get_ordering(levels: &Vec) -> LevelOrdering { [INFO] [stdout] 23 + fn get_ordering(levels: &[u64]) -> LevelOrdering { [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/day2.rs:59:26 [INFO] [stdout] | [INFO] [stdout] 59 | fn gapping_valid(levels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn gapping_valid(levels: &Vec) -> bool { [INFO] [stdout] 59 + fn gapping_valid(levels: &[u64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/day2.rs:68:16 [INFO] [stdout] | [INFO] [stdout] 68 | if abs_diff > 3 || abs_diff < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=3).contains(&abs_diff)` [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: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day2.rs:118:13 [INFO] [stdout] | [INFO] [stdout] 118 | write!(f, "SRC NODE: {}\n", src_node_identifier)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 118 - write!(f, "SRC NODE: {}\n", src_node_identifier)?; [INFO] [stdout] 118 + writeln!(f, "SRC NODE: {}", src_node_identifier)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day2.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | / write!( [INFO] [stdout] 122 | | f, [INFO] [stdout] 123 | | "\tEDGE:\tto:{}\tkind:{}\tcost:{}\n", [INFO] [stdout] 124 | | edge.dest_node.borrow().value.unwrap(), [INFO] [stdout] 125 | | edge.kind, [INFO] [stdout] 126 | | edge.cost, [INFO] [stdout] 127 | | )?; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 121 ~ writeln!( [INFO] [stdout] 122 | f, [INFO] [stdout] 123 ~ "\tEDGE:\tto:{}\tkind:{}\tcost:{}", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/day2.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 146 | / let graph = LevelsGraph { [INFO] [stdout] 147 | | nodes: nodes, [INFO] [stdout] 148 | | root: root.clone(), [INFO] [stdout] 149 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 150 | graph [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] 146 ~ [INFO] [stdout] 147 ~ LevelsGraph { [INFO] [stdout] 148 + nodes: nodes, [INFO] [stdout] 149 + root: root.clone(), [INFO] [stdout] 150 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/day2.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | all_paths.sort_by(|a, b| b.len().cmp(&a.len())); [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] 156 - all_paths.sort_by(|a, b| b.len().cmp(&a.len())); [INFO] [stdout] 156 + all_paths.sort_by_key(|b| std::cmp::Reverse(b.len())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day2.rs:158:9 [INFO] [stdout] | [INFO] [stdout] 158 | / if all_paths[0].len() > self.nodes.len() - 2 { [INFO] [stdout] 159 | | true [INFO] [stdout] 160 | | } else { [INFO] [stdout] 161 | | false [INFO] [stdout] 162 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `all_paths[0].len() > self.nodes.len() - 2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/day2.rs:170:13 [INFO] [stdout] | [INFO] [stdout] 170 | / let mut result = Vec::new(); [INFO] [stdout] 171 | | result.push(Vec::from([node.clone()])); [INFO] [stdout] | |___________________________________________________^ help: consider using the `vec![]` macro: `let result = 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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day3.rs:21:47 [INFO] [stdout] | [INFO] [stdout] 21 | for (_, [num1, num2]) in rx.captures_iter(&memory).map(|c| c.extract()) { [INFO] [stdout] | ^^^^^^^ help: change this to: `memory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ENABLED` contains a capitalized acronym [INFO] [stdout] --> src/day3.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | ENABLED, [INFO] [stdout] | ^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Enabled` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `DISABLED` contains a capitalized acronym [INFO] [stdout] --> src/day3.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | DISABLED, [INFO] [stdout] | ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Disabled` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day3.rs:50:37 [INFO] [stdout] | [INFO] [stdout] 50 | for capture in rx.captures_iter(&memory) { [INFO] [stdout] | ^^^^^^^ help: change this to: `memory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `report` [INFO] [stdout] --> src/day2.rs:353:13 [INFO] [stdout] | [INFO] [stdout] 353 | let report = Report::from(""); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_report` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `graph` [INFO] [stdout] --> src/day2.rs:378:13 [INFO] [stdout] | [INFO] [stdout] 378 | let graph = report.build_graph(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_graph` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day4.rs:124:33 [INFO] [stdout] | [INFO] [stdout] 124 | fn find_all(&self, queries: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 124 - fn find_all(&self, queries: &Vec) -> bool { [INFO] [stdout] 124 + fn find_all(&self, queries: &[Query]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:138:28 [INFO] [stdout] | [INFO] [stdout] 138 | if self._in_bounds(&coord) { [INFO] [stdout] | ^^^^^^ help: change this to: `coord` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:269:31 [INFO] [stdout] | [INFO] [stdout] 269 | count_forward(&puzzle, &base) [INFO] [stdout] | ^^^^^^^ help: change this to: `puzzle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:270:34 [INFO] [stdout] | [INFO] [stdout] 270 | + count_backward(&puzzle, &base) [INFO] [stdout] | ^^^^^^^ help: change this to: `puzzle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day4.rs:282:56 [INFO] [stdout] | [INFO] [stdout] 282 | fn find_any_query_group(puzzle: &Puzzle, query_groups: &Vec>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 282 - fn find_any_query_group(puzzle: &Puzzle, query_groups: &Vec>) -> bool { [INFO] [stdout] 282 + fn find_any_query_group(puzzle: &Puzzle, query_groups: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:283:53 [INFO] [stdout] | [INFO] [stdout] 283 | query_groups.iter().any(|group| puzzle.find_all(&group)) [INFO] [stdout] | ^^^^^^ help: change this to: `group` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:373:29 [INFO] [stdout] | [INFO] [stdout] 373 | if has_neg_diag(&puzzle, &base) && has_pos_diag(&puzzle, &base) { [INFO] [stdout] | ^^^^^^^ help: change this to: `puzzle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:373:61 [INFO] [stdout] | [INFO] [stdout] 373 | if has_neg_diag(&puzzle, &base) && has_pos_diag(&puzzle, &base) { [INFO] [stdout] | ^^^^^^^ help: change this to: `puzzle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `OrderingRules` [INFO] [stdout] --> src/day5.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | / pub fn new() -> Self { [INFO] [stdout] 33 | | Self { [INFO] [stdout] 34 | | rules: Vec::new(), [INFO] [stdout] 35 | | rules_map: HashMap::new(), [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 30 + impl Default for OrderingRules { [INFO] [stdout] 31 + fn default() -> Self { [INFO] [stdout] 32 + Self::new() [INFO] [stdout] 33 + } [INFO] [stdout] 34 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day5.rs:59:44 [INFO] [stdout] | [INFO] [stdout] 59 | pub fn get_comparator<'a>(&'a self) -> Box Ordering + 'a> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day5.rs:95:29 [INFO] [stdout] | [INFO] [stdout] 95 | let first = self.page_numbers[i].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.page_numbers[i]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day5.rs:96:30 [INFO] [stdout] | [INFO] [stdout] 96 | let second = self.page_numbers[j].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.page_numbers[j]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `PrintUpdates` [INFO] [stdout] --> src/day5.rs:119:5 [INFO] [stdout] | [INFO] [stdout] 119 | / pub fn new() -> Self { [INFO] [stdout] 120 | | Self { [INFO] [stdout] 121 | | updates: Vec::new(), [INFO] [stdout] 122 | | } [INFO] [stdout] 123 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 118 + impl Default for PrintUpdates { [INFO] [stdout] 119 + fn default() -> Self { [INFO] [stdout] 120 + Self::new() [INFO] [stdout] 121 + } [INFO] [stdout] 122 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day5.rs:160:30 [INFO] [stdout] | [INFO] [stdout] 160 | pub fn from(raw_details: &String) -> Self { [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] 160 - pub fn from(raw_details: &String) -> Self { [INFO] [stdout] 160 + pub fn from(raw_details: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day5.rs:166:16 [INFO] [stdout] | [INFO] [stdout] 166 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/day5.rs:189:34 [INFO] [stdout] | [INFO] [stdout] 189 | println!("{}", self.rules.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/day5.rs:190:36 [INFO] [stdout] | [INFO] [stdout] 190 | println!("{}", self.updates.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:200:48 [INFO] [stdout] | [INFO] [stdout] 200 | let instructions = PrintInstructions::from(&raw_details); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `raw_details` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:204:63 [INFO] [stdout] | [INFO] [stdout] 204 | let expected_update = instructions.get_ordered_update(&update); [INFO] [stdout] | ^^^^^^^ help: change this to: `update` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:206:34 [INFO] [stdout] | [INFO] [stdout] 206 | correct_updates.push(&update); [INFO] [stdout] | ^^^^^^^ help: change this to: `update` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:223:48 [INFO] [stdout] | [INFO] [stdout] 223 | let instructions = PrintInstructions::from(&raw_details); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `raw_details` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:227:63 [INFO] [stdout] | [INFO] [stdout] 227 | let expected_update = instructions.get_ordered_update(&update); [INFO] [stdout] | ^^^^^^^ help: change this to: `update` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/day6.rs:207:9 [INFO] [stdout] | [INFO] [stdout] 207 | / match self.tiles.get(&pos).unwrap().occupant { [INFO] [stdout] 208 | | None => true, [INFO] [stdout] 209 | | _ => false, [INFO] [stdout] 210 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 207 - match self.tiles.get(&pos).unwrap().occupant { [INFO] [stdout] 208 - None => true, [INFO] [stdout] 209 - _ => false, [INFO] [stdout] 210 - } [INFO] [stdout] 207 + matches!(self.tiles.get(&pos).unwrap().occupant, None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/day6.rs:207:9 [INFO] [stdout] | [INFO] [stdout] 207 | / match self.tiles.get(&pos).unwrap().occupant { [INFO] [stdout] 208 | | None => true, [INFO] [stdout] 209 | | _ => false, [INFO] [stdout] 210 | | } [INFO] [stdout] | |_________^ help: try: `self.tiles.get(&pos).unwrap().occupant.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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day6.rs:213:24 [INFO] [stdout] | [INFO] [stdout] 213 | fn from_str(input: &String) -> Self { [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] 213 - fn from_str(input: &String) -> Self { [INFO] [stdout] 213 + fn from_str(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day6.rs:221:51 [INFO] [stdout] | [INFO] [stdout] 221 | for (col_idx, byte) in row.as_bytes().into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/day6.rs:225:23 [INFO] [stdout] | [INFO] [stdout] 225 | match char::try_from(*byte).unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `char` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 225 - match char::try_from(*byte).unwrap() { [INFO] [stdout] 225 + match char::from(*byte) { [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/day6.rs:245:47 [INFO] [stdout] | [INFO] [stdout] 245 | fn sync_state_history(&mut self, history: &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] 245 - fn sync_state_history(&mut self, history: &Vec) { [INFO] [stdout] 245 + fn sync_state_history(&mut self, history: &[GuardState]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/day6.rs:287:13 [INFO] [stdout] | [INFO] [stdout] 287 | writeln!(f, "").expect("error writing"); [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#writeln_empty_string [INFO] [stdout] = note: `#[warn(clippy::writeln_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day6.rs:323:36 [INFO] [stdout] | [INFO] [stdout] 323 | let mut map = LabMap::from_str(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<(usize, usize)>` which implements the `Copy` trait [INFO] [stdout] --> src/day6.rs:325:25 [INFO] [stdout] | [INFO] [stdout] 325 | let guard_pos = map.guard_pos.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `map.guard_pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day6.rs:424:36 [INFO] [stdout] | [INFO] [stdout] 424 | let mut map = LabMap::from_str(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<(usize, usize)>` which implements the `Copy` trait [INFO] [stdout] --> src/day6.rs:425:21 [INFO] [stdout] | [INFO] [stdout] 425 | let guard_pos = map.guard_pos.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `map.guard_pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day6.rs:433:11 [INFO] [stdout] | [INFO] [stdout] 433 | while rest_of_walk.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rest_of_walk.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day6.rs:440:9 [INFO] [stdout] | [INFO] [stdout] 440 | / match resume_walk(&mut map, &history) { [INFO] [stdout] 441 | | None => num_cycles += 1, [INFO] [stdout] 442 | | _ => (), // completed, throw away the walk [INFO] [stdout] 443 | | } [INFO] [stdout] | |_________^ help: try: `if let None = resume_walk(&mut map, &history) { num_cycles += 1 }` [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day7.rs:27:23 [INFO] [stdout] | [INFO] [stdout] 27 | fn parse_input(input: &String) -> 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] 27 - fn parse_input(input: &String) -> Vec { [INFO] [stdout] 27 + fn parse_input(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day7.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | if remaining.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `remaining.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day7.rs:79:9 [INFO] [stdout] | [INFO] [stdout] 79 | / match _find_op_sequence(eq_data, valid_ops, next_acc, remaining, ops) { [INFO] [stdout] 80 | | Some(result) => { return Some(result); }, [INFO] [stdout] 81 | | None => (), [INFO] [stdout] 82 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(result) = _find_op_sequence(eq_data, valid_ops, next_acc, remaining, ops) { return Some(result); }` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day7.rs:127:32 [INFO] [stdout] | [INFO] [stdout] 127 | let test_eqs = parse_input(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day7.rs:142:9 [INFO] [stdout] | [INFO] [stdout] 142 | / match find_op_sequence(&test_eq, &ops) { [INFO] [stdout] 143 | | Some(_op_seq) => { [INFO] [stdout] 144 | | //check_solution(&test_eq, &_op_seq); [INFO] [stdout] 145 | | result += test_eq.solution; [INFO] [stdout] 146 | | }, [INFO] [stdout] 147 | | _ => (), [INFO] [stdout] 148 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 142 ~ if let Some(_op_seq) = find_op_sequence(&test_eq, &ops) { [INFO] [stdout] 143 + //check_solution(&test_eq, &_op_seq); [INFO] [stdout] 144 + result += test_eq.solution; [INFO] [stdout] 145 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day7.rs:142:32 [INFO] [stdout] | [INFO] [stdout] 142 | match find_op_sequence(&test_eq, &ops) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `test_eq` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day7.rs:159:32 [INFO] [stdout] | [INFO] [stdout] 159 | let test_eqs = parse_input(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day7.rs:174:9 [INFO] [stdout] | [INFO] [stdout] 174 | / match find_op_sequence(&test_eq, &ops) { [INFO] [stdout] 175 | | Some(_op_seq) => { [INFO] [stdout] 176 | | //check_solution(&test_eq, &_op_seq); [INFO] [stdout] 177 | | result += test_eq.solution; [INFO] [stdout] 178 | | }, [INFO] [stdout] 179 | | _ => (), [INFO] [stdout] 180 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 174 ~ if let Some(_op_seq) = find_op_sequence(&test_eq, &ops) { [INFO] [stdout] 175 + //check_solution(&test_eq, &_op_seq); [INFO] [stdout] 176 + result += test_eq.solution; [INFO] [stdout] 177 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day7.rs:174:32 [INFO] [stdout] | [INFO] [stdout] 174 | match find_op_sequence(&test_eq, &ops) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `test_eq` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day8.rs:30:24 [INFO] [stdout] | [INFO] [stdout] 30 | pub fn from(input: &String) -> Self { [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] 30 - pub fn from(input: &String) -> Self { [INFO] [stdout] 30 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needless call to `bytes` [INFO] [stdout] --> src/day8.rs:35:33 [INFO] [stdout] | [INFO] [stdout] 35 | let num_cols = to_isize(input.lines().next().unwrap().bytes().len()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `input.lines().next().unwrap().len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes [INFO] [stdout] = note: `#[warn(clippy::needless_as_bytes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/day8.rs:40:25 [INFO] [stdout] | [INFO] [stdout] 40 | let c = char::try_from(c).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `char` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 40 - let c = char::try_from(c).unwrap(); [INFO] [stdout] 40 + let c = char::from(c); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/day8.rs:44:64 [INFO] [stdout] | [INFO] [stdout] 44 | let c_coords = antenna_coords.entry(c).or_insert(Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day8.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | / match city_map.coord_pairs_for_antenna(antenna) { [INFO] [stdout] 171 | | Some(coord_pairs) => { [INFO] [stdout] 172 | | for coord_pair in coord_pairs { [INFO] [stdout] 173 | | let antinodes = city_map.antinode_locations_1(coord_pair); [INFO] [stdout] ... | [INFO] [stdout] 183 | | None => (), [INFO] [stdout] 184 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 170 ~ if let Some(coord_pairs) = city_map.coord_pairs_for_antenna(antenna) { [INFO] [stdout] 171 + for coord_pair in coord_pairs { [INFO] [stdout] 172 + let antinodes = city_map.antinode_locations_1(coord_pair); [INFO] [stdout] 173 + if city_map.contains(antinodes.0) { [INFO] [stdout] 174 + antinode_locations.insert(antinodes.0); [INFO] [stdout] 175 + } [INFO] [stdout] 176 + if city_map.contains(antinodes.1) { [INFO] [stdout] 177 + antinode_locations.insert(antinodes.1); [INFO] [stdout] 178 + } [INFO] [stdout] 179 + } [INFO] [stdout] 180 + [INFO] [stdout] 181 + } [INFO] [stdout] | [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/day8.rs:199:9 [INFO] [stdout] | [INFO] [stdout] 199 | / match city_map.coord_pairs_for_antenna(antenna) { [INFO] [stdout] 200 | | Some(coord_pairs) => { [INFO] [stdout] 201 | | for coord_pair in coord_pairs { [INFO] [stdout] 202 | | let antinodes = city_map.antinode_locations_2(coord_pair); [INFO] [stdout] ... | [INFO] [stdout] 211 | | None => (), [INFO] [stdout] 212 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 199 ~ if let Some(coord_pairs) = city_map.coord_pairs_for_antenna(antenna) { [INFO] [stdout] 200 + for coord_pair in coord_pairs { [INFO] [stdout] 201 + let antinodes = city_map.antinode_locations_2(coord_pair); [INFO] [stdout] 202 + for antinode_pos in antinodes { [INFO] [stdout] 203 + if city_map.contains(antinode_pos) { [INFO] [stdout] 204 + antinode_locations.insert(antinode_pos); [INFO] [stdout] 205 + } [INFO] [stdout] 206 + } [INFO] [stdout] 207 + } [INFO] [stdout] 208 + [INFO] [stdout] 209 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day9.rs:27:20 [INFO] [stdout] | [INFO] [stdout] 27 | fn from(input: &String) -> Self { [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] 27 - fn from(input: &String) -> Self { [INFO] [stdout] 27 + fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day9.rs:65:40 [INFO] [stdout] | [INFO] [stdout] 65 | self.blocks.push(Rc::clone(&block)) [INFO] [stdout] | ^^^^^^ help: change this to: `block` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day9.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | return None [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 113 - return None [INFO] [stdout] 113 + None [INFO] [stdout] | [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/day9.rs:108:13 [INFO] [stdout] | [INFO] [stdout] 108 | / match *self.blocks[i] { [INFO] [stdout] 109 | | Block::Free => return Some(i), [INFO] [stdout] 110 | | _ => (), [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ help: try: `if let Block::Free = *self.blocks[i] { return Some(i) }` [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: unneeded `return` statement [INFO] [stdout] --> src/day9.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | return None [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 133 - return None [INFO] [stdout] 133 + None [INFO] [stdout] | [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/day9.rs:143:13 [INFO] [stdout] | [INFO] [stdout] 143 | / match *self.blocks[i] { [INFO] [stdout] 144 | | Block::File(_, _) => return Some(i), [INFO] [stdout] 145 | | _ => (), [INFO] [stdout] 146 | | } [INFO] [stdout] | |_____________^ help: try: `if let Block::File(_, _) = *self.blocks[i] { return Some(i) }` [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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day9.rs:170:32 [INFO] [stdout] | [INFO] [stdout] 170 | let current_file_idx = self.file_ptrs.get(&file_id).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.file_ptrs.get(&file_id).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day9.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | / match (self.find_first_free(0), self.find_last_data(self.blocks.len())) { [INFO] [stdout] 180 | | (Some(mut free_ptr), Some(mut data_ptr)) => { [INFO] [stdout] 181 | | while free_ptr < data_ptr { [INFO] [stdout] 182 | | self.swap_blocks(free_ptr, data_ptr); [INFO] [stdout] ... | [INFO] [stdout] 192 | | _ => (), [INFO] [stdout] 193 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 179 ~ if let (Some(mut free_ptr), Some(mut data_ptr)) = (self.find_first_free(0), self.find_last_data(self.blocks.len())) { [INFO] [stdout] 180 + while free_ptr < data_ptr { [INFO] [stdout] 181 + self.swap_blocks(free_ptr, data_ptr); [INFO] [stdout] 182 + match (self.find_first_free(free_ptr + 1), self.find_last_data(data_ptr)) { [INFO] [stdout] 183 + (Some(next_free), Some(next_data)) => { [INFO] [stdout] 184 + free_ptr = next_free; [INFO] [stdout] 185 + data_ptr = next_data; [INFO] [stdout] 186 + }, [INFO] [stdout] 187 + _ => return, [INFO] [stdout] 188 + } [INFO] [stdout] 189 + } [INFO] [stdout] 190 + } [INFO] [stdout] | [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/day9.rs:202:13 [INFO] [stdout] | [INFO] [stdout] 202 | / match free_at { [INFO] [stdout] 203 | | Some(free_at) => { [INFO] [stdout] 204 | | let file_id = self.files[i].id; [INFO] [stdout] 205 | | self.mv_file(file_id, free_at); [INFO] [stdout] 206 | | }, [INFO] [stdout] 207 | | None => (), [INFO] [stdout] 208 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 202 ~ if let Some(free_at) = free_at { [INFO] [stdout] 203 + let file_id = self.files[i].id; [INFO] [stdout] 204 + self.mv_file(file_id, free_at); [INFO] [stdout] 205 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day9.rs:285:34 [INFO] [stdout] | [INFO] [stdout] 285 | let disk_map = DiskMap::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day9.rs:297:34 [INFO] [stdout] | [INFO] [stdout] 297 | let disk_map = DiskMap::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day10.rs:26:24 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn from(input: &String) -> Self { [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] 26 - pub fn from(input: &String) -> Self { [INFO] [stdout] 26 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [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/day10.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | / match self.map.get(&neighbor_pos) { [INFO] [stdout] 88 | | Some(_) => result.push(neighbor_pos), [INFO] [stdout] 89 | | None => (), [INFO] [stdout] 90 | | } [INFO] [stdout] | |_____________^ help: try: `if let Some(_) = self.map.get(&neighbor_pos) { result.push(neighbor_pos) }` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:106:34 [INFO] [stdout] | [INFO] [stdout] 106 | let topo_map = TopoMap::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:129:34 [INFO] [stdout] | [INFO] [stdout] 129 | let topo_map = TopoMap::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b_press` [INFO] [stdout] --> src/day13.rs:215:9 [INFO] [stdout] | [INFO] [stdout] 215 | for b_press in 0..max_press_count { [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_b_press` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_a_presses` [INFO] [stdout] --> src/day13.rs:291:33 [INFO] [stdout] | [INFO] [stdout] 291 | ... let num_a_presses = a_moves_x + k*(conf.b_offset.x/gcd_x); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_a_presses` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day11.rs:41:24 [INFO] [stdout] | [INFO] [stdout] 41 | pub fn from(input: &String) -> Self { [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] 41 - pub fn from(input: &String) -> Self { [INFO] [stdout] 41 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_b_presses` [INFO] [stdout] --> src/day13.rs:292:33 [INFO] [stdout] | [INFO] [stdout] 292 | ... let num_b_presses = b_moves_x - k*(conf.a_offset.x/gcd_x); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_b_presses` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/day11.rs:53:90 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn _get_leaf_nodes<'a>(& self, t: &'a StoneTree, leaves: &mut Vec<&'a StoneTree>) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day11.rs:54:12 [INFO] [stdout] | [INFO] [stdout] 54 | if t.children.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `t.children.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day11.rs:55:25 [INFO] [stdout] | [INFO] [stdout] 55 | leaves.push(&t) [INFO] [stdout] | ^^ help: change this to: `t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day11.rs:67:30 [INFO] [stdout] | [INFO] [stdout] 67 | self._get_leaf_nodes(&self, &mut leaves); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day11.rs:75:15 [INFO] [stdout] | [INFO] [stdout] 75 | while depth_vals.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!depth_vals.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: unneeded unit return type [INFO] [stdout] --> src/day11.rs:132:27 [INFO] [stdout] | [INFO] [stdout] 132 | pub fn step(&mut self) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day11.rs:133:12 [INFO] [stdout] | [INFO] [stdout] 133 | if self.children.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.children.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 `.is_multiple_of()` [INFO] [stdout] --> src/day11.rs:145:19 [INFO] [stdout] | [INFO] [stdout] 145 | } else if count_digits(val) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count_digits(val).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/day11.rs:156:37 [INFO] [stdout] | [INFO] [stdout] 156 | pub fn build_children(&mut self) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [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/day11.rs:162:9 [INFO] [stdout] | [INFO] [stdout] 162 | / match child_vals.1 { [INFO] [stdout] 163 | | Some(v) => { [INFO] [stdout] 164 | | self.children.push(Self { [INFO] [stdout] 165 | | value: v, [INFO] [stdout] ... | [INFO] [stdout] 170 | | None => (), [INFO] [stdout] 171 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 162 ~ if let Some(v) = child_vals.1 { [INFO] [stdout] 163 + self.children.push(Self { [INFO] [stdout] 164 + value: v, [INFO] [stdout] 165 + children: Vec::new() [INFO] [stdout] 166 + }); [INFO] [stdout] 167 + [INFO] [stdout] 168 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day11.rs:175:12 [INFO] [stdout] | [INFO] [stdout] 175 | if self.children.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.children.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:77:66 [INFO] [stdout] | [INFO] [stdout] 77 | let (min_corner, max_corner) = self._get_min_max_corners(&plots); [INFO] [stdout] | ^^^^^^ help: change this to: `plots` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/day12.rs:173:12 [INFO] [stdout] | [INFO] [stdout] 173 | x: c.x + 0, [INFO] [stdout] | ^^^^^^^ help: consider reducing it to: `c.x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day12.rs:196:24 [INFO] [stdout] | [INFO] [stdout] 196 | pub fn from(input: &String) -> Self { [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] 196 - pub fn from(input: &String) -> Self { [INFO] [stdout] 196 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day12.rs:234:21 [INFO] [stdout] | [INFO] [stdout] 234 | / if neighbor == plot { [INFO] [stdout] 235 | | result.push(neighbor_coord) [INFO] [stdout] 236 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 233 ~ Some(neighbor) [INFO] [stdout] 234 ~ if neighbor == plot => { [INFO] [stdout] 235 | result.push(neighbor_coord) [INFO] [stdout] 236 ~ }, [INFO] [stdout] | [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/day12.rs:232:13 [INFO] [stdout] | [INFO] [stdout] 232 | / match self.plots.get(&neighbor_coord) { [INFO] [stdout] 233 | | Some(neighbor) => { [INFO] [stdout] 234 | | if neighbor == plot { [INFO] [stdout] 235 | | result.push(neighbor_coord) [INFO] [stdout] ... | [INFO] [stdout] 238 | | None => (), [INFO] [stdout] 239 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 232 ~ if let Some(neighbor) = self.plots.get(&neighbor_coord) { [INFO] [stdout] 233 + if neighbor == plot { [INFO] [stdout] 234 + result.push(neighbor_coord) [INFO] [stdout] 235 + } [INFO] [stdout] 236 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day12.rs:249:15 [INFO] [stdout] | [INFO] [stdout] 249 | while to_examine.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_examine.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:296:31 [INFO] [stdout] | [INFO] [stdout] 296 | let garden = Garden::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:310:31 [INFO] [stdout] | [INFO] [stdout] 310 | let garden = Garden::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `src_entity` [INFO] [stdout] --> src/day15.rs:185:13 [INFO] [stdout] | [INFO] [stdout] 185 | let src_entity = self.map.get(&src).unwrap(); [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_src_entity` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day13.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | / if loc == self.conf.prize_location { [INFO] [stdout] 87 | | true [INFO] [stdout] 88 | | } else { [INFO] [stdout] 89 | | false [INFO] [stdout] 90 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `loc == self.conf.prize_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day13.rs:102:54 [INFO] [stdout] | [INFO] [stdout] 102 | let (_, [x_offset, y_offset]) = rx.captures_iter(&line).map(|c| c.extract()).next().unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day13.rs:112:48 [INFO] [stdout] | [INFO] [stdout] 112 | let (_, [x_loc, y_loc]) = rx.captures_iter(&line).map(|c| c.extract()).next().unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day13.rs:119:26 [INFO] [stdout] | [INFO] [stdout] 119 | pub fn parse_conf(input: &String) -> 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] 119 - pub fn parse_conf(input: &String) -> Vec { [INFO] [stdout] 119 + pub fn parse_conf(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/day13.rs:135:16 [INFO] [stdout] | [INFO] [stdout] 135 | if let None = lines.next() { [INFO] [stdout] | -------^^^^--------------- help: try: `if lines.next().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: this `if` has identical blocks [INFO] [stdout] --> src/day13.rs:149:91 [INFO] [stdout] | [INFO] [stdout] 149 | if current.num_a_presses > max_press_count || current.num_b_presses > max_press_count { [INFO] [stdout] | ___________________________________________________________________________________________^ [INFO] [stdout] 150 | | true [INFO] [stdout] 151 | | } else if current.beyond_target() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day13.rs:151:39 [INFO] [stdout] | [INFO] [stdout] 151 | } else if current.beyond_target() { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 152 | | true [INFO] [stdout] 153 | | } else if current.cost() >= best.cost() { [INFO] [stdout] | |_____^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day13.rs:151:39 [INFO] [stdout] | [INFO] [stdout] 151 | } else if current.beyond_target() { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 152 | | true [INFO] [stdout] 153 | | } else if current.cost() >= best.cost() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day13.rs:153:45 [INFO] [stdout] | [INFO] [stdout] 153 | } else if current.cost() >= best.cost() { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 154 | | true [INFO] [stdout] 155 | | } else { [INFO] [stdout] | |_____^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day13.rs:153:12 [INFO] [stdout] | [INFO] [stdout] 153 | } else if current.cost() >= best.cost() { [INFO] [stdout] | ____________^ [INFO] [stdout] 154 | | true [INFO] [stdout] 155 | | } else { [INFO] [stdout] 156 | | false [INFO] [stdout] 157 | | } [INFO] [stdout] | |_____^ help: you can reduce it to: `{ current.cost() >= best.cost() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [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/day13.rs:338:9 [INFO] [stdout] | [INFO] [stdout] 338 | / match find_min_winning_cost(c, constants::MAX_PRESSES) { [INFO] [stdout] 339 | | Some(cost) => token_count += cost, [INFO] [stdout] 340 | | None => (), [INFO] [stdout] 341 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(cost) = find_min_winning_cost(c, constants::MAX_PRESSES) { token_count += cost }` [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: manually reimplementing `div_ceil` [INFO] [stdout] --> src/day13.rs:359:22 [INFO] [stdout] | [INFO] [stdout] 359 | let chunk_size = (confs.len() + 15) / 16; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `confs.len().div_ceil(16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` 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/day13.rs:366:17 [INFO] [stdout] | [INFO] [stdout] 366 | / match find_min_winning_cost(&c, max_steps) { [INFO] [stdout] 367 | | Some(cost) => token_count += cost, [INFO] [stdout] 368 | | None => (), [INFO] [stdout] 369 | | } [INFO] [stdout] | |_________________^ help: try: `if let Some(cost) = find_min_winning_cost(&c, max_steps) { token_count += cost }` [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: unneeded late initialization [INFO] [stdout] --> src/day14.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | let next_x; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `next_x` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 80 ~ [INFO] [stdout] 81 | let next_y; [INFO] [stdout] 82 | [INFO] [stdout] 83 ~ let next_x = if try_next_x >= 0 { [INFO] [stdout] 84 ~ ((robot.loc.x + robot.vel.x) % self.dimensions.x).abs() [INFO] [stdout] 85 | } else { [INFO] [stdout] 86 ~ self.dimensions.x - ((robot.loc.x + robot.vel.x) % self.dimensions.x).abs() [INFO] [stdout] 87 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/day14.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | let next_y; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `next_y` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 81 ~ [INFO] [stdout] 82 | [INFO] [stdout] ... [INFO] [stdout] 88 | [INFO] [stdout] 89 ~ let next_y = if try_next_y >= 0 { [INFO] [stdout] 90 ~ ((robot.loc.y + robot.vel.y) % self.dimensions.y).abs() [INFO] [stdout] 91 | } else { [INFO] [stdout] 92 ~ self.dimensions.y - ((robot.loc.y + robot.vel.y) % self.dimensions.y).abs() [INFO] [stdout] 93 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Quadrant; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/day14.rs:155:22 [INFO] [stdout] | [INFO] [stdout] 155 | for q in QUADRANTS.clone().into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `QUADRANTS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day14.rs:157:36 [INFO] [stdout] | [INFO] [stdout] 157 | if in_bounds(&loc, &bounds) { [INFO] [stdout] | ^^^^^^^ help: change this to: `bounds` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Quadrant; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/day14.rs:195:26 [INFO] [stdout] | [INFO] [stdout] 195 | for q in QUADRANTS.clone().into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `QUADRANTS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day14.rs:210:13 [INFO] [stdout] | [INFO] [stdout] 210 | 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: empty string literal in `println!` [INFO] [stdout] --> src/day14.rs:226:13 [INFO] [stdout] | [INFO] [stdout] 226 | 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] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day14.rs:253:27 [INFO] [stdout] | [INFO] [stdout] 253 | pub fn parse_input(input: &String) -> 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] 253 - pub fn parse_input(input: &String) -> Vec { [INFO] [stdout] 253 + pub fn parse_input(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day14.rs:259:67 [INFO] [stdout] | [INFO] [stdout] 259 | for (_, [x_pos, y_pos, x_vel, y_vel]) in rx.captures_iter(&line).map(|c| c.extract()) { [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day14.rs:289:30 [INFO] [stdout] | [INFO] [stdout] 289 | for robot in parse_input(&input).into_iter() { [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Quadrant; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/day14.rs:307:14 [INFO] [stdout] | [INFO] [stdout] 307 | for q in QUADRANTS.clone().into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `QUADRANTS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day14.rs:322:30 [INFO] [stdout] | [INFO] [stdout] 322 | for robot in parse_input(&input).into_iter() { [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day15.rs:63:31 [INFO] [stdout] | [INFO] [stdout] 63 | pub fn parse_movements(input: &String) -> 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] 63 - pub fn parse_movements(input: &String) -> Vec { [INFO] [stdout] 63 + pub fn parse_movements(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day15.rs:94:32 [INFO] [stdout] | [INFO] [stdout] 94 | pub fn expand_warehouse(input: &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 94 - pub fn expand_warehouse(input: &String) -> String { [INFO] [stdout] 94 + pub fn expand_warehouse(input: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day15.rs:108:24 [INFO] [stdout] | [INFO] [stdout] 108 | pub fn from(input: &String) -> Self { [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] 108 - pub fn from(input: &String) -> Self { [INFO] [stdout] 108 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:185:39 [INFO] [stdout] | [INFO] [stdout] 185 | let src_entity = self.map.get(&src).unwrap(); [INFO] [stdout] | ^^^^ help: change this to: `src` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:199:60 [INFO] [stdout] | [INFO] [stdout] 199 | let push_left = self._try_push(&box_l_src, &dir, pushes); [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:200:61 [INFO] [stdout] | [INFO] [stdout] 200 | let push_right = self._try_push(&box_r_src, &dir, pushes); [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:222:45 [INFO] [stdout] | [INFO] [stdout] 222 | match self._try_push(&dest, &dir, pushes) { [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:261:28 [INFO] [stdout] | [INFO] [stdout] 261 | match self.map.get(&dest).unwrap() { [INFO] [stdout] | ^^^^^ help: change this to: `dest` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:263:39 [INFO] [stdout] | [INFO] [stdout] 263 | match self.map.remove(&src).unwrap() { [INFO] [stdout] | ^^^^ help: change this to: `src` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:277:55 [INFO] [stdout] | [INFO] [stdout] 277 | match self._try_push(&self.robot_loc.clone(), &dir, &mut pushes) { [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day15.rs:316:17 [INFO] [stdout] | [INFO] [stdout] 316 | / match self.map.get(&Loc { x, y }).unwrap() { [INFO] [stdout] 317 | | Some(Entity::Box) => { [INFO] [stdout] 318 | | sum += 100 * y + x [INFO] [stdout] 319 | | }, [INFO] [stdout] 320 | | _ => (), [INFO] [stdout] 321 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 316 ~ if let Some(Entity::Box) = self.map.get(&Loc { x, y }).unwrap() { [INFO] [stdout] 317 + sum += 100 * y + x [INFO] [stdout] 318 + } [INFO] [stdout] | [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/day15.rs:331:17 [INFO] [stdout] | [INFO] [stdout] 331 | / match self.map.get(&Loc { x, y }).unwrap() { [INFO] [stdout] 332 | | Some(Entity::BoxLeft) => { [INFO] [stdout] 333 | | sum += 100 * y + x [INFO] [stdout] 334 | | }, [INFO] [stdout] 335 | | _ => (), [INFO] [stdout] 336 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 331 ~ if let Some(Entity::BoxLeft) = self.map.get(&Loc { x, y }).unwrap() { [INFO] [stdout] 332 + sum += 100 * y + x [INFO] [stdout] 333 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day15.rs:362:13 [INFO] [stdout] | [INFO] [stdout] 362 | write!(f, "\n").expect("failed to write"); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 362 - write!(f, "\n").expect("failed to write"); [INFO] [stdout] 362 + writeln!(f).expect("failed to write"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day15.rs:364:9 [INFO] [stdout] | [INFO] [stdout] 364 | write!(f, "\n") [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 364 - write!(f, "\n") [INFO] [stdout] 364 + writeln!(f) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:375:34 [INFO] [stdout] | [INFO] [stdout] 375 | let mut wh = Warehouse::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:376:33 [INFO] [stdout] | [INFO] [stdout] 376 | let moves = parse_movements(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:391:43 [INFO] [stdout] | [INFO] [stdout] 391 | let expanded_input = expand_warehouse(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:393:33 [INFO] [stdout] | [INFO] [stdout] 393 | let moves = parse_movements(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day16.rs:167:27 [INFO] [stdout] | [INFO] [stdout] 167 | fn _parse_base(input: &String) -> BaseMap { [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] 167 - fn _parse_base(input: &String) -> BaseMap { [INFO] [stdout] 167 + fn _parse_base(input: &str) -> BaseMap { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/day16.rs:188:53 [INFO] [stdout] | [INFO] [stdout] 188 | neighbor_map.entry(loc.clone()).or_insert(FxHashMap::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:201:42 [INFO] [stdout] | [INFO] [stdout] 201 | let base_map = Maze::_parse_base(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:217:43 [INFO] [stdout] | [INFO] [stdout] 217 | Self::_init_neighbors(&loc, &base_map, &mut neighbor_map); [INFO] [stdout] | ^^^^ help: change this to: `loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:221:43 [INFO] [stdout] | [INFO] [stdout] 221 | Self::_init_neighbors(&loc, &base_map, &mut neighbor_map); [INFO] [stdout] | ^^^^ help: change this to: `loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:224:43 [INFO] [stdout] | [INFO] [stdout] 224 | Self::_init_neighbors(&loc, &base_map, &mut neighbor_map); [INFO] [stdout] | ^^^^ help: change this to: `loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day16.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | / match self.can_move(deer_src, r.as_ref()) { [INFO] [stdout] 289 | | Some(_move) => { [INFO] [stdout] 290 | | moves.push(_move); [INFO] [stdout] 291 | | }, [INFO] [stdout] 292 | | None => (), [INFO] [stdout] 293 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 288 ~ if let Some(_move) = self.can_move(deer_src, r.as_ref()) { [INFO] [stdout] 289 + moves.push(_move); [INFO] [stdout] 290 + } [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/day16.rs:305:34 [INFO] [stdout] | [INFO] [stdout] 305 | pub fn compute_cost(actions: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 305 - pub fn compute_cost(actions: &Vec) -> isize { [INFO] [stdout] 305 + pub fn compute_cost(actions: &[Action]) -> isize { [INFO] [stdout] | [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/day16.rs:331:9 [INFO] [stdout] | [INFO] [stdout] 331 | / match a { [INFO] [stdout] 332 | | Action::Move(sd, dd) => { [INFO] [stdout] 333 | | moves.entry(sd.loc.clone()).or_insert(dd.dir.clone()); [INFO] [stdout] 334 | | }, [INFO] [stdout] 335 | | _ => (), [INFO] [stdout] 336 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 331 ~ if let Action::Move(sd, dd) = a { [INFO] [stdout] 332 + moves.entry(sd.loc.clone()).or_insert(dd.dir.clone()); [INFO] [stdout] 333 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day16.rs:339:5 [INFO] [stdout] | [INFO] [stdout] 339 | 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] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day16.rs:375:9 [INFO] [stdout] | [INFO] [stdout] 375 | 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] 375 - print!("\n"); [INFO] [stdout] 375 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day16.rs:444:11 [INFO] [stdout] | [INFO] [stdout] 444 | while to_process.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_process.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day16.rs:530:15 [INFO] [stdout] | [INFO] [stdout] 530 | while to_process.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_process.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:546:44 [INFO] [stdout] | [INFO] [stdout] 546 | for mv in maze.get_valid_moves(&last_move_deer).iter_mut() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `last_move_deer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day16.rs:555:21 [INFO] [stdout] | [INFO] [stdout] 555 | / match best_costs.get(&d) { [INFO] [stdout] 556 | | Some(c) => { [INFO] [stdout] 557 | | target_vals.push(c); [INFO] [stdout] ... | [INFO] [stdout] 560 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 555 ~ if let Some(c) = best_costs.get(&d) { [INFO] [stdout] 556 + target_vals.push(c); [INFO] [stdout] 557 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:555:42 [INFO] [stdout] | [INFO] [stdout] 555 | match best_costs.get(&d) { [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:583:35 [INFO] [stdout] | [INFO] [stdout] 583 | let best = best_costs.get(&deer).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `deer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:613:27 [INFO] [stdout] | [INFO] [stdout] 613 | let maze = Maze::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:625:27 [INFO] [stdout] | [INFO] [stdout] 625 | let maze = Maze::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day16.rs:631:13 [INFO] [stdout] | [INFO] [stdout] 631 | / match a { [INFO] [stdout] 632 | | Action::Move(src, dest) => { [INFO] [stdout] 633 | | visits.insert(src.loc.clone()); [INFO] [stdout] 634 | | visits.insert(dest.loc.clone()); [INFO] [stdout] 635 | | } [INFO] [stdout] 636 | | _ => (), [INFO] [stdout] 637 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 631 ~ if let Action::Move(src, dest) = a { [INFO] [stdout] 632 + visits.insert(src.loc.clone()); [INFO] [stdout] 633 + visits.insert(dest.loc.clone()); [INFO] [stdout] 634 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day17.rs:18:24 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn from(input: &String) -> Self { [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] 18 - pub fn from(input: &String) -> Self { [INFO] [stdout] 18 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> src/day17.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0..=7` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] = note: `#[warn(clippy::manual_range_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> src/day17.rs:98:13 [INFO] [stdout] | [INFO] [stdout] 98 | 0 | 1 | 2 | 3 => operand.0, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `0..=3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:112:37 [INFO] [stdout] | [INFO] [stdout] 112 | if !self._valid_op(ins_ptr, &program) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day17.rs:165:24 [INFO] [stdout] | [INFO] [stdout] 165 | pub fn from(input: &String) -> Self { [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] 165 - pub fn from(input: &String) -> Self { [INFO] [stdout] 165 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:202:49 [INFO] [stdout] | [INFO] [stdout] 202 | if let Some(op) = self.op(self.ins_ptr, &program) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/day17.rs:274:9 [INFO] [stdout] | [INFO] [stdout] 274 | / loop { [INFO] [stdout] 275 | | match self.step(&program) { [INFO] [stdout] 276 | | Some(next_ins_ptr) => { [INFO] [stdout] 277 | | self.ins_ptr = next_ins_ptr; [INFO] [stdout] ... | [INFO] [stdout] 281 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(next_ins_ptr) = self.step(&program) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:275:29 [INFO] [stdout] | [INFO] [stdout] 275 | match self.step(&program) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:286:25 [INFO] [stdout] | [INFO] [stdout] 286 | match self.step(&program) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:302:31 [INFO] [stdout] | [INFO] [stdout] 302 | let mut proc = Proc::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:303:30 [INFO] [stdout] | [INFO] [stdout] 303 | let prog = Program::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:406:31 [INFO] [stdout] | [INFO] [stdout] 406 | let mut proc = Proc::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:407:30 [INFO] [stdout] | [INFO] [stdout] 407 | let prog = Program::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:439:30 [INFO] [stdout] | [INFO] [stdout] 439 | let prog = Program::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:440:32 [INFO] [stdout] | [INFO] [stdout] 440 | let init_proc = Proc::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day17.rs:481:25 [INFO] [stdout] | [INFO] [stdout] 481 | / if proc.output == prog.instructions[prog.instructions.len() - proc.output.len()..] { [INFO] [stdout] 482 | | if power < 15 { [INFO] [stdout] 483 | | to_process.push_back((power + 1, a*8, result.clone())); [INFO] [stdout] 484 | | println!("power: {}\t{:?}", power, result); [INFO] [stdout] 485 | | } [INFO] [stdout] 486 | | } [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] 481 ~ if proc.output == prog.instructions[prog.instructions.len() - proc.output.len()..] [INFO] [stdout] 482 ~ && power < 15 { [INFO] [stdout] 483 | to_process.push_back((power + 1, a*8, result.clone())); [INFO] [stdout] 484 | println!("power: {}\t{:?}", power, result); [INFO] [stdout] 485 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day17.rs:487:25 [INFO] [stdout] | [INFO] [stdout] 487 | / if power == 15 { [INFO] [stdout] 488 | | if result == prog.instructions { [INFO] [stdout] 489 | | println!("result found. A: {}", a); [INFO] [stdout] 490 | | println!("{:?}", result); [INFO] [stdout] ... | [INFO] [stdout] 493 | | } [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] 487 ~ if power == 15 [INFO] [stdout] 488 ~ && result == prog.instructions { [INFO] [stdout] 489 | println!("result found. A: {}", a); [INFO] [stdout] 490 | println!("{:?}", result); [INFO] [stdout] 491 | results.push(a); [INFO] [stdout] 492 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day17.rs:497:25 [INFO] [stdout] | [INFO] [stdout] 497 | / if proc.output.len() == 1 { [INFO] [stdout] 498 | | if proc.output[0] != target { [INFO] [stdout] 499 | | break; [INFO] [stdout] 500 | | } [INFO] [stdout] 501 | | } [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] 497 ~ if proc.output.len() == 1 [INFO] [stdout] 498 ~ && proc.output[0] != target { [INFO] [stdout] 499 | break; [INFO] [stdout] 500 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day18.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 55 | fn parse_corrupt_locs(input: &String, mut bytes_fallen: isize) -> FxHashSet { [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] 55 - fn parse_corrupt_locs(input: &String, mut bytes_fallen: isize) -> FxHashSet { [INFO] [stdout] 55 + fn parse_corrupt_locs(input: &str, mut bytes_fallen: isize) -> FxHashSet { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day18.rs:80:45 [INFO] [stdout] | [INFO] [stdout] 80 | if next_loc.x < 0 || next_loc.y < 0 { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 81 | | continue; [INFO] [stdout] 82 | | } else if next_loc.x > mmap.x_max || next_loc.y > mmap.y_max { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day18.rs:82:70 [INFO] [stdout] | [INFO] [stdout] 82 | } else if next_loc.x > mmap.x_max || next_loc.y > mmap.y_max { [INFO] [stdout] | ______________________________________________________________________^ [INFO] [stdout] 83 | | continue; [INFO] [stdout] 84 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:113:43 [INFO] [stdout] | [INFO] [stdout] 113 | let best_len = best_paths.get(&frontier_loc).unwrap()[0].len(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `frontier_loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:115:45 [INFO] [stdout] | [INFO] [stdout] 115 | let next_locs = get_valid_moves(&frontier_loc, &mmap); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `frontier_loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:115:60 [INFO] [stdout] | [INFO] [stdout] 115 | let next_locs = get_valid_moves(&frontier_loc, &mmap); [INFO] [stdout] | ^^^^^ help: change this to: `mmap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:121:44 [INFO] [stdout] | [INFO] [stdout] 121 | if best_paths.contains_key(&nl) { [INFO] [stdout] | ^^^ help: change this to: `nl` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:122:50 [INFO] [stdout] | [INFO] [stdout] 122 | let nl_best = best_paths.get(&nl).unwrap()[0].len(); [INFO] [stdout] | ^^^ help: change this to: `nl` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:125:64 [INFO] [stdout] | [INFO] [stdout] 125 | let mut updated_paths = best_paths.get(&frontier_loc).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `frontier_loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:148:60 [INFO] [stdout] | [INFO] [stdout] 148 | let mut updated_paths = best_paths.get(&frontier_loc).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `frontier_loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/day18.rs:161:40 [INFO] [stdout] | [INFO] [stdout] 161 | let best_path_locs: Vec = best_paths.keys().map(|k| k.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `best_paths.keys().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:163:34 [INFO] [stdout] | [INFO] [stdout] 163 | if frontier.contains(&l) || next_frontier.contains(&l) { [INFO] [stdout] | ^^ help: change this to: `l` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:163:64 [INFO] [stdout] | [INFO] [stdout] 163 | if frontier.contains(&l) || next_frontier.contains(&l) { [INFO] [stdout] | ^^ help: change this to: `l` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:166:35 [INFO] [stdout] | [INFO] [stdout] 166 | best_paths.remove(&l); [INFO] [stdout] | ^^ help: change this to: `l` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:215:43 [INFO] [stdout] | [INFO] [stdout] 215 | let corrupt_locs = parse_corrupt_locs(&input, bytes_fallen); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:227:47 [INFO] [stdout] | [INFO] [stdout] 227 | let corrupt_locs = parse_corrupt_locs(&input, bytes_fallen); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day19.rs:14:24 [INFO] [stdout] | [INFO] [stdout] 14 | fn parse_towels(input: &String) -> FxHashSet { [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] 14 - fn parse_towels(input: &String) -> FxHashSet { [INFO] [stdout] 14 + fn parse_towels(input: &str) -> FxHashSet { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day19.rs:19:25 [INFO] [stdout] | [INFO] [stdout] 19 | fn parse_designs(input: &String) -> 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] 19 - fn parse_designs(input: &String) -> Vec { [INFO] [stdout] 19 + fn parse_designs(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day19.rs:33:8 [INFO] [stdout] | [INFO] [stdout] 33 | if design == "" { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:47:26 [INFO] [stdout] | [INFO] [stdout] 47 | if can_build(&towels, &design[0..design.len()-i], max_len) { [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day19.rs:56:8 [INFO] [stdout] | [INFO] [stdout] 56 | if design == "" { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [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/day19.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | / match chunkiest_solution(&towels, &next_design, max_len) { [INFO] [stdout] 72 | | Some(mut sol) => { [INFO] [stdout] 73 | | sol.push(next_design); [INFO] [stdout] 74 | | return Some(sol); [INFO] [stdout] 75 | | }, [INFO] [stdout] 76 | | None => (), [INFO] [stdout] 77 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 71 ~ if let Some(mut sol) = chunkiest_solution(&towels, &next_design, max_len) { [INFO] [stdout] 72 + sol.push(next_design); [INFO] [stdout] 73 + return Some(sol); [INFO] [stdout] 74 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:71:38 [INFO] [stdout] | [INFO] [stdout] 71 | match chunkiest_solution(&towels, &next_design, max_len) { [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:71:47 [INFO] [stdout] | [INFO] [stdout] 71 | match chunkiest_solution(&towels, &next_design, max_len) { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `next_design` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/day19.rs:83:17 [INFO] [stdout] | [INFO] [stdout] 83 | fn count_combos<'a>(towels: &FxHashSet, design: &'a str, mut max_len: usize) -> isize { [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] 83 - fn count_combos<'a>(towels: &FxHashSet, design: &'a str, mut max_len: usize) -> isize { [INFO] [stdout] 83 + fn count_combos(towels: &FxHashSet, design: &str, mut max_len: usize) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day19.rs:84:8 [INFO] [stdout] | [INFO] [stdout] 84 | if design == "" { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/day19.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | let _can_build: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 96 | _can_build = can_build(&towels, next_des, max_len); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `_can_build` here [INFO] [stdout] | [INFO] [stdout] 95 ~ [INFO] [stdout] 96 ~ let _can_build: bool = can_build(&towels, next_des, max_len); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:96:36 [INFO] [stdout] | [INFO] [stdout] 96 | _can_build = can_build(&towels, next_des, max_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:98:39 [INFO] [stdout] | [INFO] [stdout] 98 | count += count_combos(&towels, next_des, max_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:107:31 [INFO] [stdout] | [INFO] [stdout] 107 | let towels = parse_towels(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:109:33 [INFO] [stdout] | [INFO] [stdout] 109 | let designs = parse_designs(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day19.rs:136:32 [INFO] [stdout] | [INFO] [stdout] 136 | pub fn get_all_combinations(a: &Vec, b: &Vec) -> Vec<(String, String)> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 136 - pub fn get_all_combinations(a: &Vec, b: &Vec) -> Vec<(String, String)> { [INFO] [stdout] 136 + pub fn get_all_combinations(a: &[String], b: &Vec) -> Vec<(String, String)> { [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/day19.rs:136:49 [INFO] [stdout] | [INFO] [stdout] 136 | pub fn get_all_combinations(a: &Vec, b: &Vec) -> Vec<(String, String)> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 136 - pub fn get_all_combinations(a: &Vec, b: &Vec) -> Vec<(String, String)> { [INFO] [stdout] 136 + pub fn get_all_combinations(a: &Vec, b: &[String]) -> Vec<(String, String)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:149:31 [INFO] [stdout] | [INFO] [stdout] 149 | let towels = parse_towels(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:151:33 [INFO] [stdout] | [INFO] [stdout] 151 | let designs = parse_designs(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day19.rs:178:13 [INFO] [stdout] | [INFO] [stdout] 178 | / if t.len() >= min_len { [INFO] [stdout] 179 | | if towels.contains(&design[base_idx..base_idx + t.len()]) && &design[base_idx..base_idx + t.len()] == t { [INFO] [stdout] 180 | | gap_crossing_patterns.push((t.clone(), base_idx)); [INFO] [stdout] 181 | | } [INFO] [stdout] 182 | | } [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] 178 ~ if t.len() >= min_len [INFO] [stdout] 179 ~ && towels.contains(&design[base_idx..base_idx + t.len()]) && &design[base_idx..base_idx + t.len()] == t { [INFO] [stdout] 180 | gap_crossing_patterns.push((t.clone(), base_idx)); [INFO] [stdout] 181 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:188:29 [INFO] [stdout] | [INFO] [stdout] 188 | sum += count_combos(&towels, &design[0..midpt], max_towel_len) [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:189:31 [INFO] [stdout] | [INFO] [stdout] 189 | * count_combos(&towels, &design[midpt..], max_towel_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:192:33 [INFO] [stdout] | [INFO] [stdout] 192 | sum += count_combos(&towels, &design[0..p.1], max_towel_len) [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:193:35 [INFO] [stdout] | [INFO] [stdout] 193 | * count_combos(&towels, &design[p.1 + p.0.len()..], max_towel_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:196:36 [INFO] [stdout] | [INFO] [stdout] 196 | sum += count_design_combos(&towels, &design[0..midpt], biggest_towel_len) [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:197:38 [INFO] [stdout] | [INFO] [stdout] 197 | * count_design_combos(&towels, &design[midpt..], biggest_towel_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:200:40 [INFO] [stdout] | [INFO] [stdout] 200 | sum += count_design_combos(&towels, &design[0..p.1], biggest_towel_len) [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:201:42 [INFO] [stdout] | [INFO] [stdout] 201 | * count_design_combos(&towels, &design[p.1 + p.0.len()..], biggest_towel_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `device` [INFO] [stdout] --> src/day24.rs:214:14 [INFO] [stdout] | [INFO] [stdout] 214 | fn rand_test(device: &Device, gate_overrides: &Vec, iterations: isize) -> isize { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_device` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day20.rs:33:24 [INFO] [stdout] | [INFO] [stdout] 33 | pub fn from(input: &String) -> Self { [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] 33 - pub fn from(input: &String) -> Self { [INFO] [stdout] 33 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `y` is used as a loop counter [INFO] [stdout] --> src/day20.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | for row in input.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (y, row) in input.lines().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: the variable `x` is used as a loop counter [INFO] [stdout] --> src/day20.rs:40:13 [INFO] [stdout] | [INFO] [stdout] 40 | for c in row.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (x, c) in row.chars().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `total_fails` is assigned to, but never used [INFO] [stdout] --> src/day24.rs:232:9 [INFO] [stdout] | [INFO] [stdout] 232 | let mut total_fails = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_total_fails` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:246:17 [INFO] [stdout] | [INFO] [stdout] 246 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:260:17 [INFO] [stdout] | [INFO] [stdout] 260 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:274:17 [INFO] [stdout] | [INFO] [stdout] 274 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20.rs:121:36 [INFO] [stdout] | [INFO] [stdout] 121 | if result.contains_key(&m) { [INFO] [stdout] | ^^ help: change this to: `m` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20.rs:138:29 [INFO] [stdout] | [INFO] [stdout] 138 | let track = Track::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20.rs:188:29 [INFO] [stdout] | [INFO] [stdout] 188 | let track = Track::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `total_fails` is assigned to, but never used [INFO] [stdout] --> src/day24.rs:281:9 [INFO] [stdout] | [INFO] [stdout] 281 | let mut total_fails = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_total_fails` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:294:17 [INFO] [stdout] | [INFO] [stdout] 294 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:308:17 [INFO] [stdout] | [INFO] [stdout] 308 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:322:17 [INFO] [stdout] | [INFO] [stdout] 322 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `total_fails` is never read [INFO] [stdout] --> src/day24.rs:336:17 [INFO] [stdout] | [INFO] [stdout] 336 | total_fails += 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day21.rs:224:17 [INFO] [stdout] | [INFO] [stdout] 224 | return result; [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] 224 ~ result [INFO] [stdout] 225 | }, [INFO] [stdout] ... [INFO] [stdout] 238 | } [INFO] [stdout] 239 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day21.rs:237:17 [INFO] [stdout] | [INFO] [stdout] 237 | return result; [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] 237 ~ result [INFO] [stdout] 238 | } [INFO] [stdout] 239 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:176:68 [INFO] [stdout] | [INFO] [stdout] 176 | let key_paths_to_solve = controller.solve_root_seq(&key_seq); [INFO] [stdout] | ^^^^^^^^ help: change this to: `key_seq` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:185:47 [INFO] [stdout] | [INFO] [stdout] 185 | ... let k = op_to_key(&op); [INFO] [stdout] | ^^^ help: change this to: `op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `shortest_paths` [INFO] [stdout] --> src/day21.rs:187:38 [INFO] [stdout] | [INFO] [stdout] 187 | ... for i in 0..shortest_paths.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 [INFO] [stdout] | [INFO] [stdout] 187 - for i in 0..shortest_paths.len() { [INFO] [stdout] 187 + for in &mut shortest_paths { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day21.rs:190:32 [INFO] [stdout] | [INFO] [stdout] 190 | ... if key_path_results.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!key_path_results.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `key_path_results` [INFO] [stdout] --> src/day21.rs:193:42 [INFO] [stdout] | [INFO] [stdout] 193 | ... for i in 0..key_path_results.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] 193 - for i in 0..key_path_results.len() { [INFO] [stdout] 193 + for in &key_path_results { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/day25.rs:119:19 [INFO] [stdout] | [INFO] [stdout] 119 | pub fn _solution2(input: &String) -> usize { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `shortest_paths` [INFO] [stdout] --> src/day21.rs:194:46 [INFO] [stdout] | [INFO] [stdout] 194 | ... for j in 0..shortest_paths.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] 194 - for j in 0..shortest_paths.len() { [INFO] [stdout] 194 + for in &shortest_paths { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `day2::Report` is more private than the item `day2::count_reports` [INFO] [stdout] --> src/day2.rs:300:1 [INFO] [stdout] | [INFO] [stdout] 300 | pub fn count_reports bool>(file_path: PathBuf, filter: F) -> Result> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function `day2::count_reports` is reachable at visibility `pub` [INFO] [stdout] | [INFO] [stdout] note: but type `day2::Report` is only usable at visibility `pub(self)` [INFO] [stdout] --> src/day2.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | struct Report { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] = note: `#[warn(private_bounds)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:230:81 [INFO] [stdout] | [INFO] [stdout] 230 | let mut shortest_paths = shortest_paths(&self.keypad, &pos, &k); [INFO] [stdout] | ^^ help: change this to: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `shortest_paths` [INFO] [stdout] --> src/day21.rs:231:30 [INFO] [stdout] | [INFO] [stdout] 231 | for i in 0..shortest_paths.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] 231 - for i in 0..shortest_paths.len() { [INFO] [stdout] 231 + for in &mut shortest_paths { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:248:36 [INFO] [stdout] | [INFO] [stdout] 248 | let src_bests = best_paths.get(&src_key).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `src_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:250:36 [INFO] [stdout] | [INFO] [stdout] 250 | if best_paths.contains_key(&key) { [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:251:49 [INFO] [stdout] | [INFO] [stdout] 251 | let existing_bests = best_paths.get(&key).unwrap().clone(); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `LocError` is never used [INFO] [stdout] --> src/day1.rs:14:6 [INFO] [stdout] | [INFO] [stdout] 14 | enum LocError { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from` is never used [INFO] [stdout] --> src/day4.rs:83:8 [INFO] [stdout] | [INFO] [stdout] 81 | impl Query { [INFO] [stdout] | ---------- associated function in this implementation [INFO] [stdout] 82 | [INFO] [stdout] 83 | fn from(coord: &Coord, value: char) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `current_bests` [INFO] [stdout] --> src/day21.rs:254:26 [INFO] [stdout] | [INFO] [stdout] 254 | for i in 0..current_bests.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] 254 - for i in 0..current_bests.len() { [INFO] [stdout] 254 + for in &mut current_bests { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `take_obstacle` and `count_tiles` are never used [INFO] [stdout] --> src/day6.rs:178:8 [INFO] [stdout] | [INFO] [stdout] 107 | impl LabMap { [INFO] [stdout] | ----------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 178 | fn take_obstacle(&mut self, pos: Pos) -> Obstacle { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 256 | fn count_tiles(&self, filter: Box bool>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `num_rows` and `num_cols` are never read [INFO] [stdout] --> src/day8.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 13 | struct CityMap { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 16 | num_rows: isize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 17 | num_cols: isize, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `step`, `build_children`, and `count_leaf_nodes` are never used [INFO] [stdout] --> src/day11.rs:132:12 [INFO] [stdout] | [INFO] [stdout] 40 | impl StoneTree { [INFO] [stdout] | -------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 132 | pub fn step(&mut self) -> () { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 156 | pub fn build_children(&mut self) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 174 | pub fn count_leaf_nodes(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `plant_type` is never read [INFO] [stdout] --> src/day12.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 23 | pub struct Region { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] 24 | plant_type: PlantType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `src_deer` is never read [INFO] [stdout] --> src/day16.rs:159:5 [INFO] [stdout] | [INFO] [stdout] 157 | pub struct Move { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 158 | actions: Vec, [INFO] [stdout] 159 | src_deer: Deer, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Move` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `current_bests` [INFO] [stdout] --> src/day21.rs:262:26 [INFO] [stdout] | [INFO] [stdout] 262 | for i in 0..current_bests.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] 262 - for i in 0..current_bests.len() { [INFO] [stdout] 262 + for in &mut current_bests { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/day17.rs:49:20 [INFO] [stdout] | [INFO] [stdout] 49 | pub struct Ignored(isize); [INFO] [stdout] | ------- ^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this struct [INFO] [stdout] | [INFO] [stdout] = help: consider removing this field [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `chunkiest_solution` is never used [INFO] [stdout] --> src/day19.rs:55:4 [INFO] [stdout] | [INFO] [stdout] 55 | fn chunkiest_solution<'a>(towels: &'a FxHashSet, design: &'a str, mut max_len: usize) -> Option> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `width` and `height` are never read [INFO] [stdout] --> src/day20.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct Dimensions { [INFO] [stdout] | ---------- fields in this struct [INFO] [stdout] 12 | width: isize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 13 | height: isize, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `dim` is never read [INFO] [stdout] --> src/day20.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 25 | pub struct Track { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] ... [INFO] [stdout] 29 | dim: Dimensions, [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `current_bests` [INFO] [stdout] --> src/day21.rs:273:22 [INFO] [stdout] | [INFO] [stdout] 273 | for i in 0..current_bests.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] 273 - for i in 0..current_bests.len() { [INFO] [stdout] 273 + for in &mut current_bests { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:281:21 [INFO] [stdout] | [INFO] [stdout] 281 | _best_paths(&keypad, &key, &dest_key, best_paths); [INFO] [stdout] | ^^^^^^^ help: change this to: `keypad` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:281:30 [INFO] [stdout] | [INFO] [stdout] 281 | _best_paths(&keypad, &key, &dest_key, best_paths); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:281:36 [INFO] [stdout] | [INFO] [stdout] 281 | _best_paths(&keypad, &key, &dest_key, best_paths); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/common.rs:7:13 [INFO] [stdout] | [INFO] [stdout] 7 | pb.push(&rel_path); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `rel_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/common.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | pb.push(&rel_path); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `rel_path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:289:17 [INFO] [stdout] | [INFO] [stdout] 289 | _best_paths(&keypad, &src_key, &dest_key, &mut best_paths); [INFO] [stdout] | ^^^^^^^ help: change this to: `keypad` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:289:26 [INFO] [stdout] | [INFO] [stdout] 289 | _best_paths(&keypad, &src_key, &dest_key, &mut best_paths); [INFO] [stdout] | ^^^^^^^^ help: change this to: `src_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:289:36 [INFO] [stdout] | [INFO] [stdout] 289 | _best_paths(&keypad, &src_key, &dest_key, &mut best_paths); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day21.rs:292:8 [INFO] [stdout] | [INFO] [stdout] 292 | if best_paths.get(&dest_key).unwrap()[0].len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `best_paths.get(&dest_key).unwrap()[0].is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:292:23 [INFO] [stdout] | [INFO] [stdout] 292 | if best_paths.get(&dest_key).unwrap()[0].len() == 0 { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:293:31 [INFO] [stdout] | [INFO] [stdout] 293 | return best_paths.get(&dest_key).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:295:29 [INFO] [stdout] | [INFO] [stdout] 295 | for p in best_paths.get(&dest_key).unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:310:29 [INFO] [stdout] | [INFO] [stdout] 310 | for p in best_paths.get(&dest_key).unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:332:25 [INFO] [stdout] | [INFO] [stdout] 332 | pub fn parse_keys(code: &String) -> 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] 332 - pub fn parse_keys(code: &String) -> Vec { [INFO] [stdout] 332 + pub fn parse_keys(code: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:365:43 [INFO] [stdout] | [INFO] [stdout] 365 | pub fn numeric_complexity_component(code: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 365 - pub fn numeric_complexity_component(code: &Vec) -> isize { [INFO] [stdout] 365 + pub fn numeric_complexity_component(code: &[Key]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `code` [INFO] [stdout] --> src/day21.rs:368:14 [INFO] [stdout] | [INFO] [stdout] 368 | for i in 0..3 { [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] 368 - for i in 0..3 { [INFO] [stdout] 368 + for in code.iter().take(3) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:388:24 [INFO] [stdout] | [INFO] [stdout] 388 | pub fn render_one(ops: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 388 - pub fn render_one(ops: &Vec) -> String { [INFO] [stdout] 388 + pub fn render_one(ops: &[ArmOp]) -> String { [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/day21.rs:402:24 [INFO] [stdout] | [INFO] [stdout] 402 | pub fn render_all(ops: &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] 402 - pub fn render_all(ops: &Vec>>) { [INFO] [stdout] 402 + pub fn render_all(ops: &[Vec>]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day2.rs:42:24 [INFO] [stdout] | [INFO] [stdout] 42 | if !(*level > prev_level) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*level <= prev_level)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day2.rs:47:24 [INFO] [stdout] | [INFO] [stdout] 47 | if !(*level < prev_level) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*level >= prev_level)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day2.rs:23:25 [INFO] [stdout] | [INFO] [stdout] 23 | fn get_ordering(levels: &Vec) -> LevelOrdering { [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] 23 - fn get_ordering(levels: &Vec) -> LevelOrdering { [INFO] [stdout] 23 + fn get_ordering(levels: &[u64]) -> LevelOrdering { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:409:36 [INFO] [stdout] | [INFO] [stdout] 409 | render_one(&first), [INFO] [stdout] | ^^^^^^ help: change this to: `first` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:410:36 [INFO] [stdout] | [INFO] [stdout] 410 | render_one(&second), [INFO] [stdout] | ^^^^^^^ help: change this to: `second` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:411:36 [INFO] [stdout] | [INFO] [stdout] 411 | render_one(&third), [INFO] [stdout] | ^^^^^^ help: change this to: `third` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:412:36 [INFO] [stdout] | [INFO] [stdout] 412 | render_one(&fourth), [INFO] [stdout] | ^^^^^^^ help: change this to: `fourth` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day2.rs:59:26 [INFO] [stdout] | [INFO] [stdout] 59 | fn gapping_valid(levels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn gapping_valid(levels: &Vec) -> bool { [INFO] [stdout] 59 + fn gapping_valid(levels: &[u64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:421:51 [INFO] [stdout] | [INFO] [stdout] 421 | let key_solutions = controller.solve_root_seq(&code); [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `key_solutions` [INFO] [stdout] --> src/day21.rs:423:14 [INFO] [stdout] | [INFO] [stdout] 423 | for i in 0..key_solutions.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] 423 - for i in 0..key_solutions.len() { [INFO] [stdout] 423 + for in &key_solutions { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/day2.rs:68:16 [INFO] [stdout] | [INFO] [stdout] 68 | if abs_diff > 3 || abs_diff < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=3).contains(&abs_diff)` [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: the loop variable `j` is only used to index `key_solutions` [INFO] [stdout] --> src/day21.rs:425:18 [INFO] [stdout] | [INFO] [stdout] 425 | for j in 0..key_solutions[i].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] 425 - for j in 0..key_solutions[i].len() { [INFO] [stdout] 425 + for in key_solutions.iter().take(key_solutions[i].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:435:64 [INFO] [stdout] | [INFO] [stdout] 435 | pub fn compute_complexity(controller: &RobotController, codes: &Vec>) -> isize { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 435 - pub fn compute_complexity(controller: &RobotController, codes: &Vec>) -> isize { [INFO] [stdout] 435 + pub fn compute_complexity(controller: &RobotController, codes: &[Vec]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:438:53 [INFO] [stdout] | [INFO] [stdout] 438 | let shortest_seq_len = compute_shortest_seq(&controller, &code); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `controller` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:438:66 [INFO] [stdout] | [INFO] [stdout] 438 | let shortest_seq_len = compute_shortest_seq(&controller, &code); [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:439:52 [INFO] [stdout] | [INFO] [stdout] 439 | let numeric = numeric_complexity_component(&code); [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day2.rs:118:13 [INFO] [stdout] | [INFO] [stdout] 118 | write!(f, "SRC NODE: {}\n", src_node_identifier)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 118 - write!(f, "SRC NODE: {}\n", src_node_identifier)?; [INFO] [stdout] 118 + writeln!(f, "SRC NODE: {}", src_node_identifier)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:458:42 [INFO] [stdout] | [INFO] [stdout] 458 | compute_complexity(&dir_controller2, &codes) [INFO] [stdout] | ^^^^^^ help: change this to: `codes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day2.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | / write!( [INFO] [stdout] 122 | | f, [INFO] [stdout] 123 | | "\tEDGE:\tto:{}\tkind:{}\tcost:{}\n", [INFO] [stdout] 124 | | edge.dest_node.borrow().value.unwrap(), [INFO] [stdout] 125 | | edge.kind, [INFO] [stdout] 126 | | edge.cost, [INFO] [stdout] 127 | | )?; [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 121 ~ writeln!( [INFO] [stdout] 122 | f, [INFO] [stdout] 123 ~ "\tEDGE:\tto:{}\tkind:{}\tcost:{}", [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/day21.rs:474:36 [INFO] [stdout] | [INFO] [stdout] 474 | pub fn find_min_presses(contender: &Vec, depth: isize, score_cache: &mut FxHashMap) -> isize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 474 ~ pub fn find_min_presses(contender: &[ArmOp], depth: isize, score_cache: &mut FxHashMap) -> isize { [INFO] [stdout] 475 | let controller = RobotController { [INFO] [stdout] ... [INFO] [stdout] 478 | }; [INFO] [stdout] 479 ~ let key = ContenderKey(contender.to_owned(), depth); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:488:37 [INFO] [stdout] | [INFO] [stdout] 488 | let keys = contender.iter().map(|op| op_to_key(op)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `op_to_key` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/day2.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 146 | / let graph = LevelsGraph { [INFO] [stdout] 147 | | nodes: nodes, [INFO] [stdout] 148 | | root: root.clone(), [INFO] [stdout] 149 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 150 | graph [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] 146 ~ [INFO] [stdout] 147 ~ LevelsGraph { [INFO] [stdout] 148 + nodes: nodes, [INFO] [stdout] 149 + root: root.clone(), [INFO] [stdout] 150 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/day2.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | all_paths.sort_by(|a, b| b.len().cmp(&a.len())); [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] 156 - all_paths.sort_by(|a, b| b.len().cmp(&a.len())); [INFO] [stdout] 156 + all_paths.sort_by_key(|b| std::cmp::Reverse(b.len())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:505:31 [INFO] [stdout] | [INFO] [stdout] 505 | fn solution_for_robots(codes: &Vec>, directional_robots: isize) -> isize { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 505 - fn solution_for_robots(codes: &Vec>, directional_robots: isize) -> isize { [INFO] [stdout] 505 + fn solution_for_robots(codes: &[Vec], directional_robots: isize) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day2.rs:158:9 [INFO] [stdout] | [INFO] [stdout] 158 | / if all_paths[0].len() > self.nodes.len() - 2 { [INFO] [stdout] 159 | | true [INFO] [stdout] 160 | | } else { [INFO] [stdout] 161 | | false [INFO] [stdout] 162 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `all_paths[0].len() > self.nodes.len() - 2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `codes` [INFO] [stdout] --> src/day21.rs:512:14 [INFO] [stdout] | [INFO] [stdout] 512 | for i in 0..codes.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] 512 - for i in 0..codes.len() { [INFO] [stdout] 512 + for in &codes { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/day2.rs:170:13 [INFO] [stdout] | [INFO] [stdout] 170 | / let mut result = Vec::new(); [INFO] [stdout] 171 | | result.push(Vec::from([node.clone()])); [INFO] [stdout] | |___________________________________________________^ help: consider using the `vec![]` macro: `let result = 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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:535:25 [INFO] [stdout] | [INFO] [stdout] 535 | solution_for_robots(&codes, 25) [INFO] [stdout] | ^^^^^^ help: change this to: `codes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | secret = secret ^ a; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | secret = secret ^ b; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | secret = secret ^ c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:36:9 [INFO] [stdout] | [INFO] [stdout] 36 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | secret = secret ^ a; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | secret = secret ^ b; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | secret = secret ^ c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:60:9 [INFO] [stdout] | [INFO] [stdout] 60 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day22.rs:67:35 [INFO] [stdout] | [INFO] [stdout] 67 | pub fn secrets_to_prices(secrets: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 67 - pub fn secrets_to_prices(secrets: &Vec) -> Vec { [INFO] [stdout] 67 + pub fn secrets_to_prices(secrets: &[isize]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day22.rs:71:28 [INFO] [stdout] | [INFO] [stdout] 71 | pub fn price_diffs(prices: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - pub fn price_diffs(prices: &Vec) -> Vec { [INFO] [stdout] 71 + pub fn price_diffs(prices: &[isize]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/day22.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | / let mut result = vec![]; [INFO] [stdout] 73 | | result.reserve(prices.len()); [INFO] [stdout] | |_________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut result = Vec::with_capacity(prices.len());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] = note: `#[warn(clippy::reserve_after_initialization)]` 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/day22.rs:82:26 [INFO] [stdout] | [INFO] [stdout] 82 | pub fn _solution1(input: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 82 - pub fn _solution1(input: &Vec) -> isize { [INFO] [stdout] 82 + pub fn _solution1(input: &[isize]) -> isize { [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/day22.rs:100:33 [INFO] [stdout] | [INFO] [stdout] 100 | pub fn _solution2(init_secrets: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - pub fn _solution2(init_secrets: &Vec) -> isize { [INFO] [stdout] 100 + pub fn _solution2(init_secrets: &[isize]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(isize, isize, isize, isize)` which implements the `Copy` trait [INFO] [stdout] --> src/day22.rs:112:37 [INFO] [stdout] | [INFO] [stdout] 112 | secret_totals.entry(k.clone()).or_insert(prices[i+1]); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(isize, isize, isize, isize)` which implements the `Copy` trait [INFO] [stdout] --> src/day22.rs:114:34 [INFO] [stdout] | [INFO] [stdout] 114 | totals.entry(k.clone()).or_insert(prices[i+1]); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day23.rs:11:28 [INFO] [stdout] | [INFO] [stdout] 11 | fn graph_from_input(input: &String) -> Graph { [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] 11 - fn graph_from_input(input: &String) -> Graph { [INFO] [stdout] 11 + fn graph_from_input(input: &str) -> Graph { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/day23.rs:19:28 [INFO] [stdout] | [INFO] [stdout] 19 | result.get_mut(&a.to_string()).unwrap().insert(b.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/day23.rs:25:28 [INFO] [stdout] | [INFO] [stdout] 25 | result.get_mut(&b.to_string()).unwrap().insert(a.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day3.rs:21:47 [INFO] [stdout] | [INFO] [stdout] 21 | for (_, [num1, num2]) in rx.captures_iter(&memory).map(|c| c.extract()) { [INFO] [stdout] | ^^^^^^^ help: change this to: `memory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ENABLED` contains a capitalized acronym [INFO] [stdout] --> src/day3.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | ENABLED, [INFO] [stdout] | ^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Enabled` [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: the loop variable `i` is only used to index `networks` [INFO] [stdout] --> src/day23.rs:72:18 [INFO] [stdout] | [INFO] [stdout] 72 | for i in 0..networks.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] 72 - for i in 0..networks.len() { [INFO] [stdout] 72 + for in &networks { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `DISABLED` contains a capitalized acronym [INFO] [stdout] --> src/day3.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | DISABLED, [INFO] [stdout] | ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Disabled` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day3.rs:50:37 [INFO] [stdout] | [INFO] [stdout] 50 | for capture in rx.captures_iter(&memory) { [INFO] [stdout] | ^^^^^^^ help: change this to: `memory` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day23.rs:98:12 [INFO] [stdout] | [INFO] [stdout] 98 | if networks.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `networks.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day23.rs:105:30 [INFO] [stdout] | [INFO] [stdout] 105 | let g = graph_from_input(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day23.rs:124:30 [INFO] [stdout] | [INFO] [stdout] 124 | let g = graph_from_input(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day4.rs:124:33 [INFO] [stdout] | [INFO] [stdout] 124 | fn find_all(&self, queries: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 124 - fn find_all(&self, queries: &Vec) -> bool { [INFO] [stdout] 124 + fn find_all(&self, queries: &[Query]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:138:28 [INFO] [stdout] | [INFO] [stdout] 138 | if self._in_bounds(&coord) { [INFO] [stdout] | ^^^^^^ help: change this to: `coord` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day24.rs:85:21 [INFO] [stdout] | [INFO] [stdout] 85 | pub fn parse(input: &String) -> Device { [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] 85 - pub fn parse(input: &String) -> Device { [INFO] [stdout] 85 + pub fn parse(input: &str) -> Device { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day24.rs:86:52 [INFO] [stdout] | [INFO] [stdout] 86 | let wire_lines = input.lines().take_while(|&l| l != ""); [INFO] [stdout] | ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day24.rs:87:58 [INFO] [stdout] | [INFO] [stdout] 87 | let gate_lines = input.lines().rev().take_while(|&l| l != ""); [INFO] [stdout] | ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day24.rs:133:11 [INFO] [stdout] | [INFO] [stdout] 133 | while new_outputs.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!new_outputs.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day24.rs:144:17 [INFO] [stdout] | [INFO] [stdout] 144 | / match (input1_o, input2_o) { [INFO] [stdout] 145 | | (Some(input1_o), Some(input2_o)) => { [INFO] [stdout] 146 | | let new_output = match gate.kind { [INFO] [stdout] 147 | | GateKind::OR => input1_o | input2_o, [INFO] [stdout] ... | [INFO] [stdout] 154 | | _ => (), [INFO] [stdout] 155 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 144 ~ if let (Some(input1_o), Some(input2_o)) = (input1_o, input2_o) { [INFO] [stdout] 145 + let new_output = match gate.kind { [INFO] [stdout] 146 + GateKind::OR => input1_o | input2_o, [INFO] [stdout] 147 + GateKind::XOR => input1_o ^ input2_o, [INFO] [stdout] 148 + GateKind::AND => input1_o & input2_o, [INFO] [stdout] 149 + }; [INFO] [stdout] 150 + device.output_vals.entry(gate.output.clone()).or_insert(new_output); [INFO] [stdout] 151 + next_new_outputs.insert(gate.output.clone()); [INFO] [stdout] 152 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:269:31 [INFO] [stdout] | [INFO] [stdout] 269 | count_forward(&puzzle, &base) [INFO] [stdout] | ^^^^^^^ help: change this to: `puzzle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:270:34 [INFO] [stdout] | [INFO] [stdout] 270 | + count_backward(&puzzle, &base) [INFO] [stdout] | ^^^^^^^ help: change this to: `puzzle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day4.rs:282:56 [INFO] [stdout] | [INFO] [stdout] 282 | fn find_any_query_group(puzzle: &Puzzle, query_groups: &Vec>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 282 - fn find_any_query_group(puzzle: &Puzzle, query_groups: &Vec>) -> bool { [INFO] [stdout] 282 + fn find_any_query_group(puzzle: &Puzzle, query_groups: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:283:53 [INFO] [stdout] | [INFO] [stdout] 283 | query_groups.iter().any(|group| puzzle.find_all(&group)) [INFO] [stdout] | ^^^^^^ help: change this to: `group` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day24.rs:172:28 [INFO] [stdout] | [INFO] [stdout] 172 | let mut device = parse(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:373:29 [INFO] [stdout] | [INFO] [stdout] 373 | if has_neg_diag(&puzzle, &base) && has_pos_diag(&puzzle, &base) { [INFO] [stdout] | ^^^^^^^ help: change this to: `puzzle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day4.rs:373:61 [INFO] [stdout] | [INFO] [stdout] 373 | if has_neg_diag(&puzzle, &base) && has_pos_diag(&puzzle, &base) { [INFO] [stdout] | ^^^^^^^ help: change this to: `puzzle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `OrderingRules` [INFO] [stdout] --> src/day5.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | / pub fn new() -> Self { [INFO] [stdout] 33 | | Self { [INFO] [stdout] 34 | | rules: Vec::new(), [INFO] [stdout] 35 | | rules_map: HashMap::new(), [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 30 + impl Default for OrderingRules { [INFO] [stdout] 31 + fn default() -> Self { [INFO] [stdout] 32 + Self::new() [INFO] [stdout] 33 + } [INFO] [stdout] 34 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/day5.rs:59:44 [INFO] [stdout] | [INFO] [stdout] 59 | pub fn get_comparator<'a>(&'a self) -> Box Ordering + 'a> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day5.rs:95:29 [INFO] [stdout] | [INFO] [stdout] 95 | let first = self.page_numbers[i].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.page_numbers[i]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day5.rs:96:30 [INFO] [stdout] | [INFO] [stdout] 96 | let second = self.page_numbers[j].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.page_numbers[j]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `PrintUpdates` [INFO] [stdout] --> src/day5.rs:119:5 [INFO] [stdout] | [INFO] [stdout] 119 | / pub fn new() -> Self { [INFO] [stdout] 120 | | Self { [INFO] [stdout] 121 | | updates: Vec::new(), [INFO] [stdout] 122 | | } [INFO] [stdout] 123 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 118 + impl Default for PrintUpdates { [INFO] [stdout] 119 + fn default() -> Self { [INFO] [stdout] 120 + Self::new() [INFO] [stdout] 121 + } [INFO] [stdout] 122 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day5.rs:160:30 [INFO] [stdout] | [INFO] [stdout] 160 | pub fn from(raw_details: &String) -> Self { [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] 160 - pub fn from(raw_details: &String) -> Self { [INFO] [stdout] 160 + pub fn from(raw_details: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day5.rs:166:16 [INFO] [stdout] | [INFO] [stdout] 166 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/day5.rs:189:34 [INFO] [stdout] | [INFO] [stdout] 189 | println!("{}", self.rules.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/day5.rs:190:36 [INFO] [stdout] | [INFO] [stdout] 190 | println!("{}", self.updates.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:200:48 [INFO] [stdout] | [INFO] [stdout] 200 | let instructions = PrintInstructions::from(&raw_details); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `raw_details` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:204:63 [INFO] [stdout] | [INFO] [stdout] 204 | let expected_update = instructions.get_ordered_update(&update); [INFO] [stdout] | ^^^^^^^ help: change this to: `update` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:206:34 [INFO] [stdout] | [INFO] [stdout] 206 | correct_updates.push(&update); [INFO] [stdout] | ^^^^^^^ help: change this to: `update` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:223:48 [INFO] [stdout] | [INFO] [stdout] 223 | let instructions = PrintInstructions::from(&raw_details); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `raw_details` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day5.rs:227:63 [INFO] [stdout] | [INFO] [stdout] 227 | let expected_update = instructions.get_ordered_update(&update); [INFO] [stdout] | ^^^^^^^ help: change this to: `update` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/day6.rs:207:9 [INFO] [stdout] | [INFO] [stdout] 207 | / match self.tiles.get(&pos).unwrap().occupant { [INFO] [stdout] 208 | | None => true, [INFO] [stdout] 209 | | _ => false, [INFO] [stdout] 210 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 207 - match self.tiles.get(&pos).unwrap().occupant { [INFO] [stdout] 208 - None => true, [INFO] [stdout] 209 - _ => false, [INFO] [stdout] 210 - } [INFO] [stdout] 207 + matches!(self.tiles.get(&pos).unwrap().occupant, None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/day6.rs:207:9 [INFO] [stdout] | [INFO] [stdout] 207 | / match self.tiles.get(&pos).unwrap().occupant { [INFO] [stdout] 208 | | None => true, [INFO] [stdout] 209 | | _ => false, [INFO] [stdout] 210 | | } [INFO] [stdout] | |_________^ help: try: `self.tiles.get(&pos).unwrap().occupant.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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day6.rs:213:24 [INFO] [stdout] | [INFO] [stdout] 213 | fn from_str(input: &String) -> Self { [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] 213 - fn from_str(input: &String) -> Self { [INFO] [stdout] 213 + fn from_str(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/day6.rs:221:51 [INFO] [stdout] | [INFO] [stdout] 221 | for (col_idx, byte) in row.as_bytes().into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/day6.rs:225:23 [INFO] [stdout] | [INFO] [stdout] 225 | match char::try_from(*byte).unwrap() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `char` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 225 - match char::try_from(*byte).unwrap() { [INFO] [stdout] 225 + match char::from(*byte) { [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/day24.rs:214:47 [INFO] [stdout] | [INFO] [stdout] 214 | fn rand_test(device: &Device, gate_overrides: &Vec, iterations: isize) -> isize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 214 ~ fn rand_test(device: &Device, gate_overrides: &[Gate], iterations: isize) -> isize { [INFO] [stdout] 215 | let mut fail_count = 0; [INFO] [stdout] ... [INFO] [stdout] 219 | let y = rng.gen_range(0..=1<<44); [INFO] [stdout] 220 ~ let mut d = Device::from_sum(gate_overrides.to_owned(), x, y); [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/day24.rs:280:49 [INFO] [stdout] | [INFO] [stdout] 280 | fn get_potential_swaps(device: &Device, shifts: &Vec, tainted_inputs: &Vec) -> Vec<(Gate, Gate)> { [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] 280 - fn get_potential_swaps(device: &Device, shifts: &Vec, tainted_inputs: &Vec) -> Vec<(Gate, Gate)> { [INFO] [stdout] 280 + fn get_potential_swaps(device: &Device, shifts: &[isize], tainted_inputs: &Vec) -> Vec<(Gate, Gate)> { [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/day24.rs:280:78 [INFO] [stdout] | [INFO] [stdout] 280 | fn get_potential_swaps(device: &Device, shifts: &Vec, tainted_inputs: &Vec) -> Vec<(Gate, Gate)> { [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] 280 ~ fn get_potential_swaps(device: &Device, shifts: &Vec, tainted_inputs: &[String]) -> Vec<(Gate, Gate)> { [INFO] [stdout] 281 | let mut total_fails = 0; [INFO] [stdout] ... [INFO] [stdout] 340 | [INFO] [stdout] 341 ~ let mut tainted = tainted_inputs.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day24.rs:343:11 [INFO] [stdout] | [INFO] [stdout] 343 | while tainted.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!tainted.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 `if` statement can be collapsed [INFO] [stdout] --> src/day24.rs:347:17 [INFO] [stdout] | [INFO] [stdout] 347 | / if g.input1 == *tainted_input || g.input2 == *tainted_input { [INFO] [stdout] 348 | | if maybe_corrupt.insert(g.clone()) { [INFO] [stdout] 349 | | new_tainted.push(g.output.clone()); [INFO] [stdout] 350 | | } [INFO] [stdout] 351 | | } [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] 347 ~ if (g.input1 == *tainted_input || g.input2 == *tainted_input) { [INFO] [stdout] 348 ~ && maybe_corrupt.insert(g.clone()) { [INFO] [stdout] 349 | new_tainted.push(g.output.clone()); [INFO] [stdout] 350 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day24.rs:352:17 [INFO] [stdout] | [INFO] [stdout] 352 | / if g.output == *tainted_input { [INFO] [stdout] 353 | | if maybe_corrupt.insert(g.clone()) { [INFO] [stdout] 354 | | if !g.input1.starts_with("x") && !g.input1.starts_with("y") { [INFO] [stdout] 355 | | new_tainted.push(g.input1.clone()); [INFO] [stdout] ... | [INFO] [stdout] 361 | | } [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] 352 ~ if g.output == *tainted_input [INFO] [stdout] 353 ~ && maybe_corrupt.insert(g.clone()) { [INFO] [stdout] 354 | if !g.input1.starts_with("x") && !g.input1.starts_with("y") { [INFO] [stdout] ... [INFO] [stdout] 359 | } [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `potential_swaps` [INFO] [stdout] --> src/day24.rs:383:14 [INFO] [stdout] | [INFO] [stdout] 383 | for i in 0..potential_swaps.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] 383 - for i in 0..potential_swaps.len() { [INFO] [stdout] 383 + for in &potential_swaps { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day24.rs:456:24 [INFO] [stdout] | [INFO] [stdout] 456 | let device = parse(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day24.rs:511:12 [INFO] [stdout] | [INFO] [stdout] 511 | if ps.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `ps.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/day25.rs:24:41 [INFO] [stdout] | [INFO] [stdout] 24 | fn combine_heights(line: &str, heights: &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] 24 - fn combine_heights(line: &str, heights: &mut Vec) { [INFO] [stdout] 24 + fn combine_heights(line: &str, heights: &mut [isize]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day25.rs:34:17 [INFO] [stdout] | [INFO] [stdout] 34 | fn parse(input: &String) -> (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] help: change this to [INFO] [stdout] | [INFO] [stdout] 34 - fn parse(input: &String) -> (Vec, Vec) { [INFO] [stdout] 34 + fn parse(input: &str) -> (Vec, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day25.rs:45:20 [INFO] [stdout] | [INFO] [stdout] 45 | if l == "" { [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day25.rs:54:20 [INFO] [stdout] | [INFO] [stdout] 54 | if l == "" { [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day25.rs:92:31 [INFO] [stdout] | [INFO] [stdout] 92 | let (keys, locks) = parse(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day25.rs:119:26 [INFO] [stdout] | [INFO] [stdout] 119 | pub fn _solution2(input: &String) -> 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] 119 - pub fn _solution2(input: &String) -> usize { [INFO] [stdout] 119 + pub fn _solution2(input: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day16.rs:547:35 [INFO] [stdout] | [INFO] [stdout] 547 | let target_deer = vec![ [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 548 | | mv.dest_deer.clone(), [INFO] [stdout] 549 | | mv.dest_deer.turn_left(), [INFO] [stdout] 550 | | mv.dest_deer.turn_left().turn_left(), [INFO] [stdout] 551 | | mv.dest_deer.turn_right(), [INFO] [stdout] 552 | | ]; [INFO] [stdout] | |_________________^ [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] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 547 ~ let target_deer = [mv.dest_deer.clone(), [INFO] [stdout] 548 + mv.dest_deer.turn_left(), [INFO] [stdout] 549 + mv.dest_deer.turn_left().turn_left(), [INFO] [stdout] 550 ~ mv.dest_deer.turn_right()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day18.rs:71:18 [INFO] [stdout] | [INFO] [stdout] 71 | let deltas = vec![ [INFO] [stdout] | __________________^ [INFO] [stdout] 72 | | (0, 1), [INFO] [stdout] 73 | | (0, -1), [INFO] [stdout] 74 | | (1, 0), [INFO] [stdout] 75 | | (-1, 0), [INFO] [stdout] 76 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 71 ~ let deltas = [(0, 1), [INFO] [stdout] 72 + (0, -1), [INFO] [stdout] 73 + (1, 0), [INFO] [stdout] 74 ~ (-1, 0)]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day6.rs:245:47 [INFO] [stdout] | [INFO] [stdout] 245 | fn sync_state_history(&mut self, history: &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] 245 - fn sync_state_history(&mut self, history: &Vec) { [INFO] [stdout] 245 + fn sync_state_history(&mut self, history: &[GuardState]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day24.rs:459:23 [INFO] [stdout] | [INFO] [stdout] 459 | let test_groups = vec![ [INFO] [stdout] | _______________________^ [INFO] [stdout] 460 | | ( [INFO] [stdout] 461 | | vec![6, 7, 8, 9], [INFO] [stdout] 462 | | vec![ [INFO] [stdout] ... | [INFO] [stdout] 500 | | ), [INFO] [stdout] 501 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 459 ~ let test_groups = [( [INFO] [stdout] 460 + vec![6, 7, 8, 9], [INFO] [stdout] 461 + vec![ [INFO] [stdout] 462 + String::from("x07"), String::from("y07"), [INFO] [stdout] 463 + String::from("x08"), String::from("y08"), [INFO] [stdout] 464 + String::from("x09"), String::from("y09"), [INFO] [stdout] 465 + [INFO] [stdout] 466 + String::from("z09") [INFO] [stdout] 467 + ] , [INFO] [stdout] 468 + ), [INFO] [stdout] 469 + ( [INFO] [stdout] 470 + vec![13, 14, 15, 16, 17], [INFO] [stdout] 471 + vec![ [INFO] [stdout] 472 + String::from("x14"), String::from("y14"), [INFO] [stdout] 473 + String::from("x15"), String::from("y15"), [INFO] [stdout] 474 + String::from("x16"), String::from("y16"), [INFO] [stdout] 475 + [INFO] [stdout] 476 + String::from("z15"), String::from("z14"), [INFO] [stdout] 477 + ] , [INFO] [stdout] 478 + ), [INFO] [stdout] 479 + ( [INFO] [stdout] 480 + vec![19, 20, 21, 22, 23, 24], [INFO] [stdout] 481 + vec![ [INFO] [stdout] 482 + String::from("x21"), String::from("y21"), [INFO] [stdout] 483 + String::from("x22"), String::from("y22"), [INFO] [stdout] 484 + [INFO] [stdout] 485 + String::from("z22"), String::from("z23"), [INFO] [stdout] 486 + ] , [INFO] [stdout] 487 + ), [INFO] [stdout] 488 + ( [INFO] [stdout] 489 + vec![28, 29, 30], [INFO] [stdout] 490 + vec![ [INFO] [stdout] 491 + String::from("x30"), String::from("y30"), [INFO] [stdout] 492 + String::from("x29"), String::from("y29"), [INFO] [stdout] 493 + String::from("x28"), String::from("y28"), [INFO] [stdout] 494 + [INFO] [stdout] 495 + String::from("z29"), String::from("z30"), [INFO] [stdout] 496 + String::from("z28") [INFO] [stdout] 497 + [INFO] [stdout] 498 + ], [INFO] [stdout] 499 ~ )]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/day6.rs:287:13 [INFO] [stdout] | [INFO] [stdout] 287 | writeln!(f, "").expect("error writing"); [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#writeln_empty_string [INFO] [stdout] = note: `#[warn(clippy::writeln_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day24.rs:560:37 [INFO] [stdout] | [INFO] [stdout] 560 | let mut v = vec![ [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 561 | | swapped_gates[*s1_g1_idx].output.clone(), [INFO] [stdout] 562 | | swapped_gates[*s1_g2_idx].output.clone(), [INFO] [stdout] 563 | | swapped_gates[*s2_g1_idx].output.clone(), [INFO] [stdout] ... | [INFO] [stdout] 568 | | swapped_gates[*s4_g2_idx].output.clone(), [INFO] [stdout] 569 | | ]; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 560 ~ let mut v = [swapped_gates[*s1_g1_idx].output.clone(), [INFO] [stdout] 561 + swapped_gates[*s1_g2_idx].output.clone(), [INFO] [stdout] 562 + swapped_gates[*s2_g1_idx].output.clone(), [INFO] [stdout] 563 + swapped_gates[*s2_g2_idx].output.clone(), [INFO] [stdout] 564 + swapped_gates[*s3_g1_idx].output.clone(), [INFO] [stdout] 565 + swapped_gates[*s3_g2_idx].output.clone(), [INFO] [stdout] 566 + swapped_gates[*s4_g1_idx].output.clone(), [INFO] [stdout] 567 ~ swapped_gates[*s4_g2_idx].output.clone()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/day5.rs:51:17 [INFO] [stdout] | [INFO] [stdout] 51 | pub fn iter(&self) -> Iter> { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 51 | pub fn iter(&self) -> Iter<'_, Rc> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/day5.rs:134:17 [INFO] [stdout] | [INFO] [stdout] 134 | pub fn iter(&self) -> Iter { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 134 | pub fn iter(&self) -> Iter<'_, Update> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day6.rs:323:36 [INFO] [stdout] | [INFO] [stdout] 323 | let mut map = LabMap::from_str(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<(usize, usize)>` which implements the `Copy` trait [INFO] [stdout] --> src/day6.rs:325:25 [INFO] [stdout] | [INFO] [stdout] 325 | let guard_pos = map.guard_pos.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `map.guard_pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day6.rs:424:36 [INFO] [stdout] | [INFO] [stdout] 424 | let mut map = LabMap::from_str(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option<(usize, usize)>` which implements the `Copy` trait [INFO] [stdout] --> src/day6.rs:425:21 [INFO] [stdout] | [INFO] [stdout] 425 | let guard_pos = map.guard_pos.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `map.guard_pos` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day6.rs:433:11 [INFO] [stdout] | [INFO] [stdout] 433 | while rest_of_walk.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!rest_of_walk.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day6.rs:440:9 [INFO] [stdout] | [INFO] [stdout] 440 | / match resume_walk(&mut map, &history) { [INFO] [stdout] 441 | | None => num_cycles += 1, [INFO] [stdout] 442 | | _ => (), // completed, throw away the walk [INFO] [stdout] 443 | | } [INFO] [stdout] | |_________^ help: try: `if let None = resume_walk(&mut map, &history) { num_cycles += 1 }` [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day7.rs:27:23 [INFO] [stdout] | [INFO] [stdout] 27 | fn parse_input(input: &String) -> 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] 27 - fn parse_input(input: &String) -> Vec { [INFO] [stdout] 27 + fn parse_input(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day7.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | if remaining.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `remaining.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day7.rs:79:9 [INFO] [stdout] | [INFO] [stdout] 79 | / match _find_op_sequence(eq_data, valid_ops, next_acc, remaining, ops) { [INFO] [stdout] 80 | | Some(result) => { return Some(result); }, [INFO] [stdout] 81 | | None => (), [INFO] [stdout] 82 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(result) = _find_op_sequence(eq_data, valid_ops, next_acc, remaining, ops) { return Some(result); }` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day7.rs:127:32 [INFO] [stdout] | [INFO] [stdout] 127 | let test_eqs = parse_input(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day7.rs:142:9 [INFO] [stdout] | [INFO] [stdout] 142 | / match find_op_sequence(&test_eq, &ops) { [INFO] [stdout] 143 | | Some(_op_seq) => { [INFO] [stdout] 144 | | //check_solution(&test_eq, &_op_seq); [INFO] [stdout] 145 | | result += test_eq.solution; [INFO] [stdout] 146 | | }, [INFO] [stdout] 147 | | _ => (), [INFO] [stdout] 148 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 142 ~ if let Some(_op_seq) = find_op_sequence(&test_eq, &ops) { [INFO] [stdout] 143 + //check_solution(&test_eq, &_op_seq); [INFO] [stdout] 144 + result += test_eq.solution; [INFO] [stdout] 145 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day7.rs:142:32 [INFO] [stdout] | [INFO] [stdout] 142 | match find_op_sequence(&test_eq, &ops) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `test_eq` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day7.rs:159:32 [INFO] [stdout] | [INFO] [stdout] 159 | let test_eqs = parse_input(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day7.rs:174:9 [INFO] [stdout] | [INFO] [stdout] 174 | / match find_op_sequence(&test_eq, &ops) { [INFO] [stdout] 175 | | Some(_op_seq) => { [INFO] [stdout] 176 | | //check_solution(&test_eq, &_op_seq); [INFO] [stdout] 177 | | result += test_eq.solution; [INFO] [stdout] 178 | | }, [INFO] [stdout] 179 | | _ => (), [INFO] [stdout] 180 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 174 ~ if let Some(_op_seq) = find_op_sequence(&test_eq, &ops) { [INFO] [stdout] 175 + //check_solution(&test_eq, &_op_seq); [INFO] [stdout] 176 + result += test_eq.solution; [INFO] [stdout] 177 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day7.rs:174:32 [INFO] [stdout] | [INFO] [stdout] 174 | match find_op_sequence(&test_eq, &ops) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `test_eq` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day8.rs:30:24 [INFO] [stdout] | [INFO] [stdout] 30 | pub fn from(input: &String) -> Self { [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] 30 - pub fn from(input: &String) -> Self { [INFO] [stdout] 30 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needless call to `bytes` [INFO] [stdout] --> src/day8.rs:35:33 [INFO] [stdout] | [INFO] [stdout] 35 | let num_cols = to_isize(input.lines().next().unwrap().bytes().len()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `input.lines().next().unwrap().len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes [INFO] [stdout] = note: `#[warn(clippy::needless_as_bytes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/day8.rs:40:25 [INFO] [stdout] | [INFO] [stdout] 40 | let c = char::try_from(c).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u8` to `char` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 40 - let c = char::try_from(c).unwrap(); [INFO] [stdout] 40 + let c = char::from(c); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/day8.rs:44:64 [INFO] [stdout] | [INFO] [stdout] 44 | let c_coords = antenna_coords.entry(c).or_insert(Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day8.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | / match city_map.coord_pairs_for_antenna(antenna) { [INFO] [stdout] 171 | | Some(coord_pairs) => { [INFO] [stdout] 172 | | for coord_pair in coord_pairs { [INFO] [stdout] 173 | | let antinodes = city_map.antinode_locations_1(coord_pair); [INFO] [stdout] ... | [INFO] [stdout] 183 | | None => (), [INFO] [stdout] 184 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 170 ~ if let Some(coord_pairs) = city_map.coord_pairs_for_antenna(antenna) { [INFO] [stdout] 171 + for coord_pair in coord_pairs { [INFO] [stdout] 172 + let antinodes = city_map.antinode_locations_1(coord_pair); [INFO] [stdout] 173 + if city_map.contains(antinodes.0) { [INFO] [stdout] 174 + antinode_locations.insert(antinodes.0); [INFO] [stdout] 175 + } [INFO] [stdout] 176 + if city_map.contains(antinodes.1) { [INFO] [stdout] 177 + antinode_locations.insert(antinodes.1); [INFO] [stdout] 178 + } [INFO] [stdout] 179 + } [INFO] [stdout] 180 + [INFO] [stdout] 181 + } [INFO] [stdout] | [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/day8.rs:199:9 [INFO] [stdout] | [INFO] [stdout] 199 | / match city_map.coord_pairs_for_antenna(antenna) { [INFO] [stdout] 200 | | Some(coord_pairs) => { [INFO] [stdout] 201 | | for coord_pair in coord_pairs { [INFO] [stdout] 202 | | let antinodes = city_map.antinode_locations_2(coord_pair); [INFO] [stdout] ... | [INFO] [stdout] 211 | | None => (), [INFO] [stdout] 212 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 199 ~ if let Some(coord_pairs) = city_map.coord_pairs_for_antenna(antenna) { [INFO] [stdout] 200 + for coord_pair in coord_pairs { [INFO] [stdout] 201 + let antinodes = city_map.antinode_locations_2(coord_pair); [INFO] [stdout] 202 + for antinode_pos in antinodes { [INFO] [stdout] 203 + if city_map.contains(antinode_pos) { [INFO] [stdout] 204 + antinode_locations.insert(antinode_pos); [INFO] [stdout] 205 + } [INFO] [stdout] 206 + } [INFO] [stdout] 207 + } [INFO] [stdout] 208 + [INFO] [stdout] 209 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day9.rs:27:20 [INFO] [stdout] | [INFO] [stdout] 27 | fn from(input: &String) -> Self { [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] 27 - fn from(input: &String) -> Self { [INFO] [stdout] 27 + fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day9.rs:65:40 [INFO] [stdout] | [INFO] [stdout] 65 | self.blocks.push(Rc::clone(&block)) [INFO] [stdout] | ^^^^^^ help: change this to: `block` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day9.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | return None [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 113 - return None [INFO] [stdout] 113 + None [INFO] [stdout] | [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/day9.rs:108:13 [INFO] [stdout] | [INFO] [stdout] 108 | / match *self.blocks[i] { [INFO] [stdout] 109 | | Block::Free => return Some(i), [INFO] [stdout] 110 | | _ => (), [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ help: try: `if let Block::Free = *self.blocks[i] { return Some(i) }` [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: unneeded `return` statement [INFO] [stdout] --> src/day9.rs:133:9 [INFO] [stdout] | [INFO] [stdout] 133 | return None [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 133 - return None [INFO] [stdout] 133 + None [INFO] [stdout] | [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/day9.rs:143:13 [INFO] [stdout] | [INFO] [stdout] 143 | / match *self.blocks[i] { [INFO] [stdout] 144 | | Block::File(_, _) => return Some(i), [INFO] [stdout] 145 | | _ => (), [INFO] [stdout] 146 | | } [INFO] [stdout] | |_____________^ help: try: `if let Block::File(_, _) = *self.blocks[i] { return Some(i) }` [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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day9.rs:170:32 [INFO] [stdout] | [INFO] [stdout] 170 | let current_file_idx = self.file_ptrs.get(&file_id).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.file_ptrs.get(&file_id).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day9.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | / match (self.find_first_free(0), self.find_last_data(self.blocks.len())) { [INFO] [stdout] 180 | | (Some(mut free_ptr), Some(mut data_ptr)) => { [INFO] [stdout] 181 | | while free_ptr < data_ptr { [INFO] [stdout] 182 | | self.swap_blocks(free_ptr, data_ptr); [INFO] [stdout] ... | [INFO] [stdout] 192 | | _ => (), [INFO] [stdout] 193 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 179 ~ if let (Some(mut free_ptr), Some(mut data_ptr)) = (self.find_first_free(0), self.find_last_data(self.blocks.len())) { [INFO] [stdout] 180 + while free_ptr < data_ptr { [INFO] [stdout] 181 + self.swap_blocks(free_ptr, data_ptr); [INFO] [stdout] 182 + match (self.find_first_free(free_ptr + 1), self.find_last_data(data_ptr)) { [INFO] [stdout] 183 + (Some(next_free), Some(next_data)) => { [INFO] [stdout] 184 + free_ptr = next_free; [INFO] [stdout] 185 + data_ptr = next_data; [INFO] [stdout] 186 + }, [INFO] [stdout] 187 + _ => return, [INFO] [stdout] 188 + } [INFO] [stdout] 189 + } [INFO] [stdout] 190 + } [INFO] [stdout] | [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/day9.rs:202:13 [INFO] [stdout] | [INFO] [stdout] 202 | / match free_at { [INFO] [stdout] 203 | | Some(free_at) => { [INFO] [stdout] 204 | | let file_id = self.files[i].id; [INFO] [stdout] 205 | | self.mv_file(file_id, free_at); [INFO] [stdout] 206 | | }, [INFO] [stdout] 207 | | None => (), [INFO] [stdout] 208 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 202 ~ if let Some(free_at) = free_at { [INFO] [stdout] 203 + let file_id = self.files[i].id; [INFO] [stdout] 204 + self.mv_file(file_id, free_at); [INFO] [stdout] 205 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day9.rs:285:34 [INFO] [stdout] | [INFO] [stdout] 285 | let disk_map = DiskMap::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day9.rs:297:34 [INFO] [stdout] | [INFO] [stdout] 297 | let disk_map = DiskMap::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day10.rs:26:24 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn from(input: &String) -> Self { [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] 26 - pub fn from(input: &String) -> Self { [INFO] [stdout] 26 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [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/day10.rs:87:13 [INFO] [stdout] | [INFO] [stdout] 87 | / match self.map.get(&neighbor_pos) { [INFO] [stdout] 88 | | Some(_) => result.push(neighbor_pos), [INFO] [stdout] 89 | | None => (), [INFO] [stdout] 90 | | } [INFO] [stdout] | |_____________^ help: try: `if let Some(_) = self.map.get(&neighbor_pos) { result.push(neighbor_pos) }` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:106:34 [INFO] [stdout] | [INFO] [stdout] 106 | let topo_map = TopoMap::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day10.rs:129:34 [INFO] [stdout] | [INFO] [stdout] 129 | let topo_map = TopoMap::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day11.rs:41:24 [INFO] [stdout] | [INFO] [stdout] 41 | pub fn from(input: &String) -> Self { [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] 41 - pub fn from(input: &String) -> Self { [INFO] [stdout] 41 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/day11.rs:53:90 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn _get_leaf_nodes<'a>(& self, t: &'a StoneTree, leaves: &mut Vec<&'a StoneTree>) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day11.rs:54:12 [INFO] [stdout] | [INFO] [stdout] 54 | if t.children.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `t.children.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day11.rs:55:25 [INFO] [stdout] | [INFO] [stdout] 55 | leaves.push(&t) [INFO] [stdout] | ^^ help: change this to: `t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day11.rs:67:30 [INFO] [stdout] | [INFO] [stdout] 67 | self._get_leaf_nodes(&self, &mut leaves); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day11.rs:75:15 [INFO] [stdout] | [INFO] [stdout] 75 | while depth_vals.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!depth_vals.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: unneeded unit return type [INFO] [stdout] --> src/day11.rs:132:27 [INFO] [stdout] | [INFO] [stdout] 132 | pub fn step(&mut self) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day11.rs:133:12 [INFO] [stdout] | [INFO] [stdout] 133 | if self.children.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.children.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 `.is_multiple_of()` [INFO] [stdout] --> src/day11.rs:145:19 [INFO] [stdout] | [INFO] [stdout] 145 | } else if count_digits(val) % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `count_digits(val).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/day11.rs:156:37 [INFO] [stdout] | [INFO] [stdout] 156 | pub fn build_children(&mut self) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [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/day11.rs:162:9 [INFO] [stdout] | [INFO] [stdout] 162 | / match child_vals.1 { [INFO] [stdout] 163 | | Some(v) => { [INFO] [stdout] 164 | | self.children.push(Self { [INFO] [stdout] 165 | | value: v, [INFO] [stdout] ... | [INFO] [stdout] 170 | | None => (), [INFO] [stdout] 171 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 162 ~ if let Some(v) = child_vals.1 { [INFO] [stdout] 163 + self.children.push(Self { [INFO] [stdout] 164 + value: v, [INFO] [stdout] 165 + children: Vec::new() [INFO] [stdout] 166 + }); [INFO] [stdout] 167 + [INFO] [stdout] 168 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day11.rs:175:12 [INFO] [stdout] | [INFO] [stdout] 175 | if self.children.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.children.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:77:66 [INFO] [stdout] | [INFO] [stdout] 77 | let (min_corner, max_corner) = self._get_min_max_corners(&plots); [INFO] [stdout] | ^^^^^^ help: change this to: `plots` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/day12.rs:173:12 [INFO] [stdout] | [INFO] [stdout] 173 | x: c.x + 0, [INFO] [stdout] | ^^^^^^^ help: consider reducing it to: `c.x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day12.rs:196:24 [INFO] [stdout] | [INFO] [stdout] 196 | pub fn from(input: &String) -> Self { [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] 196 - pub fn from(input: &String) -> Self { [INFO] [stdout] 196 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/day12.rs:234:21 [INFO] [stdout] | [INFO] [stdout] 234 | / if neighbor == plot { [INFO] [stdout] 235 | | result.push(neighbor_coord) [INFO] [stdout] 236 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 233 ~ Some(neighbor) [INFO] [stdout] 234 ~ if neighbor == plot => { [INFO] [stdout] 235 | result.push(neighbor_coord) [INFO] [stdout] 236 ~ }, [INFO] [stdout] | [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/day12.rs:232:13 [INFO] [stdout] | [INFO] [stdout] 232 | / match self.plots.get(&neighbor_coord) { [INFO] [stdout] 233 | | Some(neighbor) => { [INFO] [stdout] 234 | | if neighbor == plot { [INFO] [stdout] 235 | | result.push(neighbor_coord) [INFO] [stdout] ... | [INFO] [stdout] 238 | | None => (), [INFO] [stdout] 239 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 232 ~ if let Some(neighbor) = self.plots.get(&neighbor_coord) { [INFO] [stdout] 233 + if neighbor == plot { [INFO] [stdout] 234 + result.push(neighbor_coord) [INFO] [stdout] 235 + } [INFO] [stdout] 236 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day12.rs:249:15 [INFO] [stdout] | [INFO] [stdout] 249 | while to_examine.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_examine.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:296:31 [INFO] [stdout] | [INFO] [stdout] 296 | let garden = Garden::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day12.rs:310:31 [INFO] [stdout] | [INFO] [stdout] 310 | let garden = Garden::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day13.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | / if loc == self.conf.prize_location { [INFO] [stdout] 87 | | true [INFO] [stdout] 88 | | } else { [INFO] [stdout] 89 | | false [INFO] [stdout] 90 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `loc == self.conf.prize_location` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day13.rs:102:54 [INFO] [stdout] | [INFO] [stdout] 102 | let (_, [x_offset, y_offset]) = rx.captures_iter(&line).map(|c| c.extract()).next().unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day13.rs:112:48 [INFO] [stdout] | [INFO] [stdout] 112 | let (_, [x_loc, y_loc]) = rx.captures_iter(&line).map(|c| c.extract()).next().unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day13.rs:119:26 [INFO] [stdout] | [INFO] [stdout] 119 | pub fn parse_conf(input: &String) -> 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] 119 - pub fn parse_conf(input: &String) -> Vec { [INFO] [stdout] 119 + pub fn parse_conf(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_none()` [INFO] [stdout] --> src/day13.rs:135:16 [INFO] [stdout] | [INFO] [stdout] 135 | if let None = lines.next() { [INFO] [stdout] | -------^^^^--------------- help: try: `if lines.next().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: this `if` has identical blocks [INFO] [stdout] --> src/day13.rs:149:91 [INFO] [stdout] | [INFO] [stdout] 149 | if current.num_a_presses > max_press_count || current.num_b_presses > max_press_count { [INFO] [stdout] | ___________________________________________________________________________________________^ [INFO] [stdout] 150 | | true [INFO] [stdout] 151 | | } else if current.beyond_target() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day13.rs:151:39 [INFO] [stdout] | [INFO] [stdout] 151 | } else if current.beyond_target() { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 152 | | true [INFO] [stdout] 153 | | } else if current.cost() >= best.cost() { [INFO] [stdout] | |_____^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day13.rs:151:39 [INFO] [stdout] | [INFO] [stdout] 151 | } else if current.beyond_target() { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 152 | | true [INFO] [stdout] 153 | | } else if current.cost() >= best.cost() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day13.rs:153:45 [INFO] [stdout] | [INFO] [stdout] 153 | } else if current.cost() >= best.cost() { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 154 | | true [INFO] [stdout] 155 | | } else { [INFO] [stdout] | |_____^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/day13.rs:153:12 [INFO] [stdout] | [INFO] [stdout] 153 | } else if current.cost() >= best.cost() { [INFO] [stdout] | ____________^ [INFO] [stdout] 154 | | true [INFO] [stdout] 155 | | } else { [INFO] [stdout] 156 | | false [INFO] [stdout] 157 | | } [INFO] [stdout] | |_____^ help: you can reduce it to: `{ current.cost() >= best.cost() }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [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/day13.rs:338:9 [INFO] [stdout] | [INFO] [stdout] 338 | / match find_min_winning_cost(c, constants::MAX_PRESSES) { [INFO] [stdout] 339 | | Some(cost) => token_count += cost, [INFO] [stdout] 340 | | None => (), [INFO] [stdout] 341 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(cost) = find_min_winning_cost(c, constants::MAX_PRESSES) { token_count += cost }` [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: manually reimplementing `div_ceil` [INFO] [stdout] --> src/day13.rs:359:22 [INFO] [stdout] | [INFO] [stdout] 359 | let chunk_size = (confs.len() + 15) / 16; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `confs.len().div_ceil(16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` 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/day13.rs:366:17 [INFO] [stdout] | [INFO] [stdout] 366 | / match find_min_winning_cost(&c, max_steps) { [INFO] [stdout] 367 | | Some(cost) => token_count += cost, [INFO] [stdout] 368 | | None => (), [INFO] [stdout] 369 | | } [INFO] [stdout] | |_________________^ help: try: `if let Some(cost) = find_min_winning_cost(&c, max_steps) { token_count += cost }` [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: unneeded late initialization [INFO] [stdout] --> src/day14.rs:80:9 [INFO] [stdout] | [INFO] [stdout] 80 | let next_x; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `next_x` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 80 ~ [INFO] [stdout] 81 | let next_y; [INFO] [stdout] 82 | [INFO] [stdout] 83 ~ let next_x = if try_next_x >= 0 { [INFO] [stdout] 84 ~ ((robot.loc.x + robot.vel.x) % self.dimensions.x).abs() [INFO] [stdout] 85 | } else { [INFO] [stdout] 86 ~ self.dimensions.x - ((robot.loc.x + robot.vel.x) % self.dimensions.x).abs() [INFO] [stdout] 87 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/day14.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | let next_y; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `next_y` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 81 ~ [INFO] [stdout] 82 | [INFO] [stdout] ... [INFO] [stdout] 88 | [INFO] [stdout] 89 ~ let next_y = if try_next_y >= 0 { [INFO] [stdout] 90 ~ ((robot.loc.y + robot.vel.y) % self.dimensions.y).abs() [INFO] [stdout] 91 | } else { [INFO] [stdout] 92 ~ self.dimensions.y - ((robot.loc.y + robot.vel.y) % self.dimensions.y).abs() [INFO] [stdout] 93 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Quadrant; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/day14.rs:155:22 [INFO] [stdout] | [INFO] [stdout] 155 | for q in QUADRANTS.clone().into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `QUADRANTS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day14.rs:157:36 [INFO] [stdout] | [INFO] [stdout] 157 | if in_bounds(&loc, &bounds) { [INFO] [stdout] | ^^^^^^^ help: change this to: `bounds` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Quadrant; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/day14.rs:195:26 [INFO] [stdout] | [INFO] [stdout] 195 | for q in QUADRANTS.clone().into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `QUADRANTS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day14.rs:210:13 [INFO] [stdout] | [INFO] [stdout] 210 | 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: empty string literal in `println!` [INFO] [stdout] --> src/day14.rs:226:13 [INFO] [stdout] | [INFO] [stdout] 226 | 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] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day14.rs:253:27 [INFO] [stdout] | [INFO] [stdout] 253 | pub fn parse_input(input: &String) -> 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] 253 - pub fn parse_input(input: &String) -> Vec { [INFO] [stdout] 253 + pub fn parse_input(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day14.rs:259:67 [INFO] [stdout] | [INFO] [stdout] 259 | for (_, [x_pos, y_pos, x_vel, y_vel]) in rx.captures_iter(&line).map(|c| c.extract()) { [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day14.rs:289:30 [INFO] [stdout] | [INFO] [stdout] 289 | for robot in parse_input(&input).into_iter() { [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Quadrant; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/day14.rs:307:14 [INFO] [stdout] | [INFO] [stdout] 307 | for q in QUADRANTS.clone().into_iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `QUADRANTS` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day14.rs:322:30 [INFO] [stdout] | [INFO] [stdout] 322 | for robot in parse_input(&input).into_iter() { [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day15.rs:63:31 [INFO] [stdout] | [INFO] [stdout] 63 | pub fn parse_movements(input: &String) -> 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] 63 - pub fn parse_movements(input: &String) -> Vec { [INFO] [stdout] 63 + pub fn parse_movements(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day15.rs:94:32 [INFO] [stdout] | [INFO] [stdout] 94 | pub fn expand_warehouse(input: &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 94 - pub fn expand_warehouse(input: &String) -> String { [INFO] [stdout] 94 + pub fn expand_warehouse(input: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day15.rs:108:24 [INFO] [stdout] | [INFO] [stdout] 108 | pub fn from(input: &String) -> Self { [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] 108 - pub fn from(input: &String) -> Self { [INFO] [stdout] 108 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:185:39 [INFO] [stdout] | [INFO] [stdout] 185 | let src_entity = self.map.get(&src).unwrap(); [INFO] [stdout] | ^^^^ help: change this to: `src` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:199:60 [INFO] [stdout] | [INFO] [stdout] 199 | let push_left = self._try_push(&box_l_src, &dir, pushes); [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:200:61 [INFO] [stdout] | [INFO] [stdout] 200 | let push_right = self._try_push(&box_r_src, &dir, pushes); [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:222:45 [INFO] [stdout] | [INFO] [stdout] 222 | match self._try_push(&dest, &dir, pushes) { [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:261:28 [INFO] [stdout] | [INFO] [stdout] 261 | match self.map.get(&dest).unwrap() { [INFO] [stdout] | ^^^^^ help: change this to: `dest` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:263:39 [INFO] [stdout] | [INFO] [stdout] 263 | match self.map.remove(&src).unwrap() { [INFO] [stdout] | ^^^^ help: change this to: `src` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:277:55 [INFO] [stdout] | [INFO] [stdout] 277 | match self._try_push(&self.robot_loc.clone(), &dir, &mut pushes) { [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day15.rs:316:17 [INFO] [stdout] | [INFO] [stdout] 316 | / match self.map.get(&Loc { x, y }).unwrap() { [INFO] [stdout] 317 | | Some(Entity::Box) => { [INFO] [stdout] 318 | | sum += 100 * y + x [INFO] [stdout] 319 | | }, [INFO] [stdout] 320 | | _ => (), [INFO] [stdout] 321 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 316 ~ if let Some(Entity::Box) = self.map.get(&Loc { x, y }).unwrap() { [INFO] [stdout] 317 + sum += 100 * y + x [INFO] [stdout] 318 + } [INFO] [stdout] | [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/day15.rs:331:17 [INFO] [stdout] | [INFO] [stdout] 331 | / match self.map.get(&Loc { x, y }).unwrap() { [INFO] [stdout] 332 | | Some(Entity::BoxLeft) => { [INFO] [stdout] 333 | | sum += 100 * y + x [INFO] [stdout] 334 | | }, [INFO] [stdout] 335 | | _ => (), [INFO] [stdout] 336 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 331 ~ if let Some(Entity::BoxLeft) = self.map.get(&Loc { x, y }).unwrap() { [INFO] [stdout] 332 + sum += 100 * y + x [INFO] [stdout] 333 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day15.rs:362:13 [INFO] [stdout] | [INFO] [stdout] 362 | write!(f, "\n").expect("failed to write"); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 362 - write!(f, "\n").expect("failed to write"); [INFO] [stdout] 362 + writeln!(f).expect("failed to write"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day15.rs:364:9 [INFO] [stdout] | [INFO] [stdout] 364 | write!(f, "\n") [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 364 - write!(f, "\n") [INFO] [stdout] 364 + writeln!(f) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:375:34 [INFO] [stdout] | [INFO] [stdout] 375 | let mut wh = Warehouse::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:376:33 [INFO] [stdout] | [INFO] [stdout] 376 | let moves = parse_movements(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:391:43 [INFO] [stdout] | [INFO] [stdout] 391 | let expanded_input = expand_warehouse(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day15.rs:393:33 [INFO] [stdout] | [INFO] [stdout] 393 | let moves = parse_movements(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day16.rs:167:27 [INFO] [stdout] | [INFO] [stdout] 167 | fn _parse_base(input: &String) -> BaseMap { [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] 167 - fn _parse_base(input: &String) -> BaseMap { [INFO] [stdout] 167 + fn _parse_base(input: &str) -> BaseMap { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/day16.rs:188:53 [INFO] [stdout] | [INFO] [stdout] 188 | neighbor_map.entry(loc.clone()).or_insert(FxHashMap::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:201:42 [INFO] [stdout] | [INFO] [stdout] 201 | let base_map = Maze::_parse_base(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:217:43 [INFO] [stdout] | [INFO] [stdout] 217 | Self::_init_neighbors(&loc, &base_map, &mut neighbor_map); [INFO] [stdout] | ^^^^ help: change this to: `loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:221:43 [INFO] [stdout] | [INFO] [stdout] 221 | Self::_init_neighbors(&loc, &base_map, &mut neighbor_map); [INFO] [stdout] | ^^^^ help: change this to: `loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:224:43 [INFO] [stdout] | [INFO] [stdout] 224 | Self::_init_neighbors(&loc, &base_map, &mut neighbor_map); [INFO] [stdout] | ^^^^ help: change this to: `loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day16.rs:288:13 [INFO] [stdout] | [INFO] [stdout] 288 | / match self.can_move(deer_src, r.as_ref()) { [INFO] [stdout] 289 | | Some(_move) => { [INFO] [stdout] 290 | | moves.push(_move); [INFO] [stdout] 291 | | }, [INFO] [stdout] 292 | | None => (), [INFO] [stdout] 293 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 288 ~ if let Some(_move) = self.can_move(deer_src, r.as_ref()) { [INFO] [stdout] 289 + moves.push(_move); [INFO] [stdout] 290 + } [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/day16.rs:305:34 [INFO] [stdout] | [INFO] [stdout] 305 | pub fn compute_cost(actions: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 305 - pub fn compute_cost(actions: &Vec) -> isize { [INFO] [stdout] 305 + pub fn compute_cost(actions: &[Action]) -> isize { [INFO] [stdout] | [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/day16.rs:331:9 [INFO] [stdout] | [INFO] [stdout] 331 | / match a { [INFO] [stdout] 332 | | Action::Move(sd, dd) => { [INFO] [stdout] 333 | | moves.entry(sd.loc.clone()).or_insert(dd.dir.clone()); [INFO] [stdout] 334 | | }, [INFO] [stdout] 335 | | _ => (), [INFO] [stdout] 336 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 331 ~ if let Action::Move(sd, dd) = a { [INFO] [stdout] 332 + moves.entry(sd.loc.clone()).or_insert(dd.dir.clone()); [INFO] [stdout] 333 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day16.rs:339:5 [INFO] [stdout] | [INFO] [stdout] 339 | 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] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/day16.rs:375:9 [INFO] [stdout] | [INFO] [stdout] 375 | 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] 375 - print!("\n"); [INFO] [stdout] 375 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day16.rs:444:11 [INFO] [stdout] | [INFO] [stdout] 444 | while to_process.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_process.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day16.rs:530:15 [INFO] [stdout] | [INFO] [stdout] 530 | while to_process.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_process.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:546:44 [INFO] [stdout] | [INFO] [stdout] 546 | for mv in maze.get_valid_moves(&last_move_deer).iter_mut() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `last_move_deer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day16.rs:555:21 [INFO] [stdout] | [INFO] [stdout] 555 | / match best_costs.get(&d) { [INFO] [stdout] 556 | | Some(c) => { [INFO] [stdout] 557 | | target_vals.push(c); [INFO] [stdout] ... | [INFO] [stdout] 560 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 555 ~ if let Some(c) = best_costs.get(&d) { [INFO] [stdout] 556 + target_vals.push(c); [INFO] [stdout] 557 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:555:42 [INFO] [stdout] | [INFO] [stdout] 555 | match best_costs.get(&d) { [INFO] [stdout] | ^^ help: change this to: `d` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:583:35 [INFO] [stdout] | [INFO] [stdout] 583 | let best = best_costs.get(&deer).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `deer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:613:27 [INFO] [stdout] | [INFO] [stdout] 613 | let maze = Maze::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:625:27 [INFO] [stdout] | [INFO] [stdout] 625 | let maze = Maze::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day16.rs:631:13 [INFO] [stdout] | [INFO] [stdout] 631 | / match a { [INFO] [stdout] 632 | | Action::Move(src, dest) => { [INFO] [stdout] 633 | | visits.insert(src.loc.clone()); [INFO] [stdout] 634 | | visits.insert(dest.loc.clone()); [INFO] [stdout] 635 | | } [INFO] [stdout] 636 | | _ => (), [INFO] [stdout] 637 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 631 ~ if let Action::Move(src, dest) = a { [INFO] [stdout] 632 + visits.insert(src.loc.clone()); [INFO] [stdout] 633 + visits.insert(dest.loc.clone()); [INFO] [stdout] 634 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day17.rs:18:24 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn from(input: &String) -> Self { [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] 18 - pub fn from(input: &String) -> Self { [INFO] [stdout] 18 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> src/day17.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0..=7` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] = note: `#[warn(clippy::manual_range_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> src/day17.rs:98:13 [INFO] [stdout] | [INFO] [stdout] 98 | 0 | 1 | 2 | 3 => operand.0, [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `0..=3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:112:37 [INFO] [stdout] | [INFO] [stdout] 112 | if !self._valid_op(ins_ptr, &program) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day17.rs:165:24 [INFO] [stdout] | [INFO] [stdout] 165 | pub fn from(input: &String) -> Self { [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] 165 - pub fn from(input: &String) -> Self { [INFO] [stdout] 165 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:202:49 [INFO] [stdout] | [INFO] [stdout] 202 | if let Some(op) = self.op(self.ins_ptr, &program) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/day17.rs:274:9 [INFO] [stdout] | [INFO] [stdout] 274 | / loop { [INFO] [stdout] 275 | | match self.step(&program) { [INFO] [stdout] 276 | | Some(next_ins_ptr) => { [INFO] [stdout] 277 | | self.ins_ptr = next_ins_ptr; [INFO] [stdout] ... | [INFO] [stdout] 281 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(next_ins_ptr) = self.step(&program) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:275:29 [INFO] [stdout] | [INFO] [stdout] 275 | match self.step(&program) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:286:25 [INFO] [stdout] | [INFO] [stdout] 286 | match self.step(&program) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `program` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:302:31 [INFO] [stdout] | [INFO] [stdout] 302 | let mut proc = Proc::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:303:30 [INFO] [stdout] | [INFO] [stdout] 303 | let prog = Program::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:406:31 [INFO] [stdout] | [INFO] [stdout] 406 | let mut proc = Proc::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:407:30 [INFO] [stdout] | [INFO] [stdout] 407 | let prog = Program::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:439:30 [INFO] [stdout] | [INFO] [stdout] 439 | let prog = Program::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day17.rs:440:32 [INFO] [stdout] | [INFO] [stdout] 440 | let init_proc = Proc::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day17.rs:481:25 [INFO] [stdout] | [INFO] [stdout] 481 | / if proc.output == prog.instructions[prog.instructions.len() - proc.output.len()..] { [INFO] [stdout] 482 | | if power < 15 { [INFO] [stdout] 483 | | to_process.push_back((power + 1, a*8, result.clone())); [INFO] [stdout] 484 | | println!("power: {}\t{:?}", power, result); [INFO] [stdout] 485 | | } [INFO] [stdout] 486 | | } [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] 481 ~ if proc.output == prog.instructions[prog.instructions.len() - proc.output.len()..] [INFO] [stdout] 482 ~ && power < 15 { [INFO] [stdout] 483 | to_process.push_back((power + 1, a*8, result.clone())); [INFO] [stdout] 484 | println!("power: {}\t{:?}", power, result); [INFO] [stdout] 485 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day17.rs:487:25 [INFO] [stdout] | [INFO] [stdout] 487 | / if power == 15 { [INFO] [stdout] 488 | | if result == prog.instructions { [INFO] [stdout] 489 | | println!("result found. A: {}", a); [INFO] [stdout] 490 | | println!("{:?}", result); [INFO] [stdout] ... | [INFO] [stdout] 493 | | } [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] 487 ~ if power == 15 [INFO] [stdout] 488 ~ && result == prog.instructions { [INFO] [stdout] 489 | println!("result found. A: {}", a); [INFO] [stdout] 490 | println!("{:?}", result); [INFO] [stdout] 491 | results.push(a); [INFO] [stdout] 492 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day17.rs:497:25 [INFO] [stdout] | [INFO] [stdout] 497 | / if proc.output.len() == 1 { [INFO] [stdout] 498 | | if proc.output[0] != target { [INFO] [stdout] 499 | | break; [INFO] [stdout] 500 | | } [INFO] [stdout] 501 | | } [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] 497 ~ if proc.output.len() == 1 [INFO] [stdout] 498 ~ && proc.output[0] != target { [INFO] [stdout] 499 | break; [INFO] [stdout] 500 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day18.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 55 | fn parse_corrupt_locs(input: &String, mut bytes_fallen: isize) -> FxHashSet { [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] 55 - fn parse_corrupt_locs(input: &String, mut bytes_fallen: isize) -> FxHashSet { [INFO] [stdout] 55 + fn parse_corrupt_locs(input: &str, mut bytes_fallen: isize) -> FxHashSet { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/day18.rs:80:45 [INFO] [stdout] | [INFO] [stdout] 80 | if next_loc.x < 0 || next_loc.y < 0 { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 81 | | continue; [INFO] [stdout] 82 | | } else if next_loc.x > mmap.x_max || next_loc.y > mmap.y_max { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/day18.rs:82:70 [INFO] [stdout] | [INFO] [stdout] 82 | } else if next_loc.x > mmap.x_max || next_loc.y > mmap.y_max { [INFO] [stdout] | ______________________________________________________________________^ [INFO] [stdout] 83 | | continue; [INFO] [stdout] 84 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:113:43 [INFO] [stdout] | [INFO] [stdout] 113 | let best_len = best_paths.get(&frontier_loc).unwrap()[0].len(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `frontier_loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:115:45 [INFO] [stdout] | [INFO] [stdout] 115 | let next_locs = get_valid_moves(&frontier_loc, &mmap); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `frontier_loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:115:60 [INFO] [stdout] | [INFO] [stdout] 115 | let next_locs = get_valid_moves(&frontier_loc, &mmap); [INFO] [stdout] | ^^^^^ help: change this to: `mmap` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:121:44 [INFO] [stdout] | [INFO] [stdout] 121 | if best_paths.contains_key(&nl) { [INFO] [stdout] | ^^^ help: change this to: `nl` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:122:50 [INFO] [stdout] | [INFO] [stdout] 122 | let nl_best = best_paths.get(&nl).unwrap()[0].len(); [INFO] [stdout] | ^^^ help: change this to: `nl` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:125:64 [INFO] [stdout] | [INFO] [stdout] 125 | let mut updated_paths = best_paths.get(&frontier_loc).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `frontier_loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:148:60 [INFO] [stdout] | [INFO] [stdout] 148 | let mut updated_paths = best_paths.get(&frontier_loc).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `frontier_loc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/day18.rs:161:40 [INFO] [stdout] | [INFO] [stdout] 161 | let best_path_locs: Vec = best_paths.keys().map(|k| k.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `best_paths.keys().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:163:34 [INFO] [stdout] | [INFO] [stdout] 163 | if frontier.contains(&l) || next_frontier.contains(&l) { [INFO] [stdout] | ^^ help: change this to: `l` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:163:64 [INFO] [stdout] | [INFO] [stdout] 163 | if frontier.contains(&l) || next_frontier.contains(&l) { [INFO] [stdout] | ^^ help: change this to: `l` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:166:35 [INFO] [stdout] | [INFO] [stdout] 166 | best_paths.remove(&l); [INFO] [stdout] | ^^ help: change this to: `l` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:215:43 [INFO] [stdout] | [INFO] [stdout] 215 | let corrupt_locs = parse_corrupt_locs(&input, bytes_fallen); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day18.rs:227:47 [INFO] [stdout] | [INFO] [stdout] 227 | let corrupt_locs = parse_corrupt_locs(&input, bytes_fallen); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day19.rs:14:24 [INFO] [stdout] | [INFO] [stdout] 14 | fn parse_towels(input: &String) -> FxHashSet { [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] 14 - fn parse_towels(input: &String) -> FxHashSet { [INFO] [stdout] 14 + fn parse_towels(input: &str) -> FxHashSet { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day19.rs:19:25 [INFO] [stdout] | [INFO] [stdout] 19 | fn parse_designs(input: &String) -> 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] 19 - fn parse_designs(input: &String) -> Vec { [INFO] [stdout] 19 + fn parse_designs(input: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day19.rs:33:8 [INFO] [stdout] | [INFO] [stdout] 33 | if design == "" { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:47:26 [INFO] [stdout] | [INFO] [stdout] 47 | if can_build(&towels, &design[0..design.len()-i], max_len) { [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day19.rs:56:8 [INFO] [stdout] | [INFO] [stdout] 56 | if design == "" { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [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/day19.rs:71:13 [INFO] [stdout] | [INFO] [stdout] 71 | / match chunkiest_solution(&towels, &next_design, max_len) { [INFO] [stdout] 72 | | Some(mut sol) => { [INFO] [stdout] 73 | | sol.push(next_design); [INFO] [stdout] 74 | | return Some(sol); [INFO] [stdout] 75 | | }, [INFO] [stdout] 76 | | None => (), [INFO] [stdout] 77 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 71 ~ if let Some(mut sol) = chunkiest_solution(&towels, &next_design, max_len) { [INFO] [stdout] 72 + sol.push(next_design); [INFO] [stdout] 73 + return Some(sol); [INFO] [stdout] 74 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:71:38 [INFO] [stdout] | [INFO] [stdout] 71 | match chunkiest_solution(&towels, &next_design, max_len) { [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:71:47 [INFO] [stdout] | [INFO] [stdout] 71 | match chunkiest_solution(&towels, &next_design, max_len) { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `next_design` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/day19.rs:83:17 [INFO] [stdout] | [INFO] [stdout] 83 | fn count_combos<'a>(towels: &FxHashSet, design: &'a str, mut max_len: usize) -> isize { [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] 83 - fn count_combos<'a>(towels: &FxHashSet, design: &'a str, mut max_len: usize) -> isize { [INFO] [stdout] 83 + fn count_combos(towels: &FxHashSet, design: &str, mut max_len: usize) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day19.rs:84:8 [INFO] [stdout] | [INFO] [stdout] 84 | if design == "" { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `design.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/day19.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | let _can_build: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 96 | _can_build = can_build(&towels, next_des, max_len); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `_can_build` here [INFO] [stdout] | [INFO] [stdout] 95 ~ [INFO] [stdout] 96 ~ let _can_build: bool = can_build(&towels, next_des, max_len); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:96:36 [INFO] [stdout] | [INFO] [stdout] 96 | _can_build = can_build(&towels, next_des, max_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:98:39 [INFO] [stdout] | [INFO] [stdout] 98 | count += count_combos(&towels, next_des, max_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:107:31 [INFO] [stdout] | [INFO] [stdout] 107 | let towels = parse_towels(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:109:33 [INFO] [stdout] | [INFO] [stdout] 109 | let designs = parse_designs(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day19.rs:136:32 [INFO] [stdout] | [INFO] [stdout] 136 | pub fn get_all_combinations(a: &Vec, b: &Vec) -> Vec<(String, String)> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 136 - pub fn get_all_combinations(a: &Vec, b: &Vec) -> Vec<(String, String)> { [INFO] [stdout] 136 + pub fn get_all_combinations(a: &[String], b: &Vec) -> Vec<(String, String)> { [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/day19.rs:136:49 [INFO] [stdout] | [INFO] [stdout] 136 | pub fn get_all_combinations(a: &Vec, b: &Vec) -> Vec<(String, String)> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 136 - pub fn get_all_combinations(a: &Vec, b: &Vec) -> Vec<(String, String)> { [INFO] [stdout] 136 + pub fn get_all_combinations(a: &Vec, b: &[String]) -> Vec<(String, String)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:149:31 [INFO] [stdout] | [INFO] [stdout] 149 | let towels = parse_towels(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:151:33 [INFO] [stdout] | [INFO] [stdout] 151 | let designs = parse_designs(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day19.rs:178:13 [INFO] [stdout] | [INFO] [stdout] 178 | / if t.len() >= min_len { [INFO] [stdout] 179 | | if towels.contains(&design[base_idx..base_idx + t.len()]) && &design[base_idx..base_idx + t.len()] == t { [INFO] [stdout] 180 | | gap_crossing_patterns.push((t.clone(), base_idx)); [INFO] [stdout] 181 | | } [INFO] [stdout] 182 | | } [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] 178 ~ if t.len() >= min_len [INFO] [stdout] 179 ~ && towels.contains(&design[base_idx..base_idx + t.len()]) && &design[base_idx..base_idx + t.len()] == t { [INFO] [stdout] 180 | gap_crossing_patterns.push((t.clone(), base_idx)); [INFO] [stdout] 181 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:188:29 [INFO] [stdout] | [INFO] [stdout] 188 | sum += count_combos(&towels, &design[0..midpt], max_towel_len) [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:189:31 [INFO] [stdout] | [INFO] [stdout] 189 | * count_combos(&towels, &design[midpt..], max_towel_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:192:33 [INFO] [stdout] | [INFO] [stdout] 192 | sum += count_combos(&towels, &design[0..p.1], max_towel_len) [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:193:35 [INFO] [stdout] | [INFO] [stdout] 193 | * count_combos(&towels, &design[p.1 + p.0.len()..], max_towel_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:196:36 [INFO] [stdout] | [INFO] [stdout] 196 | sum += count_design_combos(&towels, &design[0..midpt], biggest_towel_len) [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:197:38 [INFO] [stdout] | [INFO] [stdout] 197 | * count_design_combos(&towels, &design[midpt..], biggest_towel_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:200:40 [INFO] [stdout] | [INFO] [stdout] 200 | sum += count_design_combos(&towels, &design[0..p.1], biggest_towel_len) [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day19.rs:201:42 [INFO] [stdout] | [INFO] [stdout] 201 | * count_design_combos(&towels, &design[p.1 + p.0.len()..], biggest_towel_len); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day20.rs:33:24 [INFO] [stdout] | [INFO] [stdout] 33 | pub fn from(input: &String) -> Self { [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] 33 - pub fn from(input: &String) -> Self { [INFO] [stdout] 33 + pub fn from(input: &str) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `y` is used as a loop counter [INFO] [stdout] --> src/day20.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | for row in input.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (y, row) in input.lines().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: the variable `x` is used as a loop counter [INFO] [stdout] --> src/day20.rs:40:13 [INFO] [stdout] | [INFO] [stdout] 40 | for c in row.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (x, c) in row.chars().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20.rs:121:36 [INFO] [stdout] | [INFO] [stdout] 121 | if result.contains_key(&m) { [INFO] [stdout] | ^^ help: change this to: `m` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20.rs:138:29 [INFO] [stdout] | [INFO] [stdout] 138 | let track = Track::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day20.rs:188:29 [INFO] [stdout] | [INFO] [stdout] 188 | let track = Track::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day21.rs:224:17 [INFO] [stdout] | [INFO] [stdout] 224 | return result; [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] 224 ~ result [INFO] [stdout] 225 | }, [INFO] [stdout] ... [INFO] [stdout] 238 | } [INFO] [stdout] 239 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day21.rs:237:17 [INFO] [stdout] | [INFO] [stdout] 237 | return result; [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] 237 ~ result [INFO] [stdout] 238 | } [INFO] [stdout] 239 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:176:68 [INFO] [stdout] | [INFO] [stdout] 176 | let key_paths_to_solve = controller.solve_root_seq(&key_seq); [INFO] [stdout] | ^^^^^^^^ help: change this to: `key_seq` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:185:47 [INFO] [stdout] | [INFO] [stdout] 185 | ... let k = op_to_key(&op); [INFO] [stdout] | ^^^ help: change this to: `op` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `shortest_paths` [INFO] [stdout] --> src/day21.rs:187:38 [INFO] [stdout] | [INFO] [stdout] 187 | ... for i in 0..shortest_paths.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 [INFO] [stdout] | [INFO] [stdout] 187 - for i in 0..shortest_paths.len() { [INFO] [stdout] 187 + for in &mut shortest_paths { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day21.rs:190:32 [INFO] [stdout] | [INFO] [stdout] 190 | ... if key_path_results.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!key_path_results.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `key_path_results` [INFO] [stdout] --> src/day21.rs:193:42 [INFO] [stdout] | [INFO] [stdout] 193 | ... for i in 0..key_path_results.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] 193 - for i in 0..key_path_results.len() { [INFO] [stdout] 193 + for in &key_path_results { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `shortest_paths` [INFO] [stdout] --> src/day21.rs:194:46 [INFO] [stdout] | [INFO] [stdout] 194 | ... for j in 0..shortest_paths.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] 194 - for j in 0..shortest_paths.len() { [INFO] [stdout] 194 + for in &shortest_paths { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:230:81 [INFO] [stdout] | [INFO] [stdout] 230 | let mut shortest_paths = shortest_paths(&self.keypad, &pos, &k); [INFO] [stdout] | ^^ help: change this to: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `shortest_paths` [INFO] [stdout] --> src/day21.rs:231:30 [INFO] [stdout] | [INFO] [stdout] 231 | for i in 0..shortest_paths.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] 231 - for i in 0..shortest_paths.len() { [INFO] [stdout] 231 + for in &mut shortest_paths { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:248:36 [INFO] [stdout] | [INFO] [stdout] 248 | let src_bests = best_paths.get(&src_key).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^ help: change this to: `src_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:250:36 [INFO] [stdout] | [INFO] [stdout] 250 | if best_paths.contains_key(&key) { [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:251:49 [INFO] [stdout] | [INFO] [stdout] 251 | let existing_bests = best_paths.get(&key).unwrap().clone(); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `current_bests` [INFO] [stdout] --> src/day21.rs:254:26 [INFO] [stdout] | [INFO] [stdout] 254 | for i in 0..current_bests.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] 254 - for i in 0..current_bests.len() { [INFO] [stdout] 254 + for in &mut current_bests { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `current_bests` [INFO] [stdout] --> src/day21.rs:262:26 [INFO] [stdout] | [INFO] [stdout] 262 | for i in 0..current_bests.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] 262 - for i in 0..current_bests.len() { [INFO] [stdout] 262 + for in &mut current_bests { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `current_bests` [INFO] [stdout] --> src/day21.rs:273:22 [INFO] [stdout] | [INFO] [stdout] 273 | for i in 0..current_bests.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] 273 - for i in 0..current_bests.len() { [INFO] [stdout] 273 + for in &mut current_bests { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:281:21 [INFO] [stdout] | [INFO] [stdout] 281 | _best_paths(&keypad, &key, &dest_key, best_paths); [INFO] [stdout] | ^^^^^^^ help: change this to: `keypad` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:281:30 [INFO] [stdout] | [INFO] [stdout] 281 | _best_paths(&keypad, &key, &dest_key, best_paths); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:281:36 [INFO] [stdout] | [INFO] [stdout] 281 | _best_paths(&keypad, &key, &dest_key, best_paths); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:289:17 [INFO] [stdout] | [INFO] [stdout] 289 | _best_paths(&keypad, &src_key, &dest_key, &mut best_paths); [INFO] [stdout] | ^^^^^^^ help: change this to: `keypad` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:289:26 [INFO] [stdout] | [INFO] [stdout] 289 | _best_paths(&keypad, &src_key, &dest_key, &mut best_paths); [INFO] [stdout] | ^^^^^^^^ help: change this to: `src_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:289:36 [INFO] [stdout] | [INFO] [stdout] 289 | _best_paths(&keypad, &src_key, &dest_key, &mut best_paths); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day21.rs:292:8 [INFO] [stdout] | [INFO] [stdout] 292 | if best_paths.get(&dest_key).unwrap()[0].len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `best_paths.get(&dest_key).unwrap()[0].is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:292:23 [INFO] [stdout] | [INFO] [stdout] 292 | if best_paths.get(&dest_key).unwrap()[0].len() == 0 { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:293:31 [INFO] [stdout] | [INFO] [stdout] 293 | return best_paths.get(&dest_key).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:295:29 [INFO] [stdout] | [INFO] [stdout] 295 | for p in best_paths.get(&dest_key).unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:310:29 [INFO] [stdout] | [INFO] [stdout] 310 | for p in best_paths.get(&dest_key).unwrap().iter() { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `dest_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:332:25 [INFO] [stdout] | [INFO] [stdout] 332 | pub fn parse_keys(code: &String) -> 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] 332 - pub fn parse_keys(code: &String) -> Vec { [INFO] [stdout] 332 + pub fn parse_keys(code: &str) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:365:43 [INFO] [stdout] | [INFO] [stdout] 365 | pub fn numeric_complexity_component(code: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 365 - pub fn numeric_complexity_component(code: &Vec) -> isize { [INFO] [stdout] 365 + pub fn numeric_complexity_component(code: &[Key]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `code` [INFO] [stdout] --> src/day21.rs:368:14 [INFO] [stdout] | [INFO] [stdout] 368 | for i in 0..3 { [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] 368 - for i in 0..3 { [INFO] [stdout] 368 + for in code.iter().take(3) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:388:24 [INFO] [stdout] | [INFO] [stdout] 388 | pub fn render_one(ops: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 388 - pub fn render_one(ops: &Vec) -> String { [INFO] [stdout] 388 + pub fn render_one(ops: &[ArmOp]) -> String { [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/day21.rs:402:24 [INFO] [stdout] | [INFO] [stdout] 402 | pub fn render_all(ops: &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] 402 - pub fn render_all(ops: &Vec>>) { [INFO] [stdout] 402 + pub fn render_all(ops: &[Vec>]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:409:36 [INFO] [stdout] | [INFO] [stdout] 409 | render_one(&first), [INFO] [stdout] | ^^^^^^ help: change this to: `first` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:410:36 [INFO] [stdout] | [INFO] [stdout] 410 | render_one(&second), [INFO] [stdout] | ^^^^^^^ help: change this to: `second` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:411:36 [INFO] [stdout] | [INFO] [stdout] 411 | render_one(&third), [INFO] [stdout] | ^^^^^^ help: change this to: `third` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:412:36 [INFO] [stdout] | [INFO] [stdout] 412 | render_one(&fourth), [INFO] [stdout] | ^^^^^^^ help: change this to: `fourth` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:421:51 [INFO] [stdout] | [INFO] [stdout] 421 | let key_solutions = controller.solve_root_seq(&code); [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `key_solutions` [INFO] [stdout] --> src/day21.rs:423:14 [INFO] [stdout] | [INFO] [stdout] 423 | for i in 0..key_solutions.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] 423 - for i in 0..key_solutions.len() { [INFO] [stdout] 423 + for in &key_solutions { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `key_solutions` [INFO] [stdout] --> src/day21.rs:425:18 [INFO] [stdout] | [INFO] [stdout] 425 | for j in 0..key_solutions[i].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] 425 - for j in 0..key_solutions[i].len() { [INFO] [stdout] 425 + for in key_solutions.iter().take(key_solutions[i].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:435:64 [INFO] [stdout] | [INFO] [stdout] 435 | pub fn compute_complexity(controller: &RobotController, codes: &Vec>) -> isize { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 435 - pub fn compute_complexity(controller: &RobotController, codes: &Vec>) -> isize { [INFO] [stdout] 435 + pub fn compute_complexity(controller: &RobotController, codes: &[Vec]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:438:53 [INFO] [stdout] | [INFO] [stdout] 438 | let shortest_seq_len = compute_shortest_seq(&controller, &code); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `controller` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:438:66 [INFO] [stdout] | [INFO] [stdout] 438 | let shortest_seq_len = compute_shortest_seq(&controller, &code); [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:439:52 [INFO] [stdout] | [INFO] [stdout] 439 | let numeric = numeric_complexity_component(&code); [INFO] [stdout] | ^^^^^ help: change this to: `code` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:458:42 [INFO] [stdout] | [INFO] [stdout] 458 | compute_complexity(&dir_controller2, &codes) [INFO] [stdout] | ^^^^^^ help: change this to: `codes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:474:36 [INFO] [stdout] | [INFO] [stdout] 474 | pub fn find_min_presses(contender: &Vec, depth: isize, score_cache: &mut FxHashMap) -> isize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 474 ~ pub fn find_min_presses(contender: &[ArmOp], depth: isize, score_cache: &mut FxHashMap) -> isize { [INFO] [stdout] 475 | let controller = RobotController { [INFO] [stdout] ... [INFO] [stdout] 478 | }; [INFO] [stdout] 479 ~ let key = ContenderKey(contender.to_owned(), depth); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:488:37 [INFO] [stdout] | [INFO] [stdout] 488 | let keys = contender.iter().map(|op| op_to_key(op)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `op_to_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day21.rs:505:31 [INFO] [stdout] | [INFO] [stdout] 505 | fn solution_for_robots(codes: &Vec>, directional_robots: isize) -> isize { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 505 - fn solution_for_robots(codes: &Vec>, directional_robots: isize) -> isize { [INFO] [stdout] 505 + fn solution_for_robots(codes: &[Vec], directional_robots: isize) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `codes` [INFO] [stdout] --> src/day21.rs:512:14 [INFO] [stdout] | [INFO] [stdout] 512 | for i in 0..codes.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] 512 - for i in 0..codes.len() { [INFO] [stdout] 512 + for in &codes { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day21.rs:535:25 [INFO] [stdout] | [INFO] [stdout] 535 | solution_for_robots(&codes, 25) [INFO] [stdout] | ^^^^^^ help: change this to: `codes` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | secret = secret ^ a; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | secret = secret ^ b; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | secret = secret ^ c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:36:9 [INFO] [stdout] | [INFO] [stdout] 36 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | secret = secret ^ a; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | secret = secret ^ b; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | secret = secret ^ c; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret ^= c` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/day22.rs:60:9 [INFO] [stdout] | [INFO] [stdout] 60 | secret = secret % 16777216; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `secret %= 16777216` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day22.rs:67:35 [INFO] [stdout] | [INFO] [stdout] 67 | pub fn secrets_to_prices(secrets: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 67 - pub fn secrets_to_prices(secrets: &Vec) -> Vec { [INFO] [stdout] 67 + pub fn secrets_to_prices(secrets: &[isize]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day22.rs:71:28 [INFO] [stdout] | [INFO] [stdout] 71 | pub fn price_diffs(prices: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - pub fn price_diffs(prices: &Vec) -> Vec { [INFO] [stdout] 71 + pub fn price_diffs(prices: &[isize]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/day22.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | / let mut result = vec![]; [INFO] [stdout] 73 | | result.reserve(prices.len()); [INFO] [stdout] | |_________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut result = Vec::with_capacity(prices.len());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] = note: `#[warn(clippy::reserve_after_initialization)]` 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/day22.rs:82:26 [INFO] [stdout] | [INFO] [stdout] 82 | pub fn _solution1(input: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 82 - pub fn _solution1(input: &Vec) -> isize { [INFO] [stdout] 82 + pub fn _solution1(input: &[isize]) -> isize { [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/day22.rs:100:33 [INFO] [stdout] | [INFO] [stdout] 100 | pub fn _solution2(init_secrets: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - pub fn _solution2(init_secrets: &Vec) -> isize { [INFO] [stdout] 100 + pub fn _solution2(init_secrets: &[isize]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(isize, isize, isize, isize)` which implements the `Copy` trait [INFO] [stdout] --> src/day22.rs:112:37 [INFO] [stdout] | [INFO] [stdout] 112 | secret_totals.entry(k.clone()).or_insert(prices[i+1]); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(isize, isize, isize, isize)` which implements the `Copy` trait [INFO] [stdout] --> src/day22.rs:114:34 [INFO] [stdout] | [INFO] [stdout] 114 | totals.entry(k.clone()).or_insert(prices[i+1]); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day23.rs:11:28 [INFO] [stdout] | [INFO] [stdout] 11 | fn graph_from_input(input: &String) -> Graph { [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] 11 - fn graph_from_input(input: &String) -> Graph { [INFO] [stdout] 11 + fn graph_from_input(input: &str) -> Graph { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/day23.rs:19:28 [INFO] [stdout] | [INFO] [stdout] 19 | result.get_mut(&a.to_string()).unwrap().insert(b.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/day23.rs:25:28 [INFO] [stdout] | [INFO] [stdout] 25 | result.get_mut(&b.to_string()).unwrap().insert(a.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `networks` [INFO] [stdout] --> src/day23.rs:72:18 [INFO] [stdout] | [INFO] [stdout] 72 | for i in 0..networks.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] 72 - for i in 0..networks.len() { [INFO] [stdout] 72 + for in &networks { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day23.rs:98:12 [INFO] [stdout] | [INFO] [stdout] 98 | if networks.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `networks.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day23.rs:105:30 [INFO] [stdout] | [INFO] [stdout] 105 | let g = graph_from_input(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day23.rs:124:30 [INFO] [stdout] | [INFO] [stdout] 124 | let g = graph_from_input(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day24.rs:85:21 [INFO] [stdout] | [INFO] [stdout] 85 | pub fn parse(input: &String) -> Device { [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] 85 - pub fn parse(input: &String) -> Device { [INFO] [stdout] 85 + pub fn parse(input: &str) -> Device { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day24.rs:86:52 [INFO] [stdout] | [INFO] [stdout] 86 | let wire_lines = input.lines().take_while(|&l| l != ""); [INFO] [stdout] | ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day24.rs:87:58 [INFO] [stdout] | [INFO] [stdout] 87 | let gate_lines = input.lines().rev().take_while(|&l| l != ""); [INFO] [stdout] | ^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day24.rs:133:11 [INFO] [stdout] | [INFO] [stdout] 133 | while new_outputs.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!new_outputs.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/day24.rs:144:17 [INFO] [stdout] | [INFO] [stdout] 144 | / match (input1_o, input2_o) { [INFO] [stdout] 145 | | (Some(input1_o), Some(input2_o)) => { [INFO] [stdout] 146 | | let new_output = match gate.kind { [INFO] [stdout] 147 | | GateKind::OR => input1_o | input2_o, [INFO] [stdout] ... | [INFO] [stdout] 154 | | _ => (), [INFO] [stdout] 155 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 144 ~ if let (Some(input1_o), Some(input2_o)) = (input1_o, input2_o) { [INFO] [stdout] 145 + let new_output = match gate.kind { [INFO] [stdout] 146 + GateKind::OR => input1_o | input2_o, [INFO] [stdout] 147 + GateKind::XOR => input1_o ^ input2_o, [INFO] [stdout] 148 + GateKind::AND => input1_o & input2_o, [INFO] [stdout] 149 + }; [INFO] [stdout] 150 + device.output_vals.entry(gate.output.clone()).or_insert(new_output); [INFO] [stdout] 151 + next_new_outputs.insert(gate.output.clone()); [INFO] [stdout] 152 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day24.rs:172:28 [INFO] [stdout] | [INFO] [stdout] 172 | let mut device = parse(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day24.rs:214:47 [INFO] [stdout] | [INFO] [stdout] 214 | fn rand_test(device: &Device, gate_overrides: &Vec, iterations: isize) -> isize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 214 ~ fn rand_test(device: &Device, gate_overrides: &[Gate], iterations: isize) -> isize { [INFO] [stdout] 215 | let mut fail_count = 0; [INFO] [stdout] ... [INFO] [stdout] 219 | let y = rng.gen_range(0..=1<<44); [INFO] [stdout] 220 ~ let mut d = Device::from_sum(gate_overrides.to_owned(), x, y); [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/day24.rs:280:49 [INFO] [stdout] | [INFO] [stdout] 280 | fn get_potential_swaps(device: &Device, shifts: &Vec, tainted_inputs: &Vec) -> Vec<(Gate, Gate)> { [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] 280 - fn get_potential_swaps(device: &Device, shifts: &Vec, tainted_inputs: &Vec) -> Vec<(Gate, Gate)> { [INFO] [stdout] 280 + fn get_potential_swaps(device: &Device, shifts: &[isize], tainted_inputs: &Vec) -> Vec<(Gate, Gate)> { [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/day24.rs:280:78 [INFO] [stdout] | [INFO] [stdout] 280 | fn get_potential_swaps(device: &Device, shifts: &Vec, tainted_inputs: &Vec) -> Vec<(Gate, Gate)> { [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] 280 ~ fn get_potential_swaps(device: &Device, shifts: &Vec, tainted_inputs: &[String]) -> Vec<(Gate, Gate)> { [INFO] [stdout] 281 | let mut total_fails = 0; [INFO] [stdout] ... [INFO] [stdout] 340 | [INFO] [stdout] 341 ~ let mut tainted = tainted_inputs.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day24.rs:343:11 [INFO] [stdout] | [INFO] [stdout] 343 | while tainted.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!tainted.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 `if` statement can be collapsed [INFO] [stdout] --> src/day24.rs:347:17 [INFO] [stdout] | [INFO] [stdout] 347 | / if g.input1 == *tainted_input || g.input2 == *tainted_input { [INFO] [stdout] 348 | | if maybe_corrupt.insert(g.clone()) { [INFO] [stdout] 349 | | new_tainted.push(g.output.clone()); [INFO] [stdout] 350 | | } [INFO] [stdout] 351 | | } [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] 347 ~ if (g.input1 == *tainted_input || g.input2 == *tainted_input) { [INFO] [stdout] 348 ~ && maybe_corrupt.insert(g.clone()) { [INFO] [stdout] 349 | new_tainted.push(g.output.clone()); [INFO] [stdout] 350 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day24.rs:352:17 [INFO] [stdout] | [INFO] [stdout] 352 | / if g.output == *tainted_input { [INFO] [stdout] 353 | | if maybe_corrupt.insert(g.clone()) { [INFO] [stdout] 354 | | if !g.input1.starts_with("x") && !g.input1.starts_with("y") { [INFO] [stdout] 355 | | new_tainted.push(g.input1.clone()); [INFO] [stdout] ... | [INFO] [stdout] 361 | | } [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] 352 ~ if g.output == *tainted_input [INFO] [stdout] 353 ~ && maybe_corrupt.insert(g.clone()) { [INFO] [stdout] 354 | if !g.input1.starts_with("x") && !g.input1.starts_with("y") { [INFO] [stdout] ... [INFO] [stdout] 359 | } [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `potential_swaps` [INFO] [stdout] --> src/day24.rs:383:14 [INFO] [stdout] | [INFO] [stdout] 383 | for i in 0..potential_swaps.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] 383 - for i in 0..potential_swaps.len() { [INFO] [stdout] 383 + for in &potential_swaps { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day24.rs:456:24 [INFO] [stdout] | [INFO] [stdout] 456 | let device = parse(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day24.rs:511:12 [INFO] [stdout] | [INFO] [stdout] 511 | if ps.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `ps.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 assertion is always `false` [INFO] [stdout] --> src/day24.rs:601:9 [INFO] [stdout] | [INFO] [stdout] 601 | assert!(false, "todo") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` 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/day25.rs:24:41 [INFO] [stdout] | [INFO] [stdout] 24 | fn combine_heights(line: &str, heights: &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] 24 - fn combine_heights(line: &str, heights: &mut Vec) { [INFO] [stdout] 24 + fn combine_heights(line: &str, heights: &mut [isize]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day25.rs:34:17 [INFO] [stdout] | [INFO] [stdout] 34 | fn parse(input: &String) -> (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] help: change this to [INFO] [stdout] | [INFO] [stdout] 34 - fn parse(input: &String) -> (Vec, Vec) { [INFO] [stdout] 34 + fn parse(input: &str) -> (Vec, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day25.rs:45:20 [INFO] [stdout] | [INFO] [stdout] 45 | if l == "" { [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day25.rs:54:20 [INFO] [stdout] | [INFO] [stdout] 54 | if l == "" { [INFO] [stdout] | ^^^^^^^ help: using `is_empty` is clearer and more explicit: `l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day25.rs:92:31 [INFO] [stdout] | [INFO] [stdout] 92 | let (keys, locks) = parse(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day25.rs:119:26 [INFO] [stdout] | [INFO] [stdout] 119 | pub fn _solution2(input: &String) -> 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] 119 - pub fn _solution2(input: &String) -> usize { [INFO] [stdout] 119 + pub fn _solution2(input: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/day25.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | assert!(false, "todo") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day16.rs:547:35 [INFO] [stdout] | [INFO] [stdout] 547 | let target_deer = vec![ [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 548 | | mv.dest_deer.clone(), [INFO] [stdout] 549 | | mv.dest_deer.turn_left(), [INFO] [stdout] 550 | | mv.dest_deer.turn_left().turn_left(), [INFO] [stdout] 551 | | mv.dest_deer.turn_right(), [INFO] [stdout] 552 | | ]; [INFO] [stdout] | |_________________^ [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] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 547 ~ let target_deer = [mv.dest_deer.clone(), [INFO] [stdout] 548 + mv.dest_deer.turn_left(), [INFO] [stdout] 549 + mv.dest_deer.turn_left().turn_left(), [INFO] [stdout] 550 ~ mv.dest_deer.turn_right()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day18.rs:71:18 [INFO] [stdout] | [INFO] [stdout] 71 | let deltas = vec![ [INFO] [stdout] | __________________^ [INFO] [stdout] 72 | | (0, 1), [INFO] [stdout] 73 | | (0, -1), [INFO] [stdout] 74 | | (1, 0), [INFO] [stdout] 75 | | (-1, 0), [INFO] [stdout] 76 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 71 ~ let deltas = [(0, 1), [INFO] [stdout] 72 + (0, -1), [INFO] [stdout] 73 + (1, 0), [INFO] [stdout] 74 ~ (-1, 0)]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day24.rs:459:23 [INFO] [stdout] | [INFO] [stdout] 459 | let test_groups = vec![ [INFO] [stdout] | _______________________^ [INFO] [stdout] 460 | | ( [INFO] [stdout] 461 | | vec![6, 7, 8, 9], [INFO] [stdout] 462 | | vec![ [INFO] [stdout] ... | [INFO] [stdout] 500 | | ), [INFO] [stdout] 501 | | ]; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 459 ~ let test_groups = [( [INFO] [stdout] 460 + vec![6, 7, 8, 9], [INFO] [stdout] 461 + vec![ [INFO] [stdout] 462 + String::from("x07"), String::from("y07"), [INFO] [stdout] 463 + String::from("x08"), String::from("y08"), [INFO] [stdout] 464 + String::from("x09"), String::from("y09"), [INFO] [stdout] 465 + [INFO] [stdout] 466 + String::from("z09") [INFO] [stdout] 467 + ] , [INFO] [stdout] 468 + ), [INFO] [stdout] 469 + ( [INFO] [stdout] 470 + vec![13, 14, 15, 16, 17], [INFO] [stdout] 471 + vec![ [INFO] [stdout] 472 + String::from("x14"), String::from("y14"), [INFO] [stdout] 473 + String::from("x15"), String::from("y15"), [INFO] [stdout] 474 + String::from("x16"), String::from("y16"), [INFO] [stdout] 475 + [INFO] [stdout] 476 + String::from("z15"), String::from("z14"), [INFO] [stdout] 477 + ] , [INFO] [stdout] 478 + ), [INFO] [stdout] 479 + ( [INFO] [stdout] 480 + vec![19, 20, 21, 22, 23, 24], [INFO] [stdout] 481 + vec![ [INFO] [stdout] 482 + String::from("x21"), String::from("y21"), [INFO] [stdout] 483 + String::from("x22"), String::from("y22"), [INFO] [stdout] 484 + [INFO] [stdout] 485 + String::from("z22"), String::from("z23"), [INFO] [stdout] 486 + ] , [INFO] [stdout] 487 + ), [INFO] [stdout] 488 + ( [INFO] [stdout] 489 + vec![28, 29, 30], [INFO] [stdout] 490 + vec![ [INFO] [stdout] 491 + String::from("x30"), String::from("y30"), [INFO] [stdout] 492 + String::from("x29"), String::from("y29"), [INFO] [stdout] 493 + String::from("x28"), String::from("y28"), [INFO] [stdout] 494 + [INFO] [stdout] 495 + String::from("z29"), String::from("z30"), [INFO] [stdout] 496 + String::from("z28") [INFO] [stdout] 497 + [INFO] [stdout] 498 + ], [INFO] [stdout] 499 ~ )]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/day24.rs:560:37 [INFO] [stdout] | [INFO] [stdout] 560 | let mut v = vec![ [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 561 | | swapped_gates[*s1_g1_idx].output.clone(), [INFO] [stdout] 562 | | swapped_gates[*s1_g2_idx].output.clone(), [INFO] [stdout] 563 | | swapped_gates[*s2_g1_idx].output.clone(), [INFO] [stdout] ... | [INFO] [stdout] 568 | | swapped_gates[*s4_g2_idx].output.clone(), [INFO] [stdout] 569 | | ]; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 560 ~ let mut v = [swapped_gates[*s1_g1_idx].output.clone(), [INFO] [stdout] 561 + swapped_gates[*s1_g2_idx].output.clone(), [INFO] [stdout] 562 + swapped_gates[*s2_g1_idx].output.clone(), [INFO] [stdout] 563 + swapped_gates[*s2_g2_idx].output.clone(), [INFO] [stdout] 564 + swapped_gates[*s3_g1_idx].output.clone(), [INFO] [stdout] 565 + swapped_gates[*s3_g2_idx].output.clone(), [INFO] [stdout] 566 + swapped_gates[*s4_g1_idx].output.clone(), [INFO] [stdout] 567 ~ swapped_gates[*s4_g2_idx].output.clone()]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/day5.rs:51:17 [INFO] [stdout] | [INFO] [stdout] 51 | pub fn iter(&self) -> Iter> { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 51 | pub fn iter(&self) -> Iter<'_, Rc> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/day5.rs:134:17 [INFO] [stdout] | [INFO] [stdout] 134 | pub fn iter(&self) -> Iter { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 134 | pub fn iter(&self) -> Iter<'_, Update> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 11.95s [INFO] running `Command { std: "docker" "inspect" "3e057070d45523bcc941ed828e8954efa06a667fc661edf6982eb60895ccdf51", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3e057070d45523bcc941ed828e8954efa06a667fc661edf6982eb60895ccdf51", kill_on_drop: false }` [INFO] [stdout] 3e057070d45523bcc941ed828e8954efa06a667fc661edf6982eb60895ccdf51