[INFO] cloning repository https://github.com/wjorda/advent-of-code-20 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/wjorda/advent-of-code-20" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fwjorda%2Fadvent-of-code-20", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fwjorda%2Fadvent-of-code-20'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 677a81a5c4977ce78e0ac28a900f389c79d203dc [INFO] linting wjorda/advent-of-code-20 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fwjorda%2Fadvent-of-code-20" "/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/wjorda/advent-of-code-20 [INFO] finished tweaking git repo https://github.com/wjorda/advent-of-code-20 [INFO] tweaked toml for git repo https://github.com/wjorda/advent-of-code-20 written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/wjorda/advent-of-code-20 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/wjorda/advent-of-code-20 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] d7b46d66112e202651e9a017ed8e36f380e6ab2d110c21ce37f6c3f1d0dc46ff [INFO] running `Command { std: "docker" "start" "-a" "d7b46d66112e202651e9a017ed8e36f380e6ab2d110c21ce37f6c3f1d0dc46ff", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "d7b46d66112e202651e9a017ed8e36f380e6ab2d110c21ce37f6c3f1d0dc46ff", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d7b46d66112e202651e9a017ed8e36f380e6ab2d110c21ce37f6c3f1d0dc46ff", kill_on_drop: false }` [INFO] [stdout] d7b46d66112e202651e9a017ed8e36f380e6ab2d110c21ce37f6c3f1d0dc46ff [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] 4e3af17fc890ae17b1dd1939fe7e7cd06e1d825bd982506d1247ba03f7363bb3 [INFO] running `Command { std: "docker" "start" "-a" "4e3af17fc890ae17b1dd1939fe7e7cd06e1d825bd982506d1247ba03f7363bb3", kill_on_drop: false }` [INFO] [stderr] Compiling memchr v2.3.4 [INFO] [stderr] Checking regex-syntax v0.6.21 [INFO] [stderr] Checking thread_local v1.0.1 [INFO] [stderr] Checking itertools v0.9.0 [INFO] [stderr] Checking aho-corasick v0.7.15 [INFO] [stderr] Checking regex v1.4.2 [INFO] [stderr] Checking adventofcode20 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: you should consider adding a `Default` implementation for `IndexMap` [INFO] [stdout] --> src/lib.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn new() -> IndexMap { [INFO] [stdout] 21 | | IndexMap { index: 0, map: HashMap::new() } [INFO] [stdout] 22 | | } [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] 11 + impl Default for IndexMap [INFO] [stdout] 12 + where [INFO] [stdout] 13 + T: std::cmp::Eq + std::hash::Hash [INFO] [stdout] 14 + { [INFO] [stdout] 15 + fn default() -> Self { [INFO] [stdout] 16 + Self::new() [INFO] [stdout] 17 + } [INFO] [stdout] 18 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `IndexMap` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/lib.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/lib.rs:48:10 [INFO] [stdout] | [INFO] [stdout] 48 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/lib.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 47 | rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `IndexMap` [INFO] [stdout] --> src/lib.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | / pub fn new() -> IndexMap { [INFO] [stdout] 21 | | IndexMap { index: 0, map: HashMap::new() } [INFO] [stdout] 22 | | } [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] 11 + impl Default for IndexMap [INFO] [stdout] 12 + where [INFO] [stdout] 13 + T: std::cmp::Eq + std::hash::Hash [INFO] [stdout] 14 + { [INFO] [stdout] 15 + fn default() -> Self { [INFO] [stdout] 16 + Self::new() [INFO] [stdout] 17 + } [INFO] [stdout] 18 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `IndexMap` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/lib.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/lib.rs:48:10 [INFO] [stdout] | [INFO] [stdout] 48 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/lib.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 47 | rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs::File` [INFO] [stdout] --> src/day16.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::fs::File; [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: `BufReader` [INFO] [stdout] --> src/day16.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{BufReader, BufRead}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Range` [INFO] [stdout] --> src/day16.rs:3:16 [INFO] [stdout] | [INFO] [stdout] 3 | use std::ops::{Range, RangeInclusive}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day9.rs:26:10 [INFO] [stdout] | [INFO] [stdout] 26 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day9.rs:25:17 [INFO] [stdout] | [INFO] [stdout] 25 | let input = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/day13.rs:20:28 [INFO] [stdout] | [INFO] [stdout] 20 | let bus = buses.iter().filter(|o| o.is_some()) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 21 | | .map(|o| o.unwrap()) [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `BufRead` [INFO] [stdout] --> src/day16.rs:2:26 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{BufReader, BufRead}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day3.rs:10:10 [INFO] [stdout] | [INFO] [stdout] 10 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day3.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` 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/day3.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | fn check_slope(input: &Vec, slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn check_slope(input: &Vec, slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] 14 + fn check_slope(input: &[String], slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day16.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | let mut other_tickets = sections.next().map(|s| [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day16.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | let mut p1: (Int, Vec<&Ticket>) = other_tickets.iter() [INFO] [stdout] | ----^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day16.rs:101:22 [INFO] [stdout] | [INFO] [stdout] 101 | let column = gs[rule_id].iter().next().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*gs[rule_id].iter().next().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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:124:28 [INFO] [stdout] | [INFO] [stdout] 124 | let p2 = your_ticket.0[mapping["departure location"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure location"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:125:28 [INFO] [stdout] | [INFO] [stdout] 125 | your_ticket.0[mapping["departure station"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure station"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day7.rs:78:21 [INFO] [stdout] | [INFO] [stdout] 78 | let n = (&cap[1]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `cap[1]` [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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:126:28 [INFO] [stdout] | [INFO] [stdout] 126 | your_ticket.0[mapping["departure platform"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure platform"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:127:28 [INFO] [stdout] | [INFO] [stdout] 127 | your_ticket.0[mapping["departure track"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure track"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:128:28 [INFO] [stdout] | [INFO] [stdout] 128 | your_ticket.0[mapping["departure date"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure date"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:130:28 [INFO] [stdout] | [INFO] [stdout] 130 | your_ticket.0[mapping["departure time"] as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure time"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day17.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | for generation in 0..6 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day17.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | for generation in 0..6 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/day13.rs:20:28 [INFO] [stdout] | [INFO] [stdout] 20 | let bus = buses.iter().filter(|o| o.is_some()) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 21 | | .map(|o| o.unwrap()) [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NOP` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | NOP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Nop` [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 `ACC` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | ACC, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Acc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `JMP` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | JMP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Jmp` [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 borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day12.rs:57:27 [INFO] [stdout] | [INFO] [stdout] 57 | distance: (&l[1..]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `l[1..]` [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: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day8.rs:69:10 [INFO] [stdout] | [INFO] [stdout] 69 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day8.rs:68:42 [INFO] [stdout] | [INFO] [stdout] 68 | let instructions: Vec = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day8.rs:79:22 [INFO] [stdout] | [INFO] [stdout] 79 | amt: (&s[4..s.len()]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `s[4..s.len()]` [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: unused variable: `generation` [INFO] [stdout] --> src/day17.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | for generation in 0..6 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day17.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | for generation in 0..6 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day5.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day5.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | let mut seats = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day3.rs:10:10 [INFO] [stdout] | [INFO] [stdout] 10 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day3.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` 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/day3.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | fn check_slope(input: &Vec, slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn check_slope(input: &Vec, slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] 14 + fn check_slope(input: &[String], slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AddAssign`, `Add`, `Mul`, and `Neg` [INFO] [stdout] --> src/day24.rs:1:16 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::{Add, AddAssign, Neg, Mul}; [INFO] [stdout] | ^^^ ^^^^^^^^^ ^^^ ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp::Ordering` [INFO] [stdout] --> src/day24.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use std::cmp::Ordering; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day7.rs:78:21 [INFO] [stdout] | [INFO] [stdout] 78 | let n = (&cap[1]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `cap[1]` [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: variable `x` is assigned to, but never used [INFO] [stdout] --> src/day19.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | let mut x = 0; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_x` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DOOR_SN` is never used [INFO] [stdout] --> src/day25.rs:16:7 [INFO] [stdout] | [INFO] [stdout] 16 | const DOOR_SN: Int = 7; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `x` is never read [INFO] [stdout] --> src/day19.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | x += 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: fields `key` and `sn` are never read [INFO] [stdout] --> src/day25.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 19 | struct Device { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 20 | key: PublicKey, [INFO] [stdout] | ^^^ [INFO] [stdout] 21 | sn: Int, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `Device` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day19.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day19.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | let mut regexes = create_regexes(&rules); [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day19.rs:98:33 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day19.rs:98:21 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day5.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day5.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | let mut seats = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::iter::FromIterator` [INFO] [stdout] --> src/day20.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::iter::FromIterator; [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: `itertools::Itertools` [INFO] [stdout] --> src/day18.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use itertools::Itertools; [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: `regex::internal::Char` [INFO] [stdout] --> src/day18.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use regex::internal::Char; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `VecDeque` [INFO] [stdout] --> src/day23.rs:1:24 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::{VecDeque, HashMap}; [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 variable: `round` [INFO] [stdout] --> src/day23.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | for round in 0..rounds { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_round` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `ROUNDS` is never used [INFO] [stdout] --> src/day23.rs:5:7 [INFO] [stdout] | [INFO] [stdout] 5 | const ROUNDS: usize = 100; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cup` is never constructed [INFO] [stdout] --> src/day23.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 10 | struct Cup(usize); [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/day21.rs:95:52 [INFO] [stdout] | [INFO] [stdout] 95 | let b = possible_mappings.iter().any(|(k,v)| v.contains(ing)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day23.rs:47:29 [INFO] [stdout] | [INFO] [stdout] 47 | .map(|c| (c as u8 - '0' as u8) as usize).collect::>(); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day23.rs:65:30 [INFO] [stdout] | [INFO] [stdout] 65 | p1.push((cup as u8 + '0' as u8) as char); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/day21.rs:114:60 [INFO] [stdout] | [INFO] [stdout] 114 | while let Some((ag, bag)) = mapping_bags.iter().find(|(k,v)| v.len() == 1) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ag2` [INFO] [stdout] --> src/day21.rs:118:14 [INFO] [stdout] | [INFO] [stdout] 118 | for (ag2, bag) in &mut mapping_bags { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ag2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day1.rs:15:30 [INFO] [stdout] | [INFO] [stdout] 15 | fn find_addends(sorted_nums: &Vec, target: i64) -> Option<(i64, i64)> { [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] 15 - fn find_addends(sorted_nums: &Vec, target: i64) -> Option<(i64, i64)> { [INFO] [stdout] 15 + fn find_addends(sorted_nums: &[i64], target: i64) -> Option<(i64, i64)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `cid` is never read [INFO] [stdout] --> src/day4.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 4 | struct Passport { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 12 | cid: Option [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Passport` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/day21.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | while let Some(t) = tokens.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for t in tokens` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day24.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | for generation in 0..100 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Missing` [INFO] [stdout] --> src/day4.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | / enum PassportError { [INFO] [stdout] 17 | | MissingByr, [INFO] [stdout] 18 | | MissingIyr, [INFO] [stdout] 19 | | MissingEyr, [INFO] [stdout] ... | [INFO] [stdout] 23 | | MissingPid, [INFO] [stdout] 24 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/day14.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | self.data.iter().map(|(_, v)| *v).sum() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.data.values().map(|v| *v)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:55:14 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|s| Recipe::parse(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Recipe::parse` [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: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day21.rs:54:10 [INFO] [stdout] | [INFO] [stdout] 54 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day21.rs:53:19 [INFO] [stdout] | [INFO] [stdout] 53 | let recipes = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | 59 <= height && height <= 76 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(59..=76).contains(&height)` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | 150 <= height && height <= 193 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(150..=193).contains(&height)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day4.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!('0' <= c && c <= '9' || 'a' <= c && c <= 'f')` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('0'..='9').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:76:40 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('a'..='f').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day14.rs:75:10 [INFO] [stdout] | [INFO] [stdout] 75 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day14.rs:74:17 [INFO] [stdout] | [INFO] [stdout] 74 | let instr = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day10.rs:8:10 [INFO] [stdout] | [INFO] [stdout] 8 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day10.rs:7:21 [INFO] [stdout] | [INFO] [stdout] 7 | let mut input = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs::File` [INFO] [stdout] --> src/day16.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::fs::File; [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: `BufReader` [INFO] [stdout] --> src/day16.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{BufReader, BufRead}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Range` [INFO] [stdout] --> src/day16.rs:3:16 [INFO] [stdout] | [INFO] [stdout] 3 | use std::ops::{Range, RangeInclusive}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `game` [INFO] [stdout] --> src/day22.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let game = *count; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_game` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `round` is assigned to, but never used [INFO] [stdout] --> src/day22.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | let mut round = 0usize; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_round` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `round` is never read [INFO] [stdout] --> src/day22.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | round += 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: unused import: `itertools::Itertools` [INFO] [stdout] --> src/day18.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use itertools::Itertools; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `regex::internal::Char` [INFO] [stdout] --> src/day18.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use regex::internal::Char; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `player_winner` [INFO] [stdout] --> src/day22.rs:113:10 [INFO] [stdout] | [INFO] [stdout] 113 | let (player_winner, score) = recursive_combat(player1p2, player2p2, &mut 0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_player_winner` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day22.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | return (!player1.is_empty(), hand_score(winner)); [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] 73 - return (!player1.is_empty(), hand_score(winner)); [INFO] [stdout] 73 + (!player1.is_empty(), hand_score(winner)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `edge` [INFO] [stdout] --> src/day20.rs:188:31 [INFO] [stdout] | [INFO] [stdout] 188 | .map(|(i, edge)| i)?; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_edge` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/day20.rs:187:29 [INFO] [stdout] | [INFO] [stdout] 187 | .find(|(i, edge)| edge_matches(**edge, north, &edge_counts)) [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::iter::FromIterator` [INFO] [stdout] --> src/day20.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::iter::FromIterator; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Hex` which implements the `Copy` trait [INFO] [stdout] --> src/day24.rs:78:32 [INFO] [stdout] | [INFO] [stdout] 78 | if !black_tiles.insert(hex.clone()) { [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `hex` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `image` [INFO] [stdout] --> src/day20.rs:88:14 [INFO] [stdout] | [INFO] [stdout] 88 | for i in 0..len { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 88 - for i in 0..len { [INFO] [stdout] 88 + for (i, ) in image.iter().enumerate().take(len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `VecDeque` [INFO] [stdout] --> src/day23.rs:1:24 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::{VecDeque, HashMap}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AddAssign`, `Add`, `Mul`, and `Neg` [INFO] [stdout] --> src/day24.rs:1:16 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::{Add, AddAssign, Neg, Mul}; [INFO] [stdout] | ^^^ ^^^^^^^^^ ^^^ ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp::Ordering` [INFO] [stdout] --> src/day24.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use std::cmp::Ordering; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day20.rs:162:22 [INFO] [stdout] | [INFO] [stdout] 162 | let mut unused = tiles.keys().map(|k| *k).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `tiles.keys().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/day20.rs:166:13 [INFO] [stdout] | [INFO] [stdout] 166 | / if let Some(tile) = grid[r - 1][c].as_ref() { [INFO] [stdout] 167 | | Some(tile.edges[EDGE_S]) [INFO] [stdout] 168 | | } else { [INFO] [stdout] 169 | | None [INFO] [stdout] 170 | | } [INFO] [stdout] | |_____________^ help: try: `grid[r - 1][c].as_ref().map(|tile| tile.edges[EDGE_S])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/day20.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Some(tile) = grid[r][c - 1].as_ref() { [INFO] [stdout] 175 | | Some(tile.edges[EDGE_E]) [INFO] [stdout] 176 | | } else { [INFO] [stdout] 177 | | None [INFO] [stdout] 178 | | } [INFO] [stdout] | |_____________^ help: try: `grid[r][c - 1].as_ref().map(|tile| tile.edges[EDGE_E])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NOP` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | NOP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Nop` [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 `ACC` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | ACC, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Acc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `JMP` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | JMP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Jmp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0).unwrap().get(0)` [INFO] [stdout] --> src/day20.rs:204:14 [INFO] [stdout] | [INFO] [stdout] 204 | let nw = grid.get(0).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `grid.get(0).unwrap().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0)` [INFO] [stdout] --> src/day20.rs:204:14 [INFO] [stdout] | [INFO] [stdout] 204 | let nw = grid.get(0).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `grid.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0)` [INFO] [stdout] --> src/day20.rs:205:14 [INFO] [stdout] | [INFO] [stdout] 205 | let ne = grid.get(0).unwrap().get(FIELDWIDTH - 1).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `grid.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(FIELDWIDTH - 1).unwrap().get(0)` [INFO] [stdout] --> src/day20.rs:206:14 [INFO] [stdout] | [INFO] [stdout] 206 | let sw = grid.get(FIELDWIDTH - 1).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `grid.get(FIELDWIDTH - 1).unwrap().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AddAssign`, `Add`, `Mul`, and `Neg` [INFO] [stdout] --> src/day24.rs:1:16 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::{Add, AddAssign, Neg, Mul}; [INFO] [stdout] | ^^^ ^^^^^^^^^ ^^^ ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp::Ordering` [INFO] [stdout] --> src/day24.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use std::cmp::Ordering; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day24.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | for generation in 0..100 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day8.rs:69:10 [INFO] [stdout] | [INFO] [stdout] 69 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day8.rs:68:42 [INFO] [stdout] | [INFO] [stdout] 68 | let instructions: Vec = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day8.rs:79:22 [INFO] [stdout] | [INFO] [stdout] 79 | amt: (&s[4..s.len()]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `s[4..s.len()]` [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: using `clone` on type `Hex` which implements the `Copy` trait [INFO] [stdout] --> src/day24.rs:78:32 [INFO] [stdout] | [INFO] [stdout] 78 | if !black_tiles.insert(hex.clone()) { [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `hex` [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: variable does not need to be mutable [INFO] [stdout] --> src/day18.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 150 | let mut sol: (Int, Int) = rdr.lines() [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `game` [INFO] [stdout] --> src/day22.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let game = *count; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_game` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `round` is assigned to, but never used [INFO] [stdout] --> src/day22.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | let mut round = 0usize; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_round` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `round` is never read [INFO] [stdout] --> src/day22.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | round += 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: unused variable: `player_winner` [INFO] [stdout] --> src/day22.rs:113:10 [INFO] [stdout] | [INFO] [stdout] 113 | let (player_winner, score) = recursive_combat(player1p2, player2p2, &mut 0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_player_winner` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day22.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | return (!player1.is_empty(), hand_score(winner)); [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] 73 - return (!player1.is_empty(), hand_score(winner)); [INFO] [stdout] 73 + (!player1.is_empty(), hand_score(winner)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs::File` [INFO] [stdout] --> src/day16.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::fs::File; [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: `BufReader` [INFO] [stdout] --> src/day16.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{BufReader, BufRead}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Range` [INFO] [stdout] --> src/day16.rs:3:16 [INFO] [stdout] | [INFO] [stdout] 3 | use std::ops::{Range, RangeInclusive}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day18.rs:151:10 [INFO] [stdout] | [INFO] [stdout] 151 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day18.rs:150:31 [INFO] [stdout] | [INFO] [stdout] 150 | let mut sol: (Int, Int) = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `x` is assigned to, but never used [INFO] [stdout] --> src/day19.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | let mut x = 0; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_x` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `x` is never read [INFO] [stdout] --> src/day19.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | x += 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: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day9.rs:26:10 [INFO] [stdout] | [INFO] [stdout] 26 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day9.rs:25:17 [INFO] [stdout] | [INFO] [stdout] 25 | let input = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `BufRead` [INFO] [stdout] --> src/day16.rs:2:26 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{BufReader, BufRead}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day10.rs:8:10 [INFO] [stdout] | [INFO] [stdout] 8 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day10.rs:7:21 [INFO] [stdout] | [INFO] [stdout] 7 | let mut input = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day19.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day16.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | let mut other_tickets = sections.next().map(|s| [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day16.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | let mut p1: (Int, Vec<&Ticket>) = other_tickets.iter() [INFO] [stdout] | ----^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day16.rs:101:22 [INFO] [stdout] | [INFO] [stdout] 101 | let column = gs[rule_id].iter().next().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*gs[rule_id].iter().next().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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:124:28 [INFO] [stdout] | [INFO] [stdout] 124 | let p2 = your_ticket.0[mapping["departure location"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure location"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:125:28 [INFO] [stdout] | [INFO] [stdout] 125 | your_ticket.0[mapping["departure station"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure station"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day19.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | let mut regexes = create_regexes(&rules); [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:126:28 [INFO] [stdout] | [INFO] [stdout] 126 | your_ticket.0[mapping["departure platform"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure platform"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:127:28 [INFO] [stdout] | [INFO] [stdout] 127 | your_ticket.0[mapping["departure track"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure track"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:128:28 [INFO] [stdout] | [INFO] [stdout] 128 | your_ticket.0[mapping["departure date"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure date"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:130:28 [INFO] [stdout] | [INFO] [stdout] 130 | your_ticket.0[mapping["departure time"] as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure time"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::iter::FromIterator` [INFO] [stdout] --> src/day20.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::iter::FromIterator; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day19.rs:98:33 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day19.rs:98:21 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `cid` is never read [INFO] [stdout] --> src/day4.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 4 | struct Passport { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 12 | cid: Option [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Passport` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Missing` [INFO] [stdout] --> src/day4.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | / enum PassportError { [INFO] [stdout] 17 | | MissingByr, [INFO] [stdout] 18 | | MissingIyr, [INFO] [stdout] 19 | | MissingEyr, [INFO] [stdout] ... | [INFO] [stdout] 23 | | MissingPid, [INFO] [stdout] 24 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | 59 <= height && height <= 76 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(59..=76).contains(&height)` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | 150 <= height && height <= 193 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(150..=193).contains(&height)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day4.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!('0' <= c && c <= '9' || 'a' <= c && c <= 'f')` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('0'..='9').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:76:40 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('a'..='f').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `itertools::Itertools` [INFO] [stdout] --> src/day18.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use itertools::Itertools; [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: `regex::internal::Char` [INFO] [stdout] --> src/day18.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use regex::internal::Char; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `n_empty` is assigned to, but never used [INFO] [stdout] --> src/day11.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | let mut n_empty = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_n_empty` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `n_empty` is never read [INFO] [stdout] --> src/day11.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | n_empty += 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: variable does not need to be mutable [INFO] [stdout] --> src/day18.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 150 | let mut sol: (Int, Int) = rdr.lines() [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day18.rs:151:10 [INFO] [stdout] | [INFO] [stdout] 151 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day18.rs:150:31 [INFO] [stdout] | [INFO] [stdout] 150 | let mut sol: (Int, Int) = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/day14.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | self.data.iter().map(|(_, v)| *v).sum() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.data.values().map(|v| *v)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day14.rs:75:10 [INFO] [stdout] | [INFO] [stdout] 75 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day14.rs:74:17 [INFO] [stdout] | [INFO] [stdout] 74 | let instr = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `n_empty` is assigned to, but never used [INFO] [stdout] --> src/day11.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | let mut n_empty = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_n_empty` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `n_empty` is never read [INFO] [stdout] --> src/day11.rs:163:21 [INFO] [stdout] | [INFO] [stdout] 163 | n_empty += 1 [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EMPTY` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | EMPTY, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Empty` [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 `FILLED` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | FILLED, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Filled` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `FLOOR` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | FLOOR, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Floor` [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: redundant guard [INFO] [stdout] --> src/day11.rs:47:45 [INFO] [stdout] | [INFO] [stdout] 47 | (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] = note: `#[warn(clippy::redundant_guards)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 - (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] 47 + (SeatState::EMPTY, 0) => FILLED, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `VecDeque` [INFO] [stdout] --> src/day23.rs:1:24 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::{VecDeque, HashMap}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `minesweeper_arena` [INFO] [stdout] --> src/day11.rs:85:18 [INFO] [stdout] | [INFO] [stdout] 85 | for i in 0..arena_size { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 85 - for i in 0..arena_size { [INFO] [stdout] 85 + for (i, ) in minesweeper_arena.iter_mut().enumerate().take(arena_size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant guard [INFO] [stdout] --> src/day11.rs:150:45 [INFO] [stdout] | [INFO] [stdout] 150 | (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 - (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] 150 + (SeatState::EMPTY, 0) => FILLED, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `edge` [INFO] [stdout] --> src/day20.rs:188:31 [INFO] [stdout] | [INFO] [stdout] 188 | .map(|(i, edge)| i)?; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_edge` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/day20.rs:187:29 [INFO] [stdout] | [INFO] [stdout] 187 | .find(|(i, edge)| edge_matches(**edge, north, &edge_counts)) [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `image` [INFO] [stdout] --> src/day20.rs:88:14 [INFO] [stdout] | [INFO] [stdout] 88 | for i in 0..len { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 88 - for i in 0..len { [INFO] [stdout] 88 + for (i, ) in image.iter().enumerate().take(len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DOOR_SN` is never used [INFO] [stdout] --> src/day25.rs:16:7 [INFO] [stdout] | [INFO] [stdout] 16 | const DOOR_SN: Int = 7; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `key` and `sn` are never read [INFO] [stdout] --> src/day25.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 19 | struct Device { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 20 | key: PublicKey, [INFO] [stdout] | ^^^ [INFO] [stdout] 21 | sn: Int, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `Device` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day20.rs:162:22 [INFO] [stdout] | [INFO] [stdout] 162 | let mut unused = tiles.keys().map(|k| *k).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `tiles.keys().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/day20.rs:166:13 [INFO] [stdout] | [INFO] [stdout] 166 | / if let Some(tile) = grid[r - 1][c].as_ref() { [INFO] [stdout] 167 | | Some(tile.edges[EDGE_S]) [INFO] [stdout] 168 | | } else { [INFO] [stdout] 169 | | None [INFO] [stdout] 170 | | } [INFO] [stdout] | |_____________^ help: try: `grid[r - 1][c].as_ref().map(|tile| tile.edges[EDGE_S])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/day20.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Some(tile) = grid[r][c - 1].as_ref() { [INFO] [stdout] 175 | | Some(tile.edges[EDGE_E]) [INFO] [stdout] 176 | | } else { [INFO] [stdout] 177 | | None [INFO] [stdout] 178 | | } [INFO] [stdout] | |_____________^ help: try: `grid[r][c - 1].as_ref().map(|tile| tile.edges[EDGE_E])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0).unwrap().get(0)` [INFO] [stdout] --> src/day20.rs:204:14 [INFO] [stdout] | [INFO] [stdout] 204 | let nw = grid.get(0).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `grid.get(0).unwrap().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `round` [INFO] [stdout] --> src/day23.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | for round in 0..rounds { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_round` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0)` [INFO] [stdout] --> src/day20.rs:204:14 [INFO] [stdout] | [INFO] [stdout] 204 | let nw = grid.get(0).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `grid.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0)` [INFO] [stdout] --> src/day20.rs:205:14 [INFO] [stdout] | [INFO] [stdout] 205 | let ne = grid.get(0).unwrap().get(FIELDWIDTH - 1).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `grid.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(FIELDWIDTH - 1).unwrap().get(0)` [INFO] [stdout] --> src/day20.rs:206:14 [INFO] [stdout] | [INFO] [stdout] 206 | let sw = grid.get(FIELDWIDTH - 1).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `grid.get(FIELDWIDTH - 1).unwrap().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `ROUNDS` is never used [INFO] [stdout] --> src/day23.rs:5:7 [INFO] [stdout] | [INFO] [stdout] 5 | const ROUNDS: usize = 100; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cup` is never constructed [INFO] [stdout] --> src/day23.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 10 | struct Cup(usize); [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day23.rs:47:29 [INFO] [stdout] | [INFO] [stdout] 47 | .map(|c| (c as u8 - '0' as u8) as usize).collect::>(); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day12.rs:57:27 [INFO] [stdout] | [INFO] [stdout] 57 | distance: (&l[1..]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `l[1..]` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day23.rs:65:30 [INFO] [stdout] | [INFO] [stdout] 65 | p1.push((cup as u8 + '0' as u8) as char); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day1.rs:15:30 [INFO] [stdout] | [INFO] [stdout] 15 | fn find_addends(sorted_nums: &Vec, target: i64) -> Option<(i64, i64)> { [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] 15 - fn find_addends(sorted_nums: &Vec, target: i64) -> Option<(i64, i64)> { [INFO] [stdout] 15 + fn find_addends(sorted_nums: &[i64], target: i64) -> Option<(i64, i64)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `BufRead` [INFO] [stdout] --> src/day16.rs:2:26 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{BufReader, BufRead}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/day21.rs:95:52 [INFO] [stdout] | [INFO] [stdout] 95 | let b = possible_mappings.iter().any(|(k,v)| v.contains(ing)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/day21.rs:114:60 [INFO] [stdout] | [INFO] [stdout] 114 | while let Some((ag, bag)) = mapping_bags.iter().find(|(k,v)| v.len() == 1) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ag2` [INFO] [stdout] --> src/day21.rs:118:14 [INFO] [stdout] | [INFO] [stdout] 118 | for (ag2, bag) in &mut mapping_bags { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ag2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/day21.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | while let Some(t) = tokens.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for t in tokens` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:55:14 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|s| Recipe::parse(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Recipe::parse` [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: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day21.rs:54:10 [INFO] [stdout] | [INFO] [stdout] 54 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day21.rs:53:19 [INFO] [stdout] | [INFO] [stdout] 53 | let recipes = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs::File` [INFO] [stdout] --> src/day16.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::fs::File; [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: `BufReader` [INFO] [stdout] --> src/day16.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{BufReader, BufRead}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Range` [INFO] [stdout] --> src/day16.rs:3:16 [INFO] [stdout] | [INFO] [stdout] 3 | use std::ops::{Range, RangeInclusive}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `itertools::Itertools` [INFO] [stdout] --> src/day18.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use itertools::Itertools; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `regex::internal::Char` [INFO] [stdout] --> src/day18.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use regex::internal::Char; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::iter::FromIterator` [INFO] [stdout] --> src/day20.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::iter::FromIterator; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `VecDeque` [INFO] [stdout] --> src/day23.rs:1:24 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::{VecDeque, HashMap}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AddAssign`, `Add`, `Mul`, and `Neg` [INFO] [stdout] --> src/day24.rs:1:16 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::{Add, AddAssign, Neg, Mul}; [INFO] [stdout] | ^^^ ^^^^^^^^^ ^^^ ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp::Ordering` [INFO] [stdout] --> src/day24.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use std::cmp::Ordering; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `n_empty` is assigned to, but never used [INFO] [stdout] --> src/day11.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | let mut n_empty = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_n_empty` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `n_empty` is never read [INFO] [stdout] --> src/day11.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | n_empty += 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: variable `n_empty` is assigned to, but never used [INFO] [stdout] --> src/day11.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | let mut n_empty = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_n_empty` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `n_empty` is never read [INFO] [stdout] --> src/day11.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | n_empty += 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: variable `n_empty` is assigned to, but never used [INFO] [stdout] --> src/day11.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | let mut n_empty = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_n_empty` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `n_empty` is never read [INFO] [stdout] --> src/day11.rs:163:21 [INFO] [stdout] | [INFO] [stdout] 163 | n_empty += 1 [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EMPTY` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | EMPTY, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Empty` [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 `FILLED` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | FILLED, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Filled` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `FLOOR` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | FLOOR, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Floor` [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: variable `n_empty` is assigned to, but never used [INFO] [stdout] --> src/day11.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | let mut n_empty = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_n_empty` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `n_empty` is never read [INFO] [stdout] --> src/day11.rs:163:21 [INFO] [stdout] | [INFO] [stdout] 163 | n_empty += 1 [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant guard [INFO] [stdout] --> src/day11.rs:47:45 [INFO] [stdout] | [INFO] [stdout] 47 | (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] = note: `#[warn(clippy::redundant_guards)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 - (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] 47 + (SeatState::EMPTY, 0) => FILLED, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `minesweeper_arena` [INFO] [stdout] --> src/day11.rs:85:18 [INFO] [stdout] | [INFO] [stdout] 85 | for i in 0..arena_size { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 85 - for i in 0..arena_size { [INFO] [stdout] 85 + for (i, ) in minesweeper_arena.iter_mut().enumerate().take(arena_size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant guard [INFO] [stdout] --> src/day11.rs:150:45 [INFO] [stdout] | [INFO] [stdout] 150 | (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 - (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] 150 + (SeatState::EMPTY, 0) => FILLED, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day16.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | let mut other_tickets = sections.next().map(|s| [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day16.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | let mut p1: (Int, Vec<&Ticket>) = other_tickets.iter() [INFO] [stdout] | ----^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day17.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | for generation in 0..6 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day17.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | for generation in 0..6 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day18.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 150 | let mut sol: (Int, Int) = rdr.lines() [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `x` is assigned to, but never used [INFO] [stdout] --> src/day19.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | let mut x = 0; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_x` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `x` is never read [INFO] [stdout] --> src/day19.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | x += 1; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day19.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day19.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | let mut regexes = create_regexes(&rules); [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `edge` [INFO] [stdout] --> src/day20.rs:188:31 [INFO] [stdout] | [INFO] [stdout] 188 | .map(|(i, edge)| i)?; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_edge` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/day20.rs:187:29 [INFO] [stdout] | [INFO] [stdout] 187 | .find(|(i, edge)| edge_matches(**edge, north, &edge_counts)) [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/day21.rs:95:52 [INFO] [stdout] | [INFO] [stdout] 95 | let b = possible_mappings.iter().any(|(k,v)| v.contains(ing)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/day21.rs:114:60 [INFO] [stdout] | [INFO] [stdout] 114 | while let Some((ag, bag)) = mapping_bags.iter().find(|(k,v)| v.len() == 1) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ag2` [INFO] [stdout] --> src/day21.rs:118:14 [INFO] [stdout] | [INFO] [stdout] 118 | for (ag2, bag) in &mut mapping_bags { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ag2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `game` [INFO] [stdout] --> src/day22.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let game = *count; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_game` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `round` is assigned to, but never used [INFO] [stdout] --> src/day22.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | let mut round = 0usize; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_round` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `round` is never read [INFO] [stdout] --> src/day22.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | round += 1; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `player_winner` [INFO] [stdout] --> src/day22.rs:113:10 [INFO] [stdout] | [INFO] [stdout] 113 | let (player_winner, score) = recursive_combat(player1p2, player2p2, &mut 0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_player_winner` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `round` [INFO] [stdout] --> src/day23.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | for round in 0..rounds { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_round` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day24.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | for generation in 0..100 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `cid` is never read [INFO] [stdout] --> src/day4.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 4 | struct Passport { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 12 | cid: Option [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Passport` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `ROUNDS` is never used [INFO] [stdout] --> src/day23.rs:5:7 [INFO] [stdout] | [INFO] [stdout] 5 | const ROUNDS: usize = 100; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cup` is never constructed [INFO] [stdout] --> src/day23.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 10 | struct Cup(usize); [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DOOR_SN` is never used [INFO] [stdout] --> src/day25.rs:16:7 [INFO] [stdout] | [INFO] [stdout] 16 | const DOOR_SN: Int = 7; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `key` and `sn` are never read [INFO] [stdout] --> src/day25.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 19 | struct Device { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 20 | key: PublicKey, [INFO] [stdout] | ^^^ [INFO] [stdout] 21 | sn: Int, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `Device` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day1.rs:15:30 [INFO] [stdout] | [INFO] [stdout] 15 | fn find_addends(sorted_nums: &Vec, target: i64) -> Option<(i64, i64)> { [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] 15 - fn find_addends(sorted_nums: &Vec, target: i64) -> Option<(i64, i64)> { [INFO] [stdout] 15 + fn find_addends(sorted_nums: &[i64], target: i64) -> Option<(i64, i64)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `BufRead` [INFO] [stdout] --> src/day16.rs:2:26 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{BufReader, BufRead}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day3.rs:10:10 [INFO] [stdout] | [INFO] [stdout] 10 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day3.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` 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/day3.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | fn check_slope(input: &Vec, slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn check_slope(input: &Vec, slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] 14 + fn check_slope(input: &[String], slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Missing` [INFO] [stdout] --> src/day4.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | / enum PassportError { [INFO] [stdout] 17 | | MissingByr, [INFO] [stdout] 18 | | MissingIyr, [INFO] [stdout] 19 | | MissingEyr, [INFO] [stdout] ... | [INFO] [stdout] 23 | | MissingPid, [INFO] [stdout] 24 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | 59 <= height && height <= 76 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(59..=76).contains(&height)` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | 150 <= height && height <= 193 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(150..=193).contains(&height)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day4.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!('0' <= c && c <= '9' || 'a' <= c && c <= 'f')` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('0'..='9').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:76:40 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('a'..='f').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day5.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day5.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | let mut seats = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day7.rs:78:21 [INFO] [stdout] | [INFO] [stdout] 78 | let n = (&cap[1]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `cap[1]` [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 `NOP` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | NOP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Nop` [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 `ACC` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | ACC, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Acc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `JMP` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | JMP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Jmp` [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: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day8.rs:69:10 [INFO] [stdout] | [INFO] [stdout] 69 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day8.rs:68:42 [INFO] [stdout] | [INFO] [stdout] 68 | let instructions: Vec = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day8.rs:79:22 [INFO] [stdout] | [INFO] [stdout] 79 | amt: (&s[4..s.len()]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `s[4..s.len()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day9.rs:26:10 [INFO] [stdout] | [INFO] [stdout] 26 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day9.rs:25:17 [INFO] [stdout] | [INFO] [stdout] 25 | let input = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day10.rs:8:10 [INFO] [stdout] | [INFO] [stdout] 8 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day10.rs:7:21 [INFO] [stdout] | [INFO] [stdout] 7 | let mut input = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EMPTY` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | EMPTY, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Empty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `FILLED` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | FILLED, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Filled` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `FLOOR` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | FLOOR, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Floor` [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: redundant guard [INFO] [stdout] --> src/day11.rs:47:45 [INFO] [stdout] | [INFO] [stdout] 47 | (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] = note: `#[warn(clippy::redundant_guards)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 - (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] 47 + (SeatState::EMPTY, 0) => FILLED, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `minesweeper_arena` [INFO] [stdout] --> src/day11.rs:85:18 [INFO] [stdout] | [INFO] [stdout] 85 | for i in 0..arena_size { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 85 - for i in 0..arena_size { [INFO] [stdout] 85 + for (i, ) in minesweeper_arena.iter_mut().enumerate().take(arena_size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `n_empty` is assigned to, but never used [INFO] [stdout] --> src/day11.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | let mut n_empty = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_n_empty` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `n_empty` is never read [INFO] [stdout] --> src/day11.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | n_empty += 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: redundant guard [INFO] [stdout] --> src/day11.rs:150:45 [INFO] [stdout] | [INFO] [stdout] 150 | (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 - (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] 150 + (SeatState::EMPTY, 0) => FILLED, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `n_empty` is assigned to, but never used [INFO] [stdout] --> src/day11.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | let mut n_empty = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_n_empty` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `n_empty` is never read [INFO] [stdout] --> src/day11.rs:163:21 [INFO] [stdout] | [INFO] [stdout] 163 | n_empty += 1 [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day12.rs:57:27 [INFO] [stdout] | [INFO] [stdout] 57 | distance: (&l[1..]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `l[1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/day13.rs:20:28 [INFO] [stdout] | [INFO] [stdout] 20 | let bus = buses.iter().filter(|o| o.is_some()) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 21 | | .map(|o| o.unwrap()) [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/day14.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | self.data.iter().map(|(_, v)| *v).sum() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.data.values().map(|v| *v)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day14.rs:75:10 [INFO] [stdout] | [INFO] [stdout] 75 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day14.rs:74:17 [INFO] [stdout] | [INFO] [stdout] 74 | let instr = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day16.rs:101:22 [INFO] [stdout] | [INFO] [stdout] 101 | let column = gs[rule_id].iter().next().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*gs[rule_id].iter().next().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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:124:28 [INFO] [stdout] | [INFO] [stdout] 124 | let p2 = your_ticket.0[mapping["departure location"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure location"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:125:28 [INFO] [stdout] | [INFO] [stdout] 125 | your_ticket.0[mapping["departure station"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure station"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:126:28 [INFO] [stdout] | [INFO] [stdout] 126 | your_ticket.0[mapping["departure platform"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure platform"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:127:28 [INFO] [stdout] | [INFO] [stdout] 127 | your_ticket.0[mapping["departure track"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure track"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:128:28 [INFO] [stdout] | [INFO] [stdout] 128 | your_ticket.0[mapping["departure date"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure date"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:130:28 [INFO] [stdout] | [INFO] [stdout] 130 | your_ticket.0[mapping["departure time"] as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure time"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day16.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | let mut other_tickets = sections.next().map(|s| [INFO] [stdout] | ----^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day16.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | let mut p1: (Int, Vec<&Ticket>) = other_tickets.iter() [INFO] [stdout] | ----^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day18.rs:151:10 [INFO] [stdout] | [INFO] [stdout] 151 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day18.rs:150:31 [INFO] [stdout] | [INFO] [stdout] 150 | let mut sol: (Int, Int) = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day17.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | for generation in 0..6 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `generation` [INFO] [stdout] --> src/day17.rs:82:9 [INFO] [stdout] | [INFO] [stdout] 82 | for generation in 0..6 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day18.rs:150:9 [INFO] [stdout] | [INFO] [stdout] 150 | let mut sol: (Int, Int) = rdr.lines() [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day19.rs:98:33 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day19.rs:98:21 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `x` is assigned to, but never used [INFO] [stdout] --> src/day19.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | let mut x = 0; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_x` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `x` is never read [INFO] [stdout] --> src/day19.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | x += 1; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day19.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/day19.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | let mut regexes = create_regexes(&rules); [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `image` [INFO] [stdout] --> src/day20.rs:88:14 [INFO] [stdout] | [INFO] [stdout] 88 | for i in 0..len { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 88 - for i in 0..len { [INFO] [stdout] 88 + for (i, ) in image.iter().enumerate().take(len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day20.rs:162:22 [INFO] [stdout] | [INFO] [stdout] 162 | let mut unused = tiles.keys().map(|k| *k).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `tiles.keys().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/day20.rs:166:13 [INFO] [stdout] | [INFO] [stdout] 166 | / if let Some(tile) = grid[r - 1][c].as_ref() { [INFO] [stdout] 167 | | Some(tile.edges[EDGE_S]) [INFO] [stdout] 168 | | } else { [INFO] [stdout] 169 | | None [INFO] [stdout] 170 | | } [INFO] [stdout] | |_____________^ help: try: `grid[r - 1][c].as_ref().map(|tile| tile.edges[EDGE_S])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/day20.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Some(tile) = grid[r][c - 1].as_ref() { [INFO] [stdout] 175 | | Some(tile.edges[EDGE_E]) [INFO] [stdout] 176 | | } else { [INFO] [stdout] 177 | | None [INFO] [stdout] 178 | | } [INFO] [stdout] | |_____________^ help: try: `grid[r][c - 1].as_ref().map(|tile| tile.edges[EDGE_E])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0).unwrap().get(0)` [INFO] [stdout] --> src/day20.rs:204:14 [INFO] [stdout] | [INFO] [stdout] 204 | let nw = grid.get(0).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `grid.get(0).unwrap().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0)` [INFO] [stdout] --> src/day20.rs:204:14 [INFO] [stdout] | [INFO] [stdout] 204 | let nw = grid.get(0).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `grid.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0)` [INFO] [stdout] --> src/day20.rs:205:14 [INFO] [stdout] | [INFO] [stdout] 205 | let ne = grid.get(0).unwrap().get(FIELDWIDTH - 1).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `grid.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(FIELDWIDTH - 1).unwrap().get(0)` [INFO] [stdout] --> src/day20.rs:206:14 [INFO] [stdout] | [INFO] [stdout] 206 | let sw = grid.get(FIELDWIDTH - 1).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `grid.get(FIELDWIDTH - 1).unwrap().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/day21.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | while let Some(t) = tokens.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for t in tokens` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `edge` [INFO] [stdout] --> src/day20.rs:188:31 [INFO] [stdout] | [INFO] [stdout] 188 | .map(|(i, edge)| i)?; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_edge` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/day20.rs:187:29 [INFO] [stdout] | [INFO] [stdout] 187 | .find(|(i, edge)| edge_matches(**edge, north, &edge_counts)) [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:55:14 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|s| Recipe::parse(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Recipe::parse` [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: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day21.rs:54:10 [INFO] [stdout] | [INFO] [stdout] 54 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day21.rs:53:19 [INFO] [stdout] | [INFO] [stdout] 53 | let recipes = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day22.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | return (!player1.is_empty(), hand_score(winner)); [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] 73 - return (!player1.is_empty(), hand_score(winner)); [INFO] [stdout] 73 + (!player1.is_empty(), hand_score(winner)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/day21.rs:95:52 [INFO] [stdout] | [INFO] [stdout] 95 | let b = possible_mappings.iter().any(|(k,v)| v.contains(ing)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/day21.rs:114:60 [INFO] [stdout] | [INFO] [stdout] 114 | while let Some((ag, bag)) = mapping_bags.iter().find(|(k,v)| v.len() == 1) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ag2` [INFO] [stdout] --> src/day21.rs:118:14 [INFO] [stdout] | [INFO] [stdout] 118 | for (ag2, bag) in &mut mapping_bags { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ag2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day23.rs:47:29 [INFO] [stdout] | [INFO] [stdout] 47 | .map(|c| (c as u8 - '0' as u8) as usize).collect::>(); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day23.rs:65:30 [INFO] [stdout] | [INFO] [stdout] 65 | p1.push((cup as u8 + '0' as u8) as char); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `game` [INFO] [stdout] --> src/day22.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let game = *count; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_game` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `round` is assigned to, but never used [INFO] [stdout] --> src/day22.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | let mut round = 0usize; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_round` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `round` is never read [INFO] [stdout] --> src/day22.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | round += 1; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `player_winner` [INFO] [stdout] --> src/day22.rs:113:10 [INFO] [stdout] | [INFO] [stdout] 113 | let (player_winner, score) = recursive_combat(player1p2, player2p2, &mut 0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_player_winner` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `round` [INFO] [stdout] --> src/day23.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | for round in 0..rounds { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_round` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Hex` which implements the `Copy` trait [INFO] [stdout] --> src/day24.rs:78:32 [INFO] [stdout] | [INFO] [stdout] 78 | if !black_tiles.insert(hex.clone()) { [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `hex` [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: unused variable: `generation` [INFO] [stdout] --> src/day24.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | for generation in 0..100 { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_generation` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `cid` is never read [INFO] [stdout] --> src/day4.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 4 | struct Passport { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 12 | cid: Option [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Passport` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `ROUNDS` is never used [INFO] [stdout] --> src/day23.rs:5:7 [INFO] [stdout] | [INFO] [stdout] 5 | const ROUNDS: usize = 100; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cup` is never constructed [INFO] [stdout] --> src/day23.rs:10:8 [INFO] [stdout] | [INFO] [stdout] 10 | struct Cup(usize); [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DOOR_SN` is never used [INFO] [stdout] --> src/day25.rs:16:7 [INFO] [stdout] | [INFO] [stdout] 16 | const DOOR_SN: Int = 7; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `key` and `sn` are never read [INFO] [stdout] --> src/day25.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 19 | struct Device { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 20 | key: PublicKey, [INFO] [stdout] | ^^^ [INFO] [stdout] 21 | sn: Int, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `Device` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day1.rs:15:30 [INFO] [stdout] | [INFO] [stdout] 15 | fn find_addends(sorted_nums: &Vec, target: i64) -> Option<(i64, i64)> { [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] 15 - fn find_addends(sorted_nums: &Vec, target: i64) -> Option<(i64, i64)> { [INFO] [stdout] 15 + fn find_addends(sorted_nums: &[i64], target: i64) -> Option<(i64, i64)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day3.rs:10:10 [INFO] [stdout] | [INFO] [stdout] 10 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day3.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] = note: `#[warn(clippy::lines_filter_map_ok)]` 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/day3.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | fn check_slope(input: &Vec, slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn check_slope(input: &Vec, slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] 14 + fn check_slope(input: &[String], slope_x: usize, slope_y: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: all variants have the same prefix: `Missing` [INFO] [stdout] --> src/day4.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | / enum PassportError { [INFO] [stdout] 17 | | MissingByr, [INFO] [stdout] 18 | | MissingIyr, [INFO] [stdout] 19 | | MissingEyr, [INFO] [stdout] ... | [INFO] [stdout] 23 | | MissingPid, [INFO] [stdout] 24 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: remove the prefixes and use full paths to the variants instead of glob imports [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:54:13 [INFO] [stdout] | [INFO] [stdout] 54 | 59 <= height && height <= 76 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(59..=76).contains(&height)` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | 150 <= height && height <= 193 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(150..=193).contains(&height)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day4.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!('0' <= c && c <= '9' || 'a' <= c && c <= 'f')` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('0'..='9').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/day4.rs:76:40 [INFO] [stdout] | [INFO] [stdout] 76 | if !('0' <= c && c <= '9') && !('a' <= c && c <= 'f') { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('a'..='f').contains(&c)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day5.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day5.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | let mut seats = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day7.rs:78:21 [INFO] [stdout] | [INFO] [stdout] 78 | let n = (&cap[1]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `cap[1]` [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 `NOP` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | NOP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Nop` [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 `ACC` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | ACC, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Acc` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `JMP` contains a capitalized acronym [INFO] [stdout] --> src/day8.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | JMP, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Jmp` [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: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day8.rs:69:10 [INFO] [stdout] | [INFO] [stdout] 69 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day8.rs:68:42 [INFO] [stdout] | [INFO] [stdout] 68 | let instructions: Vec = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day8.rs:79:22 [INFO] [stdout] | [INFO] [stdout] 79 | amt: (&s[4..s.len()]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `s[4..s.len()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day9.rs:26:10 [INFO] [stdout] | [INFO] [stdout] 26 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day9.rs:25:17 [INFO] [stdout] | [INFO] [stdout] 25 | let input = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day10.rs:8:10 [INFO] [stdout] | [INFO] [stdout] 8 | .filter_map(|f| f.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day10.rs:7:21 [INFO] [stdout] | [INFO] [stdout] 7 | let mut input = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EMPTY` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | EMPTY, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Empty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `FILLED` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | FILLED, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Filled` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `FLOOR` contains a capitalized acronym [INFO] [stdout] --> src/day11.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | FLOOR, [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Floor` [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: redundant guard [INFO] [stdout] --> src/day11.rs:47:45 [INFO] [stdout] | [INFO] [stdout] 47 | (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] = note: `#[warn(clippy::redundant_guards)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 - (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] 47 + (SeatState::EMPTY, 0) => FILLED, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `minesweeper_arena` [INFO] [stdout] --> src/day11.rs:85:18 [INFO] [stdout] | [INFO] [stdout] 85 | for i in 0..arena_size { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 85 - for i in 0..arena_size { [INFO] [stdout] 85 + for (i, ) in minesweeper_arena.iter_mut().enumerate().take(arena_size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant guard [INFO] [stdout] --> src/day11.rs:150:45 [INFO] [stdout] | [INFO] [stdout] 150 | (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 - (SeatState::EMPTY, surr) if surr == 0 => FILLED, [INFO] [stdout] 150 + (SeatState::EMPTY, 0) => FILLED, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/day12.rs:57:27 [INFO] [stdout] | [INFO] [stdout] 57 | distance: (&l[1..]).parse().unwrap(), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `l[1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/day13.rs:20:28 [INFO] [stdout] | [INFO] [stdout] 20 | let bus = buses.iter().filter(|o| o.is_some()) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 21 | | .map(|o| o.unwrap()) [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/day14.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | self.data.iter().map(|(_, v)| *v).sum() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.data.values().map(|v| *v)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day14.rs:75:10 [INFO] [stdout] | [INFO] [stdout] 75 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day14.rs:74:17 [INFO] [stdout] | [INFO] [stdout] 74 | let instr = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/day16.rs:101:22 [INFO] [stdout] | [INFO] [stdout] 101 | let column = gs[rule_id].iter().next().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*gs[rule_id].iter().next().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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:124:28 [INFO] [stdout] | [INFO] [stdout] 124 | let p2 = your_ticket.0[mapping["departure location"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure location"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:125:28 [INFO] [stdout] | [INFO] [stdout] 125 | your_ticket.0[mapping["departure station"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure station"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:126:28 [INFO] [stdout] | [INFO] [stdout] 126 | your_ticket.0[mapping["departure platform"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure platform"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:127:28 [INFO] [stdout] | [INFO] [stdout] 127 | your_ticket.0[mapping["departure track"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure track"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:128:28 [INFO] [stdout] | [INFO] [stdout] 128 | your_ticket.0[mapping["departure date"] as usize] * [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure date"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/day16.rs:130:28 [INFO] [stdout] | [INFO] [stdout] 130 | your_ticket.0[mapping["departure time"] as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping["departure time"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day18.rs:151:10 [INFO] [stdout] | [INFO] [stdout] 151 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day18.rs:150:31 [INFO] [stdout] | [INFO] [stdout] 150 | let mut sol: (Int, Int) = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day19.rs:98:33 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day19.rs:98:21 [INFO] [stdout] | [INFO] [stdout] 98 | let mut lines = rdr.lines().filter_map(|r| r.ok()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `image` [INFO] [stdout] --> src/day20.rs:88:14 [INFO] [stdout] | [INFO] [stdout] 88 | for i in 0..len { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 88 - for i in 0..len { [INFO] [stdout] 88 + for (i, ) in image.iter().enumerate().take(len) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/day20.rs:162:22 [INFO] [stdout] | [INFO] [stdout] 162 | let mut unused = tiles.keys().map(|k| *k).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `tiles.keys().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/day20.rs:166:13 [INFO] [stdout] | [INFO] [stdout] 166 | / if let Some(tile) = grid[r - 1][c].as_ref() { [INFO] [stdout] 167 | | Some(tile.edges[EDGE_S]) [INFO] [stdout] 168 | | } else { [INFO] [stdout] 169 | | None [INFO] [stdout] 170 | | } [INFO] [stdout] | |_____________^ help: try: `grid[r - 1][c].as_ref().map(|tile| tile.edges[EDGE_S])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/day20.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Some(tile) = grid[r][c - 1].as_ref() { [INFO] [stdout] 175 | | Some(tile.edges[EDGE_E]) [INFO] [stdout] 176 | | } else { [INFO] [stdout] 177 | | None [INFO] [stdout] 178 | | } [INFO] [stdout] | |_____________^ help: try: `grid[r][c - 1].as_ref().map(|tile| tile.edges[EDGE_E])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0).unwrap().get(0)` [INFO] [stdout] --> src/day20.rs:204:14 [INFO] [stdout] | [INFO] [stdout] 204 | let nw = grid.get(0).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `grid.get(0).unwrap().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0)` [INFO] [stdout] --> src/day20.rs:204:14 [INFO] [stdout] | [INFO] [stdout] 204 | let nw = grid.get(0).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `grid.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(0)` [INFO] [stdout] --> src/day20.rs:205:14 [INFO] [stdout] | [INFO] [stdout] 205 | let ne = grid.get(0).unwrap().get(FIELDWIDTH - 1).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `grid.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `grid.get(FIELDWIDTH - 1).unwrap().get(0)` [INFO] [stdout] --> src/day20.rs:206:14 [INFO] [stdout] | [INFO] [stdout] 206 | let sw = grid.get(FIELDWIDTH - 1).unwrap().get(0).unwrap().as_ref().unwrap().id; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `grid.get(FIELDWIDTH - 1).unwrap().first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/day21.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | while let Some(t) = tokens.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for t in tokens` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/day21.rs:55:14 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|s| Recipe::parse(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Recipe::parse` [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: `filter_map()` will run forever if the iterator repeatedly produces an `Err` [INFO] [stdout] --> src/day21.rs:54:10 [INFO] [stdout] | [INFO] [stdout] 54 | .filter_map(|r| r.ok()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `map_while(Result::ok)` [INFO] [stdout] | [INFO] [stdout] note: this expression returning a `std::io::Lines` may produce an infinite number of `Err` in case of a read error [INFO] [stdout] --> src/day21.rs:53:19 [INFO] [stdout] | [INFO] [stdout] 53 | let recipes = rdr.lines() [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day22.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | return (!player1.is_empty(), hand_score(winner)); [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] 73 - return (!player1.is_empty(), hand_score(winner)); [INFO] [stdout] 73 + (!player1.is_empty(), hand_score(winner)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day23.rs:47:29 [INFO] [stdout] | [INFO] [stdout] 47 | .map(|c| (c as u8 - '0' as u8) as usize).collect::>(); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day23.rs:65:30 [INFO] [stdout] | [INFO] [stdout] 65 | p1.push((cup as u8 + '0' as u8) as char); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Hex` which implements the `Copy` trait [INFO] [stdout] --> src/day24.rs:78:32 [INFO] [stdout] | [INFO] [stdout] 78 | if !black_tiles.insert(hex.clone()) { [INFO] [stdout] | ^^^^^^^^^^^ help: try removing the `clone` call: `hex` [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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.47s [INFO] running `Command { std: "docker" "inspect" "4e3af17fc890ae17b1dd1939fe7e7cd06e1d825bd982506d1247ba03f7363bb3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4e3af17fc890ae17b1dd1939fe7e7cd06e1d825bd982506d1247ba03f7363bb3", kill_on_drop: false }` [INFO] [stdout] 4e3af17fc890ae17b1dd1939fe7e7cd06e1d825bd982506d1247ba03f7363bb3