[INFO] cloning repository https://github.com/hwoongkang/advent_of_code_2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/hwoongkang/advent_of_code_2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fhwoongkang%2Fadvent_of_code_2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fhwoongkang%2Fadvent_of_code_2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] d7ea265946ab6011b9e277f466cc13ef39dff599 [INFO] linting hwoongkang/advent_of_code_2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fhwoongkang%2Fadvent_of_code_2024" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/hwoongkang/advent_of_code_2024 [INFO] finished tweaking git repo https://github.com/hwoongkang/advent_of_code_2024 [INFO] tweaked toml for git repo https://github.com/hwoongkang/advent_of_code_2024 written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/hwoongkang/advent_of_code_2024 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/hwoongkang/advent_of_code_2024 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-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 682213b53d6ba81eb82eb27be9df13059b626c97e0e697f3ddc078af28b1086f [INFO] running `Command { std: "docker" "start" "-a" "682213b53d6ba81eb82eb27be9df13059b626c97e0e697f3ddc078af28b1086f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "682213b53d6ba81eb82eb27be9df13059b626c97e0e697f3ddc078af28b1086f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "682213b53d6ba81eb82eb27be9df13059b626c97e0e697f3ddc078af28b1086f", kill_on_drop: false }` [INFO] [stdout] 682213b53d6ba81eb82eb27be9df13059b626c97e0e697f3ddc078af28b1086f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] c3e735cb0429456255fd5374e25b04c18210981bde4e550664a7de73e8f12b7b [INFO] running `Command { std: "docker" "start" "-a" "c3e735cb0429456255fd5374e25b04c18210981bde4e550664a7de73e8f12b7b", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.174 [INFO] [stderr] Compiling zerocopy v0.8.26 [INFO] [stderr] Checking cfg-if v1.0.1 [INFO] [stderr] Checking memchr v2.7.4 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking getrandom v0.3.3 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking rand v0.9.1 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking aoc2024 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/solutions/year2018/day06.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | let mut visited: Vec)>> = vec![vec![(-1, vec![]); my]; mx]; [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: `visited` [INFO] [stdout] --> src/solutions/year2018/day06.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | let mut visited: Vec)>> = vec![vec![(-1, vec![]); my]; mx]; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_visited` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/solutions/year2018/day06.rs:57:25 [INFO] [stdout] | [INFO] [stdout] 57 | while let Some((id, pos, dist)) = queue.pop_front() {} [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `pos` [INFO] [stdout] --> src/solutions/year2018/day06.rs:57:29 [INFO] [stdout] | [INFO] [stdout] 57 | while let Some((id, pos, dist)) = queue.pop_front() {} [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_pos` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dist` [INFO] [stdout] --> src/solutions/year2018/day06.rs:57:34 [INFO] [stdout] | [INFO] [stdout] 57 | while let Some((id, pos, dist)) = queue.pop_front() {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_dist` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/solutions/year2018/day06.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | fn solve_part_2(input: String) -> String { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/solutions/year2019/day23.rs:63:21 [INFO] [stdout] | [INFO] [stdout] 63 | fn solve_part_2(input: String) -> String { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/solutions/year2020/day25.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | for i in 0..loop_size { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/solutions/year2020/day25.rs:52:21 [INFO] [stdout] | [INFO] [stdout] 52 | fn solve_part_2(input: String) -> String { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `0` and `1` are never read [INFO] [stdout] --> src/solutions/year2019/day23.rs:8:15 [INFO] [stdout] | [INFO] [stdout] 8 | struct Packet(i64, i64); [INFO] [stdout] | ------ ^^^ ^^^ [INFO] [stdout] | | [INFO] [stdout] | fields in this struct [INFO] [stdout] | [INFO] [stdout] = help: consider removing these fields [INFO] [stdout] = note: `Packet` has a derived impl for the trait `Clone`, 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: field `packets` is never read [INFO] [stdout] --> src/solutions/year2019/day23.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 10 | struct Network { [INFO] [stdout] | ------- field in this struct [INFO] [stdout] 11 | computers: Vec, [INFO] [stdout] 12 | packets: Vec>, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `solve_part_1_naive` is never used [INFO] [stdout] --> src/solutions/year2024/day09.rs:145:12 [INFO] [stdout] | [INFO] [stdout] 144 | impl Day09 { [INFO] [stdout] | ---------- associated function in this implementation [INFO] [stdout] 145 | pub fn solve_part_1_naive(input: String) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/solutions/year2018/day02.rs:34:27 [INFO] [stdout] | [INFO] [stdout] 34 | let two = checksum.iter().any(|a| *a == 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `checksum.contains(&2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/solutions/year2018/day02.rs:35:29 [INFO] [stdout] | [INFO] [stdout] 35 | let three = checksum.iter().any(|a| *a == 3); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `checksum.contains(&3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:73:22 [INFO] [stdout] | [INFO] [stdout] 73 | for x in x0..x1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 73 - for x in x0..x1 { [INFO] [stdout] 73 + for in grid.iter_mut().take(x1).skip(x0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:74:26 [INFO] [stdout] | [INFO] [stdout] 74 | for y in y0..y1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 74 - for y in y0..y1 { [INFO] [stdout] 74 + for in grid.iter_mut().take(y1).skip(y0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:125:22 [INFO] [stdout] | [INFO] [stdout] 125 | for x in x0..x1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 125 - for x in x0..x1 { [INFO] [stdout] 125 + for in grid.iter_mut().take(x1).skip(x0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:126:26 [INFO] [stdout] | [INFO] [stdout] 126 | for y in y0..y1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 126 - for y in y0..y1 { [INFO] [stdout] 126 + for in grid.iter_mut().take(y1).skip(y0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:141:30 [INFO] [stdout] | [INFO] [stdout] 141 | 'outer: for x in x0..x1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 141 - 'outer: for x in x0..x1 { [INFO] [stdout] 141 + 'outer: for in grid.iter().take(x1).skip(x0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:142:26 [INFO] [stdout] | [INFO] [stdout] 142 | for y in y0..y1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 142 - for y in y0..y1 { [INFO] [stdout] 142 + for in grid.iter().take(y1).skip(y0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2018/day04.rs:26:1 [INFO] [stdout] | [INFO] [stdout] 26 | / impl PartialOrd for DateTime { [INFO] [stdout] 27 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 28 | | match self.year.partial_cmp(&other.year) { [INFO] [stdout] 29 | | Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] ... | [INFO] [stdout] 46 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 27 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 28 - match self.year.partial_cmp(&other.year) { [INFO] [stdout] 29 - Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] 30 - ord => return ord, [INFO] [stdout] 31 - } [INFO] [stdout] 32 - match self.month.partial_cmp(&other.month) { [INFO] [stdout] 33 - Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] 34 - ord => return ord, [INFO] [stdout] 35 - } [INFO] [stdout] 36 - match self.day.partial_cmp(&other.day) { [INFO] [stdout] 37 - Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] 38 - ord => return ord, [INFO] [stdout] 39 - } [INFO] [stdout] 40 - match self.hour.partial_cmp(&other.hour) { [INFO] [stdout] 41 - Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] 42 - ord => return ord, [INFO] [stdout] 43 - } [INFO] [stdout] 44 - self.minute.partial_cmp(&other.minute) [INFO] [stdout] 45 - } [INFO] [stdout] 27 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2018/day04.rs:106:1 [INFO] [stdout] | [INFO] [stdout] 106 | / impl PartialOrd for Log { [INFO] [stdout] 107 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 108 | | self.datetime.partial_cmp(&other.datetime) [INFO] [stdout] 109 | | } [INFO] [stdout] 110 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 107 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 108 - self.datetime.partial_cmp(&other.datetime) [INFO] [stdout] 109 - } [INFO] [stdout] 107 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2018/day04.rs:135:22 [INFO] [stdout] | [INFO] [stdout] 135 | let id = (&s.split_ascii_whitespace().nth(1).unwrap())[1..] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `s.split_ascii_whitespace().nth(1).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/year2019/day01.rs:19:18 [INFO] [stdout] | [INFO] [stdout] 19 | .map(|n| compute_fuel(n)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_fuel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/year2019/day01.rs:38:18 [INFO] [stdout] | [INFO] [stdout] 38 | .map(|n| compute_fuel(n)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_fuel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | if k = 1 then [INFO] [stdout] | ^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] = note: `#[warn(clippy::doc_overindented_list_items)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:8:1 [INFO] [stdout] | [INFO] [stdout] 8 | output(A) [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:9:1 [INFO] [stdout] | [INFO] [stdout] 9 | else [INFO] [stdout] | ^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | // permutations with last element fixed [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | permutations(k - 1, A) [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:12:1 [INFO] [stdout] | [INFO] [stdout] 12 | // permutations with last element swapped out [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | for i := 0; i < k-1; i += 1 do [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:14:1 [INFO] [stdout] | [INFO] [stdout] 14 | if k is even then [INFO] [stdout] | ^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:15:1 [INFO] [stdout] | [INFO] [stdout] 15 | swap(A[i], A[k-1]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | else [INFO] [stdout] | ^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:17:1 [INFO] [stdout] | [INFO] [stdout] 17 | swap(A[0], A[k-1]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:18:1 [INFO] [stdout] | [INFO] [stdout] 18 | end if [INFO] [stdout] | ^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:19:1 [INFO] [stdout] | [INFO] [stdout] 19 | permutations(k - 1, A) [INFO] [stdout] | ^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:20:1 [INFO] [stdout] | [INFO] [stdout] 20 | end for [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | end if [INFO] [stdout] | ^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/solutions/year2019/day07.rs:29:16 [INFO] [stdout] | [INFO] [stdout] 29 | if k % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `k.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/solutions/year2019/day07.rs:75:13 [INFO] [stdout] | [INFO] [stdout] 74 | let output = e.run_until_halt(); [INFO] [stdout] | -------------------------------- unnecessary `let` binding [INFO] [stdout] 75 | output [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 74 ~ [INFO] [stdout] 75 ~ e.run_until_halt() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/solutions/year2019/day10.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | v.sort_by(|a, b| b.0.cmp(&a.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 - v.sort_by(|a, b| b.0.cmp(&a.0)); [INFO] [stdout] 47 + v.sort_by_key(|b| std::cmp::Reverse(b.0)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2019/day10.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 71 | if v[index].1.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `v[index].1.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day11.rs:150:20 [INFO] [stdout] | [INFO] [stdout] 150 | if let Some(_) = robot.tick() { [INFO] [stdout] | -------^^^^^^^--------------- help: try: `if robot.tick().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day12.rs:99:27 [INFO] [stdout] | [INFO] [stdout] 99 | a.gravity(&b); [INFO] [stdout] | ^^ help: change this to: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day12.rs:100:27 [INFO] [stdout] | [INFO] [stdout] 100 | b.gravity(&a); [INFO] [stdout] | ^^ help: change this to: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/year2019/day12.rs:160:8 [INFO] [stdout] | [INFO] [stdout] 160 | if !(a < b) { [INFO] [stdout] | ^^^^^^^^ help: try: `(a >= b)` [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: variant name ends with the enum's name [INFO] [stdout] --> src/solutions/year2019/day13.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | Block, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day13.rs:44:29 [INFO] [stdout] | [INFO] [stdout] 44 | fn print_gameboard(outputs: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - fn print_gameboard(outputs: &Vec) { [INFO] [stdout] 44 + fn print_gameboard(outputs: &[i64]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day13.rs:100:43 [INFO] [stdout] | [INFO] [stdout] 100 | let mut computer = Computer::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/solutions/year2019/day13.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | / loop { [INFO] [stdout] 103 | | match computer.run() { [INFO] [stdout] 104 | | computer::Result::Output(output) => outputs.push(output), [INFO] [stdout] 105 | | _ => break, [INFO] [stdout] 106 | | } [INFO] [stdout] 107 | | } [INFO] [stdout] | |_________^ help: try: `while let computer::Result::Output(output) = computer.run() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day13.rs:120:43 [INFO] [stdout] | [INFO] [stdout] 120 | let mut computer = Computer::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/solutions/year2019/day14.rs:23:19 [INFO] [stdout] | [INFO] [stdout] 23 | let set = (n + (self.bulk - 1)) / self.bulk; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `n.div_ceil(self.bulk)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&new_pos).is_none()` [INFO] [stdout] --> src/solutions/year2019/day15.rs:232:24 [INFO] [stdout] | [INFO] [stdout] 232 | if map.get(&new_pos).is_none() { [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!map.contains_key(&new_pos)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/solutions/year2019/day15.rs:244:27 [INFO] [stdout] | [INFO] [stdout] 244 | let ((x, y), _) = map [INFO] [stdout] | ___________________________^ [INFO] [stdout] 245 | | .iter() [INFO] [stdout] 246 | | .filter(|(_, v)| **v == Tile::Oxygen) [INFO] [stdout] 247 | | .next() [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 244 ~ let ((x, y), _) = map [INFO] [stdout] 245 + .iter().find(|(_, v)| **v == Tile::Oxygen) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/solutions/year2019/day16.rs:8:10 [INFO] [stdout] | [INFO] [stdout] 8 | .map(move |num| vec![*num; i]) [INFO] [stdout] | __________^ [INFO] [stdout] 9 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(move |num| vec![*num; i])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> src/solutions/year2019/day16.rs:80:18 [INFO] [stdout] | [INFO] [stdout] 80 | x2 = (0..8) [INFO] [stdout] | __________________^ [INFO] [stdout] 81 | | .into_iter() [INFO] [stdout] | |____________________________^ help: consider removing `.into_iter()`: `(0..8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day17.rs:7:31 [INFO] [stdout] | [INFO] [stdout] 7 | fn alignment_parameter(input: &String) -> usize { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 7 - fn alignment_parameter(input: &String) -> usize { [INFO] [stdout] 7 + fn alignment_parameter(input: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2019/day17.rs:12:16 [INFO] [stdout] | [INFO] [stdout] 12 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day17.rs:60:31 [INFO] [stdout] | [INFO] [stdout] 60 | fn analytical_solution(input: &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 60 - fn analytical_solution(input: &String) -> String { [INFO] [stdout] 60 + fn analytical_solution(input: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2019/day17.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day17.rs:105:14 [INFO] [stdout] | [INFO] [stdout] 105 | map: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 105 - map: &Vec>, [INFO] [stdout] 105 + map: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:126:51 [INFO] [stdout] | [INFO] [stdout] 126 | if let Some(p) = try_add(pos, left_delta, &map) { [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:133:52 [INFO] [stdout] | [INFO] [stdout] 133 | if let Some(p) = try_add(pos, right_delta, &map) { [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/solutions/year2019/day17.rs:144:9 [INFO] [stdout] | [INFO] [stdout] 144 | / loop { [INFO] [stdout] 145 | | if let Some(next) = try_add(pos, dir.delta(), &map) { [INFO] [stdout] 146 | | let next_tile = map[next.0][next.1]; [INFO] [stdout] 147 | | if next_tile == '#' || next_tile == 'O' { [INFO] [stdout] ... | [INFO] [stdout] 159 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(next) = try_add(pos, dir.delta(), &map) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:145:59 [INFO] [stdout] | [INFO] [stdout] 145 | if let Some(next) = try_add(pos, dir.delta(), &map) { [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/solutions/year2019/day17.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | / loop { [INFO] [stdout] 164 | | let Some(t) = turn(&pos, &mut dir, &map) else { [INFO] [stdout] 165 | | break; [INFO] [stdout] 166 | | }; [INFO] [stdout] 167 | | ans.push(t.to_string()); [INFO] [stdout] 168 | | ans.push(move_forward(&mut pos, &dir, &mut map).to_string()); [INFO] [stdout] 169 | | } [INFO] [stdout] | |_____^ help: try: `while let Some(t) = turn(&pos, &mut dir, &map) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:187:43 [INFO] [stdout] | [INFO] [stdout] 187 | let mut computer = Computer::from(&input.lines().next().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `input.lines().next().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:200:43 [INFO] [stdout] | [INFO] [stdout] 200 | let mut computer = Computer::from(&input.lines().next().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `input.lines().next().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/solutions/year2018/day06.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | let mut visited: Vec)>> = vec![vec![(-1, vec![]); my]; mx]; [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: `visited` [INFO] [stdout] --> src/solutions/year2018/day06.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | let mut visited: Vec)>> = vec![vec![(-1, vec![]); my]; mx]; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_visited` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/solutions/year2018/day06.rs:57:25 [INFO] [stdout] | [INFO] [stdout] 57 | while let Some((id, pos, dist)) = queue.pop_front() {} [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `pos` [INFO] [stdout] --> src/solutions/year2018/day06.rs:57:29 [INFO] [stdout] | [INFO] [stdout] 57 | while let Some((id, pos, dist)) = queue.pop_front() {} [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_pos` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dist` [INFO] [stdout] --> src/solutions/year2018/day06.rs:57:34 [INFO] [stdout] | [INFO] [stdout] 57 | while let Some((id, pos, dist)) = queue.pop_front() {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_dist` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/solutions/year2018/day06.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | fn solve_part_2(input: String) -> String { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day18.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | fn dfs(from: (usize, usize), num_keys: usize, map: &Vec>) -> Vec<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - fn dfs(from: (usize, usize), num_keys: usize, map: &Vec>) -> Vec<(usize, usize)> { [INFO] [stdout] 51 + fn dfs(from: (usize, usize), num_keys: usize, map: &[Vec]) -> Vec<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2019/day18.rs:101:6 [INFO] [stdout] | [INFO] [stdout] 101 | ) -> (Vec<(usize, usize)>, Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/solutions/year2019/day18.rs:103:42 [INFO] [stdout] | [INFO] [stdout] 103 | let mut key_positions = vec![(0, 0); n as usize]; [INFO] [stdout] | ^^^^^^^^^^ help: try: `n` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/solutions/year2019/day18.rs:106:13 [INFO] [stdout] | [INFO] [stdout] 106 | / match tile { [INFO] [stdout] 107 | | Tile::Key(i) => { [INFO] [stdout] 108 | | key_positions[*i] = (r, c); [INFO] [stdout] ... | [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 106 ~ if let Tile::Key(i) = tile { [INFO] [stdout] 107 + key_positions[*i] = (r, c); [INFO] [stdout] 108 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day18.rs:117:39 [INFO] [stdout] | [INFO] [stdout] 117 | let mut adj_row = dfs(key, n, &map); [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day18.rs:122:58 [INFO] [stdout] | [INFO] [stdout] 122 | let mut from_start = dfs(start, key_positions.len(), &map); [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/solutions/year2019/day18.rs:127:32 [INFO] [stdout] | [INFO] [stdout] 127 | for (_r, row) in adj.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 127 - for (_r, row) in adj.iter().enumerate() { [INFO] [stdout] 127 + for row in adj.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/solutions/year2019/day18.rs:136:56 [INFO] [stdout] | [INFO] [stdout] 136 | for (_c, (steps, _required_keys)) in row.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 136 - for (_c, (steps, _required_keys)) in row.iter().enumerate() { [INFO] [stdout] 136 + for (steps, _required_keys) in row.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2019/day18.rs:175:1 [INFO] [stdout] | [INFO] [stdout] 175 | / impl PartialOrd for State1 { [INFO] [stdout] 176 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 177 | | match other.steps.partial_cmp(&self.steps) { [INFO] [stdout] 178 | | Some(std::cmp::Ordering::Equal) => self.num_keys().partial_cmp(&other.num_keys()), [INFO] [stdout] ... | [INFO] [stdout] 182 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 176 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 177 - match other.steps.partial_cmp(&self.steps) { [INFO] [stdout] 178 - Some(std::cmp::Ordering::Equal) => self.num_keys().partial_cmp(&other.num_keys()), [INFO] [stdout] 179 - ord => ord, [INFO] [stdout] 180 - } [INFO] [stdout] 181 - } [INFO] [stdout] 176 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2019/day18.rs:184:1 [INFO] [stdout] | [INFO] [stdout] 184 | / impl PartialOrd for State2 { [INFO] [stdout] 185 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 186 | | match other.steps.partial_cmp(&self.steps) { [INFO] [stdout] 187 | | Some(std::cmp::Ordering::Equal) => self.num_keys().partial_cmp(&other.num_keys()), [INFO] [stdout] ... | [INFO] [stdout] 191 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 185 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 186 - match other.steps.partial_cmp(&self.steps) { [INFO] [stdout] 187 - Some(std::cmp::Ordering::Equal) => self.num_keys().partial_cmp(&other.num_keys()), [INFO] [stdout] 188 - ord => ord, [INFO] [stdout] 189 - } [INFO] [stdout] 190 - } [INFO] [stdout] 185 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `starts` [INFO] [stdout] --> src/solutions/year2019/day18.rs:325:18 [INFO] [stdout] | [INFO] [stdout] 325 | for i in 0..4 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 325 - for i in 0..4 { [INFO] [stdout] 325 + for in &starts { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[usize; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/solutions/year2019/day18.rs:356:42 [INFO] [stdout] | [INFO] [stdout] 356 | let mut new_robots = state.robots.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `state.robots` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[usize; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/solutions/year2019/day18.rs:358:37 [INFO] [stdout] | [INFO] [stdout] 358 | let hash_key = (new_robots.clone(), keys); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_robots` [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: unneeded `return` statement [INFO] [stdout] --> src/solutions/year2019/day19.rs:13:40 [INFO] [stdout] | [INFO] [stdout] 13 | computer::Result::Output(i) => return i == 1, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 13 - computer::Result::Output(i) => return i == 1, [INFO] [stdout] 13 + computer::Result::Output(i) => i == 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day19.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | fn check(input: &String, x: i64, y: i64) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 7 - fn check(input: &String, x: i64, y: i64) -> bool { [INFO] [stdout] 7 + fn check(input: &str, x: i64, y: i64) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2019/day20.rs:14:1 [INFO] [stdout] | [INFO] [stdout] 14 | / impl PartialOrd for State { [INFO] [stdout] 15 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 16 | | match other.dist.partial_cmp(&self.dist) { [INFO] [stdout] 17 | | Some(std::cmp::Ordering::Equal) => other.depth.partial_cmp(&self.depth), [INFO] [stdout] ... | [INFO] [stdout] 21 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 15 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 16 - match other.dist.partial_cmp(&self.dist) { [INFO] [stdout] 17 - Some(std::cmp::Ordering::Equal) => other.depth.partial_cmp(&self.depth), [INFO] [stdout] 18 - ord => ord, [INFO] [stdout] 19 - } [INFO] [stdout] 20 - } [INFO] [stdout] 15 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day20.rs:49:19 [INFO] [stdout] | [INFO] [stdout] 49 | fn print_map(map: &Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 49 - fn print_map(map: &Vec>) { [INFO] [stdout] 49 + fn print_map(map: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2019/day20.rs:104:18 [INFO] [stdout] | [INFO] [stdout] 104 | let mut map: HashMap> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/solutions/year2019/day20.rs:132:39 [INFO] [stdout] | [INFO] [stdout] 132 | let deepens = if ir < 0 || ic < 0 || ir >= imr || ic >= imc { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 133 | | false [INFO] [stdout] 134 | | } else { [INFO] [stdout] 135 | | true [INFO] [stdout] 136 | | }; [INFO] [stdout] | |_________________________^ help: you can reduce it to: `!(ir < 0 || ic < 0 || ir >= imr || ic >= imc)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day20.rs:264:35 [INFO] [stdout] | [INFO] [stdout] 264 | fn dfs(from: (usize, usize), map: &Vec>, num_portals: usize) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 264 - fn dfs(from: (usize, usize), map: &Vec>, num_portals: usize) -> Vec { [INFO] [stdout] 264 + fn dfs(from: (usize, usize), map: &[Vec], num_portals: usize) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day20.rs:310:35 [INFO] [stdout] | [INFO] [stdout] 310 | let row = dfs(p.location, &map, portals.len()); [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/solutions/year2019/day21.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | / outputs [INFO] [stdout] 50 | | .iter() [INFO] [stdout] 51 | | .map(|&n| n) [INFO] [stdout] | |____________________________^ [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] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 49 ~ outputs [INFO] [stdout] 50 + .iter().copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day21.rs:52:34 [INFO] [stdout] | [INFO] [stdout] 52 | .take_while(|&n| match char::from_u32(n as u32) { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 53 | | Some(_) => true, [INFO] [stdout] 54 | | _ => false, [INFO] [stdout] 55 | | }) [INFO] [stdout] | |_________________^ help: try: `char::from_u32(n as u32).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day21.rs:63:33 [INFO] [stdout] | [INFO] [stdout] 63 | .take_while(|n| match char::from_u32(*n as u32) { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 64 | | Some(_) => true, [INFO] [stdout] 65 | | _ => false, [INFO] [stdout] 66 | | }) [INFO] [stdout] | |_________________^ help: try: `char::from_u32(*n as u32).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/solutions/year2019/day21.rs:104:13 [INFO] [stdout] | [INFO] [stdout] 104 | / outputs [INFO] [stdout] 105 | | .iter() [INFO] [stdout] 106 | | .map(|&n| n) [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 104 ~ outputs [INFO] [stdout] 105 + .iter().copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day21.rs:107:34 [INFO] [stdout] | [INFO] [stdout] 107 | .take_while(|&n| match char::from_u32(n as u32) { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 108 | | Some(_) => true, [INFO] [stdout] 109 | | _ => false, [INFO] [stdout] 110 | | }) [INFO] [stdout] | |_________________^ help: try: `char::from_u32(n as u32).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day21.rs:118:33 [INFO] [stdout] | [INFO] [stdout] 118 | .take_while(|n| match char::from_u32(*n as u32) { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 119 | | Some(_) => true, [INFO] [stdout] 120 | | _ => false, [INFO] [stdout] 121 | | }) [INFO] [stdout] | |_________________^ help: try: `char::from_u32(*n as u32).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is used to index `new_seats` [INFO] [stdout] --> src/solutions/year2020/day11.rs:109:18 [INFO] [stdout] | [INFO] [stdout] 109 | for r in 0..mr { [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] 109 - for r in 0..mr { [INFO] [stdout] 109 + for (r, ) in new_seats.iter_mut().enumerate().take(mr) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `new_seats` [INFO] [stdout] --> src/solutions/year2020/day11.rs:110:22 [INFO] [stdout] | [INFO] [stdout] 110 | for c in 0..mc { [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] 110 - for c in 0..mc { [INFO] [stdout] 110 + for (c, ) in new_seats.iter_mut().enumerate().take(mc) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is used to index `new_seats` [INFO] [stdout] --> src/solutions/year2020/day11.rs:182:18 [INFO] [stdout] | [INFO] [stdout] 182 | for r in 0..mr { [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] 182 - for r in 0..mr { [INFO] [stdout] 182 + for (r, ) in new_seats.iter_mut().enumerate().take(mr) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `new_seats` [INFO] [stdout] --> src/solutions/year2020/day11.rs:183:22 [INFO] [stdout] | [INFO] [stdout] 183 | for c in 0..mc { [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] 183 - for c in 0..mc { [INFO] [stdout] 183 + for (c, ) in new_seats.iter_mut().enumerate().take(mc) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day16.rs:62:16 [INFO] [stdout] | [INFO] [stdout] 62 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day16.rs:82:16 [INFO] [stdout] | [INFO] [stdout] 82 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:103:18 [INFO] [stdout] | [INFO] [stdout] 103 | for x in 0..mx { [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] 103 - for x in 0..mx { [INFO] [stdout] 103 + for (x, ) in new_cells.iter_mut().enumerate().take(mx) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:104:22 [INFO] [stdout] | [INFO] [stdout] 104 | for y in 0..my { [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] 104 - for y in 0..my { [INFO] [stdout] 104 + for (y, ) in new_cells.iter_mut().enumerate().take(my) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `z` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:105:26 [INFO] [stdout] | [INFO] [stdout] 105 | for z in 0..mz { [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] 105 - for z in 0..mz { [INFO] [stdout] 105 + for (z, ) in new_cells.iter_mut().enumerate().take(mz) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `w` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:106:30 [INFO] [stdout] | [INFO] [stdout] 106 | for w in 0..mw { [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] 106 - for w in 0..mw { [INFO] [stdout] 106 + for (w, ) in new_cells.iter_mut().enumerate().take(mw) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/year2020/day17.rs:108:54 [INFO] [stdout] | [INFO] [stdout] 108 | if self.cells[x][y][z][w] && (count < 2 || count > 3) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(2..=3).contains(&count)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:219:18 [INFO] [stdout] | [INFO] [stdout] 219 | for x in 0..mx { [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] 219 - for x in 0..mx { [INFO] [stdout] 219 + for (x, ) in new_cells.iter_mut().enumerate().take(mx) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:220:22 [INFO] [stdout] | [INFO] [stdout] 220 | for y in 0..my { [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] 220 - for y in 0..my { [INFO] [stdout] 220 + for (y, ) in new_cells.iter_mut().enumerate().take(my) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `z` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:221:26 [INFO] [stdout] | [INFO] [stdout] 221 | for z in 0..mz { [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] 221 - for z in 0..mz { [INFO] [stdout] 221 + for (z, ) in new_cells.iter_mut().enumerate().take(mz) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/year2020/day17.rs:223:47 [INFO] [stdout] | [INFO] [stdout] 223 | if self.cells[x][y][z] && (count < 2 || count > 3) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(2..=3).contains(&count)` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/solutions/year2020/day18.rs:73:13 [INFO] [stdout] | [INFO] [stdout] 73 | / match token { [INFO] [stdout] 74 | | Token::Digit(d) => value += d, [INFO] [stdout] 75 | | _ => {} [INFO] [stdout] 76 | | } [INFO] [stdout] | |_____________^ help: try: `if let Token::Digit(d) = token { value += d }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day18.rs:114:8 [INFO] [stdout] | [INFO] [stdout] 114 | if nested.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nested.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day18.rs:133:8 [INFO] [stdout] | [INFO] [stdout] 133 | if nested.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nested.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day19.rs:91:12 [INFO] [stdout] | [INFO] [stdout] 91 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is used to index `new_data` [INFO] [stdout] --> src/solutions/year2020/day20.rs:34:18 [INFO] [stdout] | [INFO] [stdout] 34 | for r in 0..mr { [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] 34 - for r in 0..mr { [INFO] [stdout] 34 + for (r, ) in new_data.iter_mut().enumerate().take(mr) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/solutions/year2019/day23.rs:63:21 [INFO] [stdout] | [INFO] [stdout] 63 | fn solve_part_2(input: String) -> String { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/solutions/year2020/day20.rs:336:9 [INFO] [stdout] | [INFO] [stdout] 336 | / if line.is_none() { [INFO] [stdout] 337 | | return None; [INFO] [stdout] 338 | | } [INFO] [stdout] | |_________^ help: replace it with: `line?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `assembled` [INFO] [stdout] --> src/solutions/year2020/day20.rs:476:14 [INFO] [stdout] | [INFO] [stdout] 476 | for r in 0..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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 476 - for r in 0..size { [INFO] [stdout] 476 + for in assembled.iter_mut().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `assembled` [INFO] [stdout] --> src/solutions/year2020/day20.rs:490:14 [INFO] [stdout] | [INFO] [stdout] 490 | for r in 0..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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 490 - for r in 0..size { [INFO] [stdout] 490 + for in assembled.iter().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is only used to index `assembled` [INFO] [stdout] --> src/solutions/year2020/day20.rs:491:18 [INFO] [stdout] | [INFO] [stdout] 491 | for c in 0..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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 491 - for c in 0..size { [INFO] [stdout] 491 + for in assembled.iter().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2020/day21.rs:71:20 [INFO] [stdout] | [INFO] [stdout] 71 | if let Some(_) = ingredient_map.get(ingredient) { [INFO] [stdout] | -------^^^^^^^--------------------------------- help: try: `if ingredient_map.get(ingredient).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `U256` which implements the `Copy` trait [INFO] [stdout] --> src/solutions/year2020/day21.rs:123:28 [INFO] [stdout] | [INFO] [stdout] 123 | let mut code = food.barcode.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `food.barcode` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2020/day22.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | cache: Rc, VecDeque), GameResult>>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day22.rs:24:16 [INFO] [stdout] | [INFO] [stdout] 24 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/solutions/year2020/day22.rs:97:9 [INFO] [stdout] | [INFO] [stdout] 97 | / if let Some(result) = self.check_ended() { [INFO] [stdout] 98 | | Some(result) [INFO] [stdout] 99 | | } else { [INFO] [stdout] 100 | | None [INFO] [stdout] 101 | | } [INFO] [stdout] | |_________^ help: try: `self.check_ended().map(|result| result)` [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: unnecessary use of `to_owned` [INFO] [stdout] --> src/solutions/year2020/day22.rs:105:33 [INFO] [stdout] | [INFO] [stdout] 105 | let p1: VecDeque = self.p1.to_owned().into_iter().take(c1 as usize).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.p1.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/solutions/year2020/day22.rs:106:33 [INFO] [stdout] | [INFO] [stdout] 106 | let p2: VecDeque = self.p2.to_owned().into_iter().take(c2 as usize).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.p2.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day22.rs:123:12 [INFO] [stdout] | [INFO] [stdout] 123 | if self.p1.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.p1.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day22.rs:125:19 [INFO] [stdout] | [INFO] [stdout] 125 | } else if self.p2.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.p2.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day22.rs:169:16 [INFO] [stdout] | [INFO] [stdout] 169 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day22.rs:190:25 [INFO] [stdout] | [INFO] [stdout] 190 | let winner = if p1.len() == 0 { p2 } else { p1 }; [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `p1.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&pos).is_some()` [INFO] [stdout] --> src/solutions/year2020/day24.rs:86:28 [INFO] [stdout] | [INFO] [stdout] 86 | let is_black = map.get(&pos).is_some(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&pos)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/solutions/year2024/day01.rs:30:18 [INFO] [stdout] | [INFO] [stdout] 30 | .zip(v2.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 30 - .zip(v2.into_iter()) [INFO] [stdout] 30 + .zip(v2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual absolute difference pattern without using `abs_diff` [INFO] [stdout] --> src/solutions/year2024/day01.rs:31:27 [INFO] [stdout] | [INFO] [stdout] 31 | .map(|(n, m)| if n > m { n - m } else { m - n }) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `abs_diff`: `n.abs_diff(m)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff [INFO] [stdout] = note: `#[warn(clippy::manual_abs_diff)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/year2024/day02.rs:10:28 [INFO] [stdout] | [INFO] [stdout] 10 | let is_diff_safe = 1 <= diff && diff <= 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=3).contains(&diff)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day02.rs:30:20 [INFO] [stdout] | [INFO] [stdout] 30 | fn is_safe(signal: &Vec, tolerance: bool) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 ~ fn is_safe(signal: &[i32], tolerance: bool) -> bool { [INFO] [stdout] 31 | if !tolerance { [INFO] [stdout] ... [INFO] [stdout] 37 | for i in 0..len { [INFO] [stdout] 38 ~ let mut s = signal.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `MMSS` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day04.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | MMSS, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Mmss` [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 `MSMS` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day04.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | MSMS, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Msms` [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 `SMSM` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day04.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | SMSM, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Smsm` [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 `SSMM` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day04.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | SSMM, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Ssmm` [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: called `unwrap` on `m1` after checking its variant with `is_none` [INFO] [stdout] --> src/solutions/year2024/day04.rs:94:22 [INFO] [stdout] | [INFO] [stdout] 91 | if m1.is_none() || m2.is_none() || s1.is_none() || s2.is_none() { [INFO] [stdout] | ------------ the check is happening here [INFO] [stdout] ... [INFO] [stdout] 94 | let m1 = m1.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `m2` after checking its variant with `is_none` [INFO] [stdout] --> src/solutions/year2024/day04.rs:95:22 [INFO] [stdout] | [INFO] [stdout] 91 | if m1.is_none() || m2.is_none() || s1.is_none() || s2.is_none() { [INFO] [stdout] | ------------ the check is happening here [INFO] [stdout] ... [INFO] [stdout] 95 | let m2 = m2.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `s1` after checking its variant with `is_none` [INFO] [stdout] --> src/solutions/year2024/day04.rs:96:22 [INFO] [stdout] | [INFO] [stdout] 91 | if m1.is_none() || m2.is_none() || s1.is_none() || s2.is_none() { [INFO] [stdout] | ------------ the check is happening here [INFO] [stdout] ... [INFO] [stdout] 96 | let s1 = s1.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `s2` after checking its variant with `is_none` [INFO] [stdout] --> src/solutions/year2024/day04.rs:97:22 [INFO] [stdout] | [INFO] [stdout] 91 | if m1.is_none() || m2.is_none() || s1.is_none() || s2.is_none() { [INFO] [stdout] | ------------ the check is happening here [INFO] [stdout] ... [INFO] [stdout] 97 | let s2 = s2.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day04.rs:61:42 [INFO] [stdout] | [INFO] [stdout] 61 | fn valid(&self, center: &Pos, chars: &Vec>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 61 - fn valid(&self, center: &Pos, chars: &Vec>) -> bool { [INFO] [stdout] 61 + fn valid(&self, center: &Pos, chars: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `xmas` [INFO] [stdout] --> src/solutions/year2024/day04.rs:137:26 [INFO] [stdout] | [INFO] [stdout] 137 | for i in 0..4 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 137 - for i in 0..4 { [INFO] [stdout] 137 + for in xmas.iter().take(4) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day05.rs:37:24 [INFO] [stdout] | [INFO] [stdout] 37 | fn sort_update(update: &mut Vec, pages: &[Option]) -> 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] 37 - fn sort_update(update: &mut Vec, pages: &[Option]) -> usize { [INFO] [stdout] 37 + fn sort_update(update: &mut [usize], pages: &[Option]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2024/day05.rs:117:16 [INFO] [stdout] | [INFO] [stdout] 117 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2024/day05.rs:157:16 [INFO] [stdout] | [INFO] [stdout] 157 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2024/day06.rs:113:20 [INFO] [stdout] | [INFO] [stdout] 113 | if let Some(_) = self.tick() { [INFO] [stdout] | -------^^^^^^^-------------- help: try: `if self.tick().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/solutions/year2024/day06.rs:154:65 [INFO] [stdout] | [INFO] [stdout] 154 | if ir == sys.guard.0 .0 && ic == sys.guard.0 .1 { [INFO] [stdout] | _________________________________________________________________^ [INFO] [stdout] 155 | | continue; [INFO] [stdout] 156 | | } else if !sys.map[r][c] { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/solutions/year2024/day06.rs:156:42 [INFO] [stdout] | [INFO] [stdout] 156 | } else if !sys.map[r][c] { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 157 | | continue; [INFO] [stdout] 158 | | } else { [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2024/day07.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | } else if nums.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nums.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2024/day07.rs:64:23 [INFO] [stdout] | [INFO] [stdout] 64 | } else if nums.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nums.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `free_spaces` [INFO] [stdout] --> src/solutions/year2024/day09.rs:117:22 [INFO] [stdout] | [INFO] [stdout] 117 | for i in 0..free_spaces.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 117 - for i in 0..free_spaces.len() { [INFO] [stdout] 117 + for in &mut free_spaces { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/solutions/year2024/day11.rs:24:20 [INFO] [stdout] | [INFO] [stdout] 24 | if i % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `i.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/year2024/day11.rs:69:18 [INFO] [stdout] | [INFO] [stdout] 69 | .map(|n| PlutoStone(n)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple struct itself: `PlutoStone` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day12.rs:76:52 [INFO] [stdout] | [INFO] [stdout] 76 | fn search(&self, pos: (usize, usize), visited: &mut Vec>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 76 - fn search(&self, pos: (usize, usize), visited: &mut Vec>) -> usize { [INFO] [stdout] 76 + fn search(&self, pos: (usize, usize), visited: &mut [Vec]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/solutions/year2020/day25.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | for i in 0..loop_size { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day12.rs:100:18 [INFO] [stdout] | [INFO] [stdout] 100 | visited: &mut Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - visited: &mut Vec>, [INFO] [stdout] 100 + visited: &mut [Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/solutions/year2020/day25.rs:52:21 [INFO] [stdout] | [INFO] [stdout] 52 | fn solve_part_2(input: String) -> String { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day13.rs:49:48 [INFO] [stdout] | [INFO] [stdout] 49 | fn parse_input(lines: &mut std::str::Lines) -> Option<((i64, i64), (i64, i64), (i64, i64))> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/solutions/year2024/day13.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | / if line.is_none() { [INFO] [stdout] 52 | | return None; [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____^ help: replace it with: `line?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:32:14 [INFO] [stdout] | [INFO] [stdout] 32 | for i in 0..h.0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 32 - for i in 0..h.0 { [INFO] [stdout] 32 + for in robots.iter().take(h.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:33:18 [INFO] [stdout] | [INFO] [stdout] 33 | for j in 0..h.1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 33 - for j in 0..h.1 { [INFO] [stdout] 33 + for in robots.iter().take(h.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:40:14 [INFO] [stdout] | [INFO] [stdout] 40 | for i in 0..h.0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 40 - for i in 0..h.0 { [INFO] [stdout] 40 + for in robots.iter().take(h.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:41:18 [INFO] [stdout] | [INFO] [stdout] 41 | for j in (h.1 + 1)..bound.1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 41 - for j in (h.1 + 1)..bound.1 { [INFO] [stdout] 41 + for in robots.iter().take(bound.1).skip((h.1 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:48:14 [INFO] [stdout] | [INFO] [stdout] 48 | for i in (h.0 + 1)..bound.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 48 - for i in (h.0 + 1)..bound.0 { [INFO] [stdout] 48 + for in robots.iter().take(bound.0).skip((h.0 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:49:18 [INFO] [stdout] | [INFO] [stdout] 49 | for j in 0..h.1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 49 - for j in 0..h.1 { [INFO] [stdout] 49 + for in robots.iter().take(h.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:56:14 [INFO] [stdout] | [INFO] [stdout] 56 | for i in (h.0 + 1)..bound.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 56 - for i in (h.0 + 1)..bound.0 { [INFO] [stdout] 56 + for in robots.iter().take(bound.0).skip((h.0 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:57:18 [INFO] [stdout] | [INFO] [stdout] 57 | for j in (h.1 + 1)..bound.1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 57 - for j in (h.1 + 1)..bound.1 { [INFO] [stdout] 57 + for in robots.iter().take(bound.1).skip((h.1 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day14.rs:91:44 [INFO] [stdout] | [INFO] [stdout] 91 | let print = |index: usize, robots: &Vec<((i32, i32), (i32, i32))>| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day14.rs:108:29 [INFO] [stdout] | [INFO] [stdout] 108 | let tick = |robots: &mut Vec<((i32, i32), (i32, i32))>| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day14.rs:117:30 [INFO] [stdout] | [INFO] [stdout] 117 | let score = |robots: &Vec<((i32, i32), (i32, i32))>| -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:127:22 [INFO] [stdout] | [INFO] [stdout] 127 | for i in 0..h.0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 127 - for i in 0..h.0 { [INFO] [stdout] 127 + for in robots.iter().take(h.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:128:26 [INFO] [stdout] | [INFO] [stdout] 128 | for j in 0..h.1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 128 - for j in 0..h.1 { [INFO] [stdout] 128 + for in robots.iter().take(h.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:135:22 [INFO] [stdout] | [INFO] [stdout] 135 | for i in 0..h.0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 135 - for i in 0..h.0 { [INFO] [stdout] 135 + for in robots.iter().take(h.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:136:26 [INFO] [stdout] | [INFO] [stdout] 136 | for j in (h.1 + 1)..bound.1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 136 - for j in (h.1 + 1)..bound.1 { [INFO] [stdout] 136 + for in robots.iter().take(bound.1).skip((h.1 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:143:22 [INFO] [stdout] | [INFO] [stdout] 143 | for i in (h.0 + 1)..bound.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 143 - for i in (h.0 + 1)..bound.0 { [INFO] [stdout] 143 + for in robots.iter().take(bound.0).skip((h.0 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:144:26 [INFO] [stdout] | [INFO] [stdout] 144 | for j in 0..h.1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 144 - for j in 0..h.1 { [INFO] [stdout] 144 + for in robots.iter().take(h.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:151:22 [INFO] [stdout] | [INFO] [stdout] 151 | for i in (h.0 + 1)..bound.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 151 - for i in (h.0 + 1)..bound.0 { [INFO] [stdout] 151 + for in robots.iter().take(bound.0).skip((h.0 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:152:26 [INFO] [stdout] | [INFO] [stdout] 152 | for j in (h.1 + 1)..bound.1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 152 - for j in (h.1 + 1)..bound.1 { [INFO] [stdout] 152 + for in robots.iter().take(bound.1).skip((h.1 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/solutions/year2024/day15.rs:169:22 [INFO] [stdout] | [INFO] [stdout] 169 | .map(|(c, char)| match char { [INFO] [stdout] | ______________________^ [INFO] [stdout] 170 | | '#' => [Tile2::Wall, Tile2::Wall], [INFO] [stdout] 171 | | '.' => [Tile2::Empty, Tile2::Empty], [INFO] [stdout] 172 | | 'O' => [Tile2::BoxLeft, Tile2::BoxRight], [INFO] [stdout] ... | [INFO] [stdout] 178 | | }) [INFO] [stdout] 179 | | .flatten() [INFO] [stdout] | |______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 169 ~ .flat_map(|(c, char)| match char { [INFO] [stdout] 170 + '#' => [Tile2::Wall, Tile2::Wall], [INFO] [stdout] 171 + '.' => [Tile2::Empty, Tile2::Empty], [INFO] [stdout] 172 + 'O' => [Tile2::BoxLeft, Tile2::BoxRight], [INFO] [stdout] 173 + '@' => { [INFO] [stdout] 174 + robot = (r, 2 * c); [INFO] [stdout] 175 + [Tile2::Empty, Tile2::Empty] [INFO] [stdout] 176 + } [INFO] [stdout] 177 + _ => unimplemented!(), [INFO] [stdout] 178 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/solutions/year2024/day15.rs:352:14 [INFO] [stdout] | [INFO] [stdout] 352 | .map(|line| line.chars().map(Dir::from)) [INFO] [stdout] | ______________^ [INFO] [stdout] 353 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|line| line.chars().map(Dir::from))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/solutions/year2024/day15.rs:371:14 [INFO] [stdout] | [INFO] [stdout] 371 | .map(|line| line.chars().map(Dir::from)) [INFO] [stdout] | ______________^ [INFO] [stdout] 372 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|line| line.chars().map(Dir::from))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2024/day16.rs:58:1 [INFO] [stdout] | [INFO] [stdout] 58 | / impl PartialOrd for StateWithHistory { [INFO] [stdout] 59 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 60 | | Some(self.state.cmp(&other.state)) [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 60 - Some(self.state.cmp(&other.state)) [INFO] [stdout] 61 - } [INFO] [stdout] 59 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2024/day16.rs:79:23 [INFO] [stdout] | [INFO] [stdout] 79 | Some(self.cmp(&other)) [INFO] [stdout] | ^^^^^^ help: change this to: `other` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day18.rs:7:18 [INFO] [stdout] | [INFO] [stdout] 7 | fn simulate(map: &mut Vec>, block: (usize, usize)) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 7 - fn simulate(map: &mut Vec>, block: (usize, usize)) -> bool { [INFO] [stdout] 7 + fn simulate(map: &mut [Vec], block: (usize, usize)) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2024/day19.rs:22:12 [INFO] [stdout] | [INFO] [stdout] 22 | if word.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `word.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2024/day19.rs:40:16 [INFO] [stdout] | [INFO] [stdout] 40 | if word == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `word.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2024/day21.rs:225:23 [INFO] [stdout] | [INFO] [stdout] 225 | Some(self.cmp(&other)) [INFO] [stdout] | ^^^^^^ help: change this to: `other` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/year2024/day21.rs:474:30 [INFO] [stdout] | [INFO] [stdout] 474 | let num: usize = (&line[..3]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line[..3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/year2024/day21.rs:485:30 [INFO] [stdout] | [INFO] [stdout] 485 | let num: usize = (&line[..3]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line[..3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CONNECTED` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day23.rs:6:6 [INFO] [stdout] | [INFO] [stdout] 6 | type CONNECTED = [[bool; MAX_NODE]; MAX_NODE]; [INFO] [stdout] | ^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Connected` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/solutions/year2024/day23.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | let a = 'a' as u8 + a; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [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/solutions/year2024/day23.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | let b = 'a' as u8 + b; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/solutions/year2024/day23.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | let a = a as u8 - 'a' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/solutions/year2024/day23.rs:25:23 [INFO] [stdout] | [INFO] [stdout] 25 | let b = b as u8 - 'a' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [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: the loop variable `i` is only used to index `nodes` [INFO] [stdout] --> src/solutions/year2024/day23.rs:87:18 [INFO] [stdout] | [INFO] [stdout] 87 | for i in 0..l { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 87 - for i in 0..l { [INFO] [stdout] 87 + for in nodes.iter().take(l) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `AND` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day24.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | AND, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `And` [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 `XOR` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day24.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | XOR, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Xor` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day24.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | depends: Option<(Gate, Rc>, Rc>)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2024/day24.rs:91:12 [INFO] [stdout] | [INFO] [stdout] 91 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/year2024/day24.rs:197:32 [INFO] [stdout] | [INFO] [stdout] 197 | let index: usize = (&name[1..]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `name[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: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> src/solutions/year2024/day25.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | / let Some(line) = line else { [INFO] [stdout] 13 | | return None; [INFO] [stdout] 14 | | }; [INFO] [stdout] | |__________^ help: replace it with: `let line = line?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/year2024/day04.rs:131:16 [INFO] [stdout] | [INFO] [stdout] 131 | let xmas = vec!['X', 'M', 'A', 'S']; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `['X', 'M', 'A', 'S']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/year2024/day05.rs:21:23 [INFO] [stdout] | [INFO] [stdout] 21 | let mut visited = vec![false; NUM_PAGE]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[false; NUM_PAGE]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `0` and `1` are never read [INFO] [stdout] --> src/solutions/year2019/day23.rs:8:15 [INFO] [stdout] | [INFO] [stdout] 8 | struct Packet(i64, i64); [INFO] [stdout] | ------ ^^^ ^^^ [INFO] [stdout] | | [INFO] [stdout] | fields in this struct [INFO] [stdout] | [INFO] [stdout] = help: consider removing these fields [INFO] [stdout] = note: `Packet` has a derived impl for the trait `Clone`, 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: field `packets` is never read [INFO] [stdout] --> src/solutions/year2019/day23.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 10 | struct Network { [INFO] [stdout] | ------- field in this struct [INFO] [stdout] 11 | computers: Vec, [INFO] [stdout] 12 | packets: Vec>, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/solutions/year2018/day02.rs:34:27 [INFO] [stdout] | [INFO] [stdout] 34 | let two = checksum.iter().any(|a| *a == 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `checksum.contains(&2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/solutions/year2018/day02.rs:35:29 [INFO] [stdout] | [INFO] [stdout] 35 | let three = checksum.iter().any(|a| *a == 3); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `checksum.contains(&3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:73:22 [INFO] [stdout] | [INFO] [stdout] 73 | for x in x0..x1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 73 - for x in x0..x1 { [INFO] [stdout] 73 + for in grid.iter_mut().take(x1).skip(x0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:74:26 [INFO] [stdout] | [INFO] [stdout] 74 | for y in y0..y1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 74 - for y in y0..y1 { [INFO] [stdout] 74 + for in grid.iter_mut().take(y1).skip(y0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:125:22 [INFO] [stdout] | [INFO] [stdout] 125 | for x in x0..x1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 125 - for x in x0..x1 { [INFO] [stdout] 125 + for in grid.iter_mut().take(x1).skip(x0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:126:26 [INFO] [stdout] | [INFO] [stdout] 126 | for y in y0..y1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 126 - for y in y0..y1 { [INFO] [stdout] 126 + for in grid.iter_mut().take(y1).skip(y0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:141:30 [INFO] [stdout] | [INFO] [stdout] 141 | 'outer: for x in x0..x1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 141 - 'outer: for x in x0..x1 { [INFO] [stdout] 141 + 'outer: for in grid.iter().take(x1).skip(x0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/solutions/year2018/day03.rs:142:26 [INFO] [stdout] | [INFO] [stdout] 142 | for y in y0..y1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 142 - for y in y0..y1 { [INFO] [stdout] 142 + for in grid.iter().take(y1).skip(y0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2018/day04.rs:26:1 [INFO] [stdout] | [INFO] [stdout] 26 | / impl PartialOrd for DateTime { [INFO] [stdout] 27 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 28 | | match self.year.partial_cmp(&other.year) { [INFO] [stdout] 29 | | Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] ... | [INFO] [stdout] 46 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 27 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 28 - match self.year.partial_cmp(&other.year) { [INFO] [stdout] 29 - Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] 30 - ord => return ord, [INFO] [stdout] 31 - } [INFO] [stdout] 32 - match self.month.partial_cmp(&other.month) { [INFO] [stdout] 33 - Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] 34 - ord => return ord, [INFO] [stdout] 35 - } [INFO] [stdout] 36 - match self.day.partial_cmp(&other.day) { [INFO] [stdout] 37 - Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] 38 - ord => return ord, [INFO] [stdout] 39 - } [INFO] [stdout] 40 - match self.hour.partial_cmp(&other.hour) { [INFO] [stdout] 41 - Some(std::cmp::Ordering::Equal) => {} [INFO] [stdout] 42 - ord => return ord, [INFO] [stdout] 43 - } [INFO] [stdout] 44 - self.minute.partial_cmp(&other.minute) [INFO] [stdout] 45 - } [INFO] [stdout] 27 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2018/day04.rs:106:1 [INFO] [stdout] | [INFO] [stdout] 106 | / impl PartialOrd for Log { [INFO] [stdout] 107 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 108 | | self.datetime.partial_cmp(&other.datetime) [INFO] [stdout] 109 | | } [INFO] [stdout] 110 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 107 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 108 - self.datetime.partial_cmp(&other.datetime) [INFO] [stdout] 109 - } [INFO] [stdout] 107 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2018/day04.rs:135:22 [INFO] [stdout] | [INFO] [stdout] 135 | let id = (&s.split_ascii_whitespace().nth(1).unwrap())[1..] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `s.split_ascii_whitespace().nth(1).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/year2019/day01.rs:19:18 [INFO] [stdout] | [INFO] [stdout] 19 | .map(|n| compute_fuel(n)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_fuel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/year2019/day01.rs:38:18 [INFO] [stdout] | [INFO] [stdout] 38 | .map(|n| compute_fuel(n)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `compute_fuel` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | if k = 1 then [INFO] [stdout] | ^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] = note: `#[warn(clippy::doc_overindented_list_items)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:8:1 [INFO] [stdout] | [INFO] [stdout] 8 | output(A) [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:9:1 [INFO] [stdout] | [INFO] [stdout] 9 | else [INFO] [stdout] | ^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:10:1 [INFO] [stdout] | [INFO] [stdout] 10 | // permutations with last element fixed [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | permutations(k - 1, A) [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:12:1 [INFO] [stdout] | [INFO] [stdout] 12 | // permutations with last element swapped out [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:13:1 [INFO] [stdout] | [INFO] [stdout] 13 | for i := 0; i < k-1; i += 1 do [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:14:1 [INFO] [stdout] | [INFO] [stdout] 14 | if k is even then [INFO] [stdout] | ^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:15:1 [INFO] [stdout] | [INFO] [stdout] 15 | swap(A[i], A[k-1]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:16:1 [INFO] [stdout] | [INFO] [stdout] 16 | else [INFO] [stdout] | ^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:17:1 [INFO] [stdout] | [INFO] [stdout] 17 | swap(A[0], A[k-1]) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:18:1 [INFO] [stdout] | [INFO] [stdout] 18 | end if [INFO] [stdout] | ^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:19:1 [INFO] [stdout] | [INFO] [stdout] 19 | permutations(k - 1, A) [INFO] [stdout] | ^^^^^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:20:1 [INFO] [stdout] | [INFO] [stdout] 20 | end for [INFO] [stdout] | ^^^^^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/solutions/year2019/day07.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | end if [INFO] [stdout] | ^^^ help: try using ` ` (2 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/solutions/year2019/day07.rs:29:16 [INFO] [stdout] | [INFO] [stdout] 29 | if k % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `k.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/solutions/year2019/day07.rs:75:13 [INFO] [stdout] | [INFO] [stdout] 74 | let output = e.run_until_halt(); [INFO] [stdout] | -------------------------------- unnecessary `let` binding [INFO] [stdout] 75 | output [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 74 ~ [INFO] [stdout] 75 ~ e.run_until_halt() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/solutions/year2019/day07.rs:161:39 [INFO] [stdout] | [INFO] [stdout] 161 | let heap = HashSet::from_iter(permutations(3).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 161 - let heap = HashSet::from_iter(permutations(3).into_iter()); [INFO] [stdout] 161 + let heap = HashSet::from_iter(permutations(3)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/solutions/year2019/day07.rs:164:41 [INFO] [stdout] | [INFO] [stdout] 164 | let heap_2 = HashSet::from_iter(permutate(vec![0, 1, 2]).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 164 - let heap_2 = HashSet::from_iter(permutate(vec![0, 1, 2]).into_iter()); [INFO] [stdout] 164 + let heap_2 = HashSet::from_iter(permutate(vec![0, 1, 2])); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/solutions/year2019/day10.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | v.sort_by(|a, b| b.0.cmp(&a.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 47 - v.sort_by(|a, b| b.0.cmp(&a.0)); [INFO] [stdout] 47 + v.sort_by_key(|b| std::cmp::Reverse(b.0)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2019/day10.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 71 | if v[index].1.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `v[index].1.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day11.rs:150:20 [INFO] [stdout] | [INFO] [stdout] 150 | if let Some(_) = robot.tick() { [INFO] [stdout] | -------^^^^^^^--------------- help: try: `if robot.tick().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day12.rs:99:27 [INFO] [stdout] | [INFO] [stdout] 99 | a.gravity(&b); [INFO] [stdout] | ^^ help: change this to: `b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day12.rs:100:27 [INFO] [stdout] | [INFO] [stdout] 100 | b.gravity(&a); [INFO] [stdout] | ^^ help: change this to: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/solutions/year2019/day12.rs:160:8 [INFO] [stdout] | [INFO] [stdout] 160 | if !(a < b) { [INFO] [stdout] | ^^^^^^^^ help: try: `(a >= b)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/solutions/year2019/day12.rs:246:9 [INFO] [stdout] | [INFO] [stdout] 246 | assert!(false); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/solutions/year2019/day13.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | Block, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day13.rs:44:29 [INFO] [stdout] | [INFO] [stdout] 44 | fn print_gameboard(outputs: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - fn print_gameboard(outputs: &Vec) { [INFO] [stdout] 44 + fn print_gameboard(outputs: &[i64]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day13.rs:100:43 [INFO] [stdout] | [INFO] [stdout] 100 | let mut computer = Computer::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/solutions/year2019/day13.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | / loop { [INFO] [stdout] 103 | | match computer.run() { [INFO] [stdout] 104 | | computer::Result::Output(output) => outputs.push(output), [INFO] [stdout] 105 | | _ => break, [INFO] [stdout] 106 | | } [INFO] [stdout] 107 | | } [INFO] [stdout] | |_________^ help: try: `while let computer::Result::Output(output) = computer.run() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day13.rs:120:43 [INFO] [stdout] | [INFO] [stdout] 120 | let mut computer = Computer::from(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/solutions/year2019/day14.rs:23:19 [INFO] [stdout] | [INFO] [stdout] 23 | let set = (n + (self.bulk - 1)) / self.bulk; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `n.div_ceil(self.bulk)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice` [INFO] [stdout] --> src/solutions/year2019/day14.rs:241:39 [INFO] [stdout] | [INFO] [stdout] 241 | for (i, input) in inputs[2..].into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&new_pos).is_none()` [INFO] [stdout] --> src/solutions/year2019/day15.rs:232:24 [INFO] [stdout] | [INFO] [stdout] 232 | if map.get(&new_pos).is_none() { [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: replace it with: `!map.contains_key(&new_pos)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/solutions/year2019/day15.rs:244:27 [INFO] [stdout] | [INFO] [stdout] 244 | let ((x, y), _) = map [INFO] [stdout] | ___________________________^ [INFO] [stdout] 245 | | .iter() [INFO] [stdout] 246 | | .filter(|(_, v)| **v == Tile::Oxygen) [INFO] [stdout] 247 | | .next() [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 244 ~ let ((x, y), _) = map [INFO] [stdout] 245 + .iter().find(|(_, v)| **v == Tile::Oxygen) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/solutions/year2019/day16.rs:8:10 [INFO] [stdout] | [INFO] [stdout] 8 | .map(move |num| vec![*num; i]) [INFO] [stdout] | __________^ [INFO] [stdout] 9 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(move |num| vec![*num; i])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> src/solutions/year2019/day16.rs:80:18 [INFO] [stdout] | [INFO] [stdout] 80 | x2 = (0..8) [INFO] [stdout] | __________________^ [INFO] [stdout] 81 | | .into_iter() [INFO] [stdout] | |____________________________^ help: consider removing `.into_iter()`: `(0..8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day17.rs:7:31 [INFO] [stdout] | [INFO] [stdout] 7 | fn alignment_parameter(input: &String) -> usize { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 7 - fn alignment_parameter(input: &String) -> usize { [INFO] [stdout] 7 + fn alignment_parameter(input: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2019/day17.rs:12:16 [INFO] [stdout] | [INFO] [stdout] 12 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day17.rs:60:31 [INFO] [stdout] | [INFO] [stdout] 60 | fn analytical_solution(input: &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 60 - fn analytical_solution(input: &String) -> String { [INFO] [stdout] 60 + fn analytical_solution(input: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2019/day17.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | if line.trim().len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.trim().is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day17.rs:105:14 [INFO] [stdout] | [INFO] [stdout] 105 | map: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 105 - map: &Vec>, [INFO] [stdout] 105 + map: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:126:51 [INFO] [stdout] | [INFO] [stdout] 126 | if let Some(p) = try_add(pos, left_delta, &map) { [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:133:52 [INFO] [stdout] | [INFO] [stdout] 133 | if let Some(p) = try_add(pos, right_delta, &map) { [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/solutions/year2019/day17.rs:144:9 [INFO] [stdout] | [INFO] [stdout] 144 | / loop { [INFO] [stdout] 145 | | if let Some(next) = try_add(pos, dir.delta(), &map) { [INFO] [stdout] 146 | | let next_tile = map[next.0][next.1]; [INFO] [stdout] 147 | | if next_tile == '#' || next_tile == 'O' { [INFO] [stdout] ... | [INFO] [stdout] 159 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(next) = try_add(pos, dir.delta(), &map) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:145:59 [INFO] [stdout] | [INFO] [stdout] 145 | if let Some(next) = try_add(pos, dir.delta(), &map) { [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/solutions/year2019/day17.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | / loop { [INFO] [stdout] 164 | | let Some(t) = turn(&pos, &mut dir, &map) else { [INFO] [stdout] 165 | | break; [INFO] [stdout] 166 | | }; [INFO] [stdout] 167 | | ans.push(t.to_string()); [INFO] [stdout] 168 | | ans.push(move_forward(&mut pos, &dir, &mut map).to_string()); [INFO] [stdout] 169 | | } [INFO] [stdout] | |_____^ help: try: `while let Some(t) = turn(&pos, &mut dir, &map) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:187:43 [INFO] [stdout] | [INFO] [stdout] 187 | let mut computer = Computer::from(&input.lines().next().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `input.lines().next().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day17.rs:200:43 [INFO] [stdout] | [INFO] [stdout] 200 | let mut computer = Computer::from(&input.lines().next().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `input.lines().next().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day18.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | fn dfs(from: (usize, usize), num_keys: usize, map: &Vec>) -> Vec<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - fn dfs(from: (usize, usize), num_keys: usize, map: &Vec>) -> Vec<(usize, usize)> { [INFO] [stdout] 51 + fn dfs(from: (usize, usize), num_keys: usize, map: &[Vec]) -> Vec<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2019/day18.rs:101:6 [INFO] [stdout] | [INFO] [stdout] 101 | ) -> (Vec<(usize, usize)>, Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/solutions/year2019/day18.rs:103:42 [INFO] [stdout] | [INFO] [stdout] 103 | let mut key_positions = vec![(0, 0); n as usize]; [INFO] [stdout] | ^^^^^^^^^^ help: try: `n` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/solutions/year2019/day18.rs:106:13 [INFO] [stdout] | [INFO] [stdout] 106 | / match tile { [INFO] [stdout] 107 | | Tile::Key(i) => { [INFO] [stdout] 108 | | key_positions[*i] = (r, c); [INFO] [stdout] ... | [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 106 ~ if let Tile::Key(i) = tile { [INFO] [stdout] 107 + key_positions[*i] = (r, c); [INFO] [stdout] 108 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day18.rs:117:39 [INFO] [stdout] | [INFO] [stdout] 117 | let mut adj_row = dfs(key, n, &map); [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day18.rs:122:58 [INFO] [stdout] | [INFO] [stdout] 122 | let mut from_start = dfs(start, key_positions.len(), &map); [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/solutions/year2019/day18.rs:127:32 [INFO] [stdout] | [INFO] [stdout] 127 | for (_r, row) in adj.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 127 - for (_r, row) in adj.iter().enumerate() { [INFO] [stdout] 127 + for row in adj.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/solutions/year2019/day18.rs:136:56 [INFO] [stdout] | [INFO] [stdout] 136 | for (_c, (steps, _required_keys)) in row.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 136 - for (_c, (steps, _required_keys)) in row.iter().enumerate() { [INFO] [stdout] 136 + for (steps, _required_keys) in row.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2019/day18.rs:175:1 [INFO] [stdout] | [INFO] [stdout] 175 | / impl PartialOrd for State1 { [INFO] [stdout] 176 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 177 | | match other.steps.partial_cmp(&self.steps) { [INFO] [stdout] 178 | | Some(std::cmp::Ordering::Equal) => self.num_keys().partial_cmp(&other.num_keys()), [INFO] [stdout] ... | [INFO] [stdout] 182 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 176 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 177 - match other.steps.partial_cmp(&self.steps) { [INFO] [stdout] 178 - Some(std::cmp::Ordering::Equal) => self.num_keys().partial_cmp(&other.num_keys()), [INFO] [stdout] 179 - ord => ord, [INFO] [stdout] 180 - } [INFO] [stdout] 181 - } [INFO] [stdout] 176 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2019/day18.rs:184:1 [INFO] [stdout] | [INFO] [stdout] 184 | / impl PartialOrd for State2 { [INFO] [stdout] 185 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 186 | | match other.steps.partial_cmp(&self.steps) { [INFO] [stdout] 187 | | Some(std::cmp::Ordering::Equal) => self.num_keys().partial_cmp(&other.num_keys()), [INFO] [stdout] ... | [INFO] [stdout] 191 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 185 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 186 - match other.steps.partial_cmp(&self.steps) { [INFO] [stdout] 187 - Some(std::cmp::Ordering::Equal) => self.num_keys().partial_cmp(&other.num_keys()), [INFO] [stdout] 188 - ord => ord, [INFO] [stdout] 189 - } [INFO] [stdout] 190 - } [INFO] [stdout] 185 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `starts` [INFO] [stdout] --> src/solutions/year2019/day18.rs:325:18 [INFO] [stdout] | [INFO] [stdout] 325 | for i in 0..4 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 325 - for i in 0..4 { [INFO] [stdout] 325 + for in &starts { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[usize; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/solutions/year2019/day18.rs:356:42 [INFO] [stdout] | [INFO] [stdout] 356 | let mut new_robots = state.robots.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `state.robots` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[usize; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/solutions/year2019/day18.rs:358:37 [INFO] [stdout] | [INFO] [stdout] 358 | let hash_key = (new_robots.clone(), keys); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_robots` [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: unneeded `return` statement [INFO] [stdout] --> src/solutions/year2019/day19.rs:13:40 [INFO] [stdout] | [INFO] [stdout] 13 | computer::Result::Output(i) => return i == 1, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 13 - computer::Result::Output(i) => return i == 1, [INFO] [stdout] 13 + computer::Result::Output(i) => i == 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day19.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | fn check(input: &String, x: i64, y: i64) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 7 - fn check(input: &String, x: i64, y: i64) -> bool { [INFO] [stdout] 7 + fn check(input: &str, x: i64, y: i64) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2019/day20.rs:14:1 [INFO] [stdout] | [INFO] [stdout] 14 | / impl PartialOrd for State { [INFO] [stdout] 15 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 16 | | match other.dist.partial_cmp(&self.dist) { [INFO] [stdout] 17 | | Some(std::cmp::Ordering::Equal) => other.depth.partial_cmp(&self.depth), [INFO] [stdout] ... | [INFO] [stdout] 21 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 15 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 16 - match other.dist.partial_cmp(&self.dist) { [INFO] [stdout] 17 - Some(std::cmp::Ordering::Equal) => other.depth.partial_cmp(&self.depth), [INFO] [stdout] 18 - ord => ord, [INFO] [stdout] 19 - } [INFO] [stdout] 20 - } [INFO] [stdout] 15 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day20.rs:49:19 [INFO] [stdout] | [INFO] [stdout] 49 | fn print_map(map: &Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 49 - fn print_map(map: &Vec>) { [INFO] [stdout] 49 + fn print_map(map: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2019/day20.rs:104:18 [INFO] [stdout] | [INFO] [stdout] 104 | let mut map: HashMap> = HashMap::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/solutions/year2019/day20.rs:132:39 [INFO] [stdout] | [INFO] [stdout] 132 | let deepens = if ir < 0 || ic < 0 || ir >= imr || ic >= imc { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 133 | | false [INFO] [stdout] 134 | | } else { [INFO] [stdout] 135 | | true [INFO] [stdout] 136 | | }; [INFO] [stdout] | |_________________________^ help: you can reduce it to: `!(ir < 0 || ic < 0 || ir >= imr || ic >= imc)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2019/day20.rs:264:35 [INFO] [stdout] | [INFO] [stdout] 264 | fn dfs(from: (usize, usize), map: &Vec>, num_portals: usize) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 264 - fn dfs(from: (usize, usize), map: &Vec>, num_portals: usize) -> Vec { [INFO] [stdout] 264 + fn dfs(from: (usize, usize), map: &[Vec], num_portals: usize) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2019/day20.rs:310:35 [INFO] [stdout] | [INFO] [stdout] 310 | let row = dfs(p.location, &map, portals.len()); [INFO] [stdout] | ^^^^ help: change this to: `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/solutions/year2019/day21.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | / outputs [INFO] [stdout] 50 | | .iter() [INFO] [stdout] 51 | | .map(|&n| n) [INFO] [stdout] | |____________________________^ [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] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 49 ~ outputs [INFO] [stdout] 50 + .iter().copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day21.rs:52:34 [INFO] [stdout] | [INFO] [stdout] 52 | .take_while(|&n| match char::from_u32(n as u32) { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 53 | | Some(_) => true, [INFO] [stdout] 54 | | _ => false, [INFO] [stdout] 55 | | }) [INFO] [stdout] | |_________________^ help: try: `char::from_u32(n as u32).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day21.rs:63:33 [INFO] [stdout] | [INFO] [stdout] 63 | .take_while(|n| match char::from_u32(*n as u32) { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 64 | | Some(_) => true, [INFO] [stdout] 65 | | _ => false, [INFO] [stdout] 66 | | }) [INFO] [stdout] | |_________________^ help: try: `char::from_u32(*n as u32).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/solutions/year2019/day21.rs:104:13 [INFO] [stdout] | [INFO] [stdout] 104 | / outputs [INFO] [stdout] 105 | | .iter() [INFO] [stdout] 106 | | .map(|&n| n) [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 104 ~ outputs [INFO] [stdout] 105 + .iter().copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day21.rs:107:34 [INFO] [stdout] | [INFO] [stdout] 107 | .take_while(|&n| match char::from_u32(n as u32) { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 108 | | Some(_) => true, [INFO] [stdout] 109 | | _ => false, [INFO] [stdout] 110 | | }) [INFO] [stdout] | |_________________^ help: try: `char::from_u32(n as u32).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2019/day21.rs:118:33 [INFO] [stdout] | [INFO] [stdout] 118 | .take_while(|n| match char::from_u32(*n as u32) { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 119 | | Some(_) => true, [INFO] [stdout] 120 | | _ => false, [INFO] [stdout] 121 | | }) [INFO] [stdout] | |_________________^ help: try: `char::from_u32(*n as u32).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is used to index `new_seats` [INFO] [stdout] --> src/solutions/year2020/day11.rs:109:18 [INFO] [stdout] | [INFO] [stdout] 109 | for r in 0..mr { [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] 109 - for r in 0..mr { [INFO] [stdout] 109 + for (r, ) in new_seats.iter_mut().enumerate().take(mr) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `new_seats` [INFO] [stdout] --> src/solutions/year2020/day11.rs:110:22 [INFO] [stdout] | [INFO] [stdout] 110 | for c in 0..mc { [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] 110 - for c in 0..mc { [INFO] [stdout] 110 + for (c, ) in new_seats.iter_mut().enumerate().take(mc) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is used to index `new_seats` [INFO] [stdout] --> src/solutions/year2020/day11.rs:182:18 [INFO] [stdout] | [INFO] [stdout] 182 | for r in 0..mr { [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] 182 - for r in 0..mr { [INFO] [stdout] 182 + for (r, ) in new_seats.iter_mut().enumerate().take(mr) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `new_seats` [INFO] [stdout] --> src/solutions/year2020/day11.rs:183:22 [INFO] [stdout] | [INFO] [stdout] 183 | for c in 0..mc { [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] 183 - for c in 0..mc { [INFO] [stdout] 183 + for (c, ) in new_seats.iter_mut().enumerate().take(mc) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day16.rs:62:16 [INFO] [stdout] | [INFO] [stdout] 62 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day16.rs:82:16 [INFO] [stdout] | [INFO] [stdout] 82 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:103:18 [INFO] [stdout] | [INFO] [stdout] 103 | for x in 0..mx { [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] 103 - for x in 0..mx { [INFO] [stdout] 103 + for (x, ) in new_cells.iter_mut().enumerate().take(mx) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:104:22 [INFO] [stdout] | [INFO] [stdout] 104 | for y in 0..my { [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] 104 - for y in 0..my { [INFO] [stdout] 104 + for (y, ) in new_cells.iter_mut().enumerate().take(my) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `z` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:105:26 [INFO] [stdout] | [INFO] [stdout] 105 | for z in 0..mz { [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] 105 - for z in 0..mz { [INFO] [stdout] 105 + for (z, ) in new_cells.iter_mut().enumerate().take(mz) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `w` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:106:30 [INFO] [stdout] | [INFO] [stdout] 106 | for w in 0..mw { [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] 106 - for w in 0..mw { [INFO] [stdout] 106 + for (w, ) in new_cells.iter_mut().enumerate().take(mw) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/year2020/day17.rs:108:54 [INFO] [stdout] | [INFO] [stdout] 108 | if self.cells[x][y][z][w] && (count < 2 || count > 3) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(2..=3).contains(&count)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:219:18 [INFO] [stdout] | [INFO] [stdout] 219 | for x in 0..mx { [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] 219 - for x in 0..mx { [INFO] [stdout] 219 + for (x, ) in new_cells.iter_mut().enumerate().take(mx) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:220:22 [INFO] [stdout] | [INFO] [stdout] 220 | for y in 0..my { [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] 220 - for y in 0..my { [INFO] [stdout] 220 + for (y, ) in new_cells.iter_mut().enumerate().take(my) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `z` is used to index `new_cells` [INFO] [stdout] --> src/solutions/year2020/day17.rs:221:26 [INFO] [stdout] | [INFO] [stdout] 221 | for z in 0..mz { [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] 221 - for z in 0..mz { [INFO] [stdout] 221 + for (z, ) in new_cells.iter_mut().enumerate().take(mz) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/year2020/day17.rs:223:47 [INFO] [stdout] | [INFO] [stdout] 223 | if self.cells[x][y][z] && (count < 2 || count > 3) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(2..=3).contains(&count)` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/solutions/year2020/day18.rs:73:13 [INFO] [stdout] | [INFO] [stdout] 73 | / match token { [INFO] [stdout] 74 | | Token::Digit(d) => value += d, [INFO] [stdout] 75 | | _ => {} [INFO] [stdout] 76 | | } [INFO] [stdout] | |_____________^ help: try: `if let Token::Digit(d) = token { value += d }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day18.rs:114:8 [INFO] [stdout] | [INFO] [stdout] 114 | if nested.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nested.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day18.rs:133:8 [INFO] [stdout] | [INFO] [stdout] 133 | if nested.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nested.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day19.rs:91:12 [INFO] [stdout] | [INFO] [stdout] 91 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is used to index `new_data` [INFO] [stdout] --> src/solutions/year2020/day20.rs:34:18 [INFO] [stdout] | [INFO] [stdout] 34 | for r in 0..mr { [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] 34 - for r in 0..mr { [INFO] [stdout] 34 + for (r, ) in new_data.iter_mut().enumerate().take(mr) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/solutions/year2020/day20.rs:336:9 [INFO] [stdout] | [INFO] [stdout] 336 | / if line.is_none() { [INFO] [stdout] 337 | | return None; [INFO] [stdout] 338 | | } [INFO] [stdout] | |_________^ help: replace it with: `line?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `assembled` [INFO] [stdout] --> src/solutions/year2020/day20.rs:476:14 [INFO] [stdout] | [INFO] [stdout] 476 | for r in 0..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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 476 - for r in 0..size { [INFO] [stdout] 476 + for in assembled.iter_mut().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `assembled` [INFO] [stdout] --> src/solutions/year2020/day20.rs:490:14 [INFO] [stdout] | [INFO] [stdout] 490 | for r in 0..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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 490 - for r in 0..size { [INFO] [stdout] 490 + for in assembled.iter().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is only used to index `assembled` [INFO] [stdout] --> src/solutions/year2020/day20.rs:491:18 [INFO] [stdout] | [INFO] [stdout] 491 | for c in 0..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] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 491 - for c in 0..size { [INFO] [stdout] 491 + for in assembled.iter().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2020/day21.rs:71:20 [INFO] [stdout] | [INFO] [stdout] 71 | if let Some(_) = ingredient_map.get(ingredient) { [INFO] [stdout] | -------^^^^^^^--------------------------------- help: try: `if ingredient_map.get(ingredient).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `U256` which implements the `Copy` trait [INFO] [stdout] --> src/solutions/year2020/day21.rs:123:28 [INFO] [stdout] | [INFO] [stdout] 123 | let mut code = food.barcode.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `food.barcode` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/solutions/year2020/day21.rs:368:9 [INFO] [stdout] | [INFO] [stdout] 368 | assert!(false, "{} is {:b}", a, aa); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2020/day22.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | cache: Rc, VecDeque), GameResult>>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day22.rs:24:16 [INFO] [stdout] | [INFO] [stdout] 24 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/solutions/year2020/day22.rs:97:9 [INFO] [stdout] | [INFO] [stdout] 97 | / if let Some(result) = self.check_ended() { [INFO] [stdout] 98 | | Some(result) [INFO] [stdout] 99 | | } else { [INFO] [stdout] 100 | | None [INFO] [stdout] 101 | | } [INFO] [stdout] | |_________^ help: try: `self.check_ended().map(|result| result)` [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: unnecessary use of `to_owned` [INFO] [stdout] --> src/solutions/year2020/day22.rs:105:33 [INFO] [stdout] | [INFO] [stdout] 105 | let p1: VecDeque = self.p1.to_owned().into_iter().take(c1 as usize).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.p1.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_owned` [INFO] [stdout] --> src/solutions/year2020/day22.rs:106:33 [INFO] [stdout] | [INFO] [stdout] 106 | let p2: VecDeque = self.p2.to_owned().into_iter().take(c2 as usize).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `self.p2.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day22.rs:123:12 [INFO] [stdout] | [INFO] [stdout] 123 | if self.p1.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.p1.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day22.rs:125:19 [INFO] [stdout] | [INFO] [stdout] 125 | } else if self.p2.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.p2.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2020/day22.rs:169:16 [INFO] [stdout] | [INFO] [stdout] 169 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2020/day22.rs:190:25 [INFO] [stdout] | [INFO] [stdout] 190 | let winner = if p1.len() == 0 { p2 } else { p1 }; [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `p1.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&pos).is_some()` [INFO] [stdout] --> src/solutions/year2020/day24.rs:86:28 [INFO] [stdout] | [INFO] [stdout] 86 | let is_black = map.get(&pos).is_some(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(&pos)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/solutions/year2024/day01.rs:30:18 [INFO] [stdout] | [INFO] [stdout] 30 | .zip(v2.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 30 - .zip(v2.into_iter()) [INFO] [stdout] 30 + .zip(v2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual absolute difference pattern without using `abs_diff` [INFO] [stdout] --> src/solutions/year2024/day01.rs:31:27 [INFO] [stdout] | [INFO] [stdout] 31 | .map(|(n, m)| if n > m { n - m } else { m - n }) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `abs_diff`: `n.abs_diff(m)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff [INFO] [stdout] = note: `#[warn(clippy::manual_abs_diff)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/solutions/year2024/day02.rs:10:28 [INFO] [stdout] | [INFO] [stdout] 10 | let is_diff_safe = 1 <= diff && diff <= 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=3).contains(&diff)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day02.rs:30:20 [INFO] [stdout] | [INFO] [stdout] 30 | fn is_safe(signal: &Vec, tolerance: bool) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 ~ fn is_safe(signal: &[i32], tolerance: bool) -> bool { [INFO] [stdout] 31 | if !tolerance { [INFO] [stdout] ... [INFO] [stdout] 37 | for i in 0..len { [INFO] [stdout] 38 ~ let mut s = signal.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `MMSS` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day04.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | MMSS, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Mmss` [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 `MSMS` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day04.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | MSMS, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Msms` [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 `SMSM` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day04.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | SMSM, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Smsm` [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 `SSMM` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day04.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | SSMM, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Ssmm` [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: called `unwrap` on `m1` after checking its variant with `is_none` [INFO] [stdout] --> src/solutions/year2024/day04.rs:94:22 [INFO] [stdout] | [INFO] [stdout] 91 | if m1.is_none() || m2.is_none() || s1.is_none() || s2.is_none() { [INFO] [stdout] | ------------ the check is happening here [INFO] [stdout] ... [INFO] [stdout] 94 | let m1 = m1.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `m2` after checking its variant with `is_none` [INFO] [stdout] --> src/solutions/year2024/day04.rs:95:22 [INFO] [stdout] | [INFO] [stdout] 91 | if m1.is_none() || m2.is_none() || s1.is_none() || s2.is_none() { [INFO] [stdout] | ------------ the check is happening here [INFO] [stdout] ... [INFO] [stdout] 95 | let m2 = m2.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `s1` after checking its variant with `is_none` [INFO] [stdout] --> src/solutions/year2024/day04.rs:96:22 [INFO] [stdout] | [INFO] [stdout] 91 | if m1.is_none() || m2.is_none() || s1.is_none() || s2.is_none() { [INFO] [stdout] | ------------ the check is happening here [INFO] [stdout] ... [INFO] [stdout] 96 | let s1 = s1.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `s2` after checking its variant with `is_none` [INFO] [stdout] --> src/solutions/year2024/day04.rs:97:22 [INFO] [stdout] | [INFO] [stdout] 91 | if m1.is_none() || m2.is_none() || s1.is_none() || s2.is_none() { [INFO] [stdout] | ------------ the check is happening here [INFO] [stdout] ... [INFO] [stdout] 97 | let s2 = s2.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day04.rs:61:42 [INFO] [stdout] | [INFO] [stdout] 61 | fn valid(&self, center: &Pos, chars: &Vec>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 61 - fn valid(&self, center: &Pos, chars: &Vec>) -> bool { [INFO] [stdout] 61 + fn valid(&self, center: &Pos, chars: &[Vec]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `xmas` [INFO] [stdout] --> src/solutions/year2024/day04.rs:137:26 [INFO] [stdout] | [INFO] [stdout] 137 | for i in 0..4 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 137 - for i in 0..4 { [INFO] [stdout] 137 + for in xmas.iter().take(4) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day05.rs:37:24 [INFO] [stdout] | [INFO] [stdout] 37 | fn sort_update(update: &mut Vec, pages: &[Option]) -> 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] 37 - fn sort_update(update: &mut Vec, pages: &[Option]) -> usize { [INFO] [stdout] 37 + fn sort_update(update: &mut [usize], pages: &[Option]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2024/day05.rs:117:16 [INFO] [stdout] | [INFO] [stdout] 117 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2024/day05.rs:157:16 [INFO] [stdout] | [INFO] [stdout] 157 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/solutions/year2024/day06.rs:113:20 [INFO] [stdout] | [INFO] [stdout] 113 | if let Some(_) = self.tick() { [INFO] [stdout] | -------^^^^^^^-------------- help: try: `if self.tick().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/solutions/year2024/day06.rs:154:65 [INFO] [stdout] | [INFO] [stdout] 154 | if ir == sys.guard.0 .0 && ic == sys.guard.0 .1 { [INFO] [stdout] | _________________________________________________________________^ [INFO] [stdout] 155 | | continue; [INFO] [stdout] 156 | | } else if !sys.map[r][c] { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/solutions/year2024/day06.rs:156:42 [INFO] [stdout] | [INFO] [stdout] 156 | } else if !sys.map[r][c] { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 157 | | continue; [INFO] [stdout] 158 | | } else { [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2024/day07.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | } else if nums.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nums.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2024/day07.rs:64:23 [INFO] [stdout] | [INFO] [stdout] 64 | } else if nums.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nums.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `free_spaces` [INFO] [stdout] --> src/solutions/year2024/day09.rs:117:22 [INFO] [stdout] | [INFO] [stdout] 117 | for i in 0..free_spaces.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 117 - for i in 0..free_spaces.len() { [INFO] [stdout] 117 + for in &mut free_spaces { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/solutions/year2024/day11.rs:24:20 [INFO] [stdout] | [INFO] [stdout] 24 | if i % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `i.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/solutions/year2024/day11.rs:69:18 [INFO] [stdout] | [INFO] [stdout] 69 | .map(|n| PlutoStone(n)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple struct itself: `PlutoStone` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day12.rs:76:52 [INFO] [stdout] | [INFO] [stdout] 76 | fn search(&self, pos: (usize, usize), visited: &mut Vec>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 76 - fn search(&self, pos: (usize, usize), visited: &mut Vec>) -> usize { [INFO] [stdout] 76 + fn search(&self, pos: (usize, usize), visited: &mut [Vec]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day12.rs:100:18 [INFO] [stdout] | [INFO] [stdout] 100 | visited: &mut Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - visited: &mut Vec>, [INFO] [stdout] 100 + visited: &mut [Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day13.rs:49:48 [INFO] [stdout] | [INFO] [stdout] 49 | fn parse_input(lines: &mut std::str::Lines) -> Option<((i64, i64), (i64, i64), (i64, i64))> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/solutions/year2024/day13.rs:51:5 [INFO] [stdout] | [INFO] [stdout] 51 | / if line.is_none() { [INFO] [stdout] 52 | | return None; [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____^ help: replace it with: `line?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `true` [INFO] [stdout] --> src/solutions/year2024/day13.rs:169:9 [INFO] [stdout] | [INFO] [stdout] 169 | assert!(true); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the assertion [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:32:14 [INFO] [stdout] | [INFO] [stdout] 32 | for i in 0..h.0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 32 - for i in 0..h.0 { [INFO] [stdout] 32 + for in robots.iter().take(h.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:33:18 [INFO] [stdout] | [INFO] [stdout] 33 | for j in 0..h.1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 33 - for j in 0..h.1 { [INFO] [stdout] 33 + for in robots.iter().take(h.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:40:14 [INFO] [stdout] | [INFO] [stdout] 40 | for i in 0..h.0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 40 - for i in 0..h.0 { [INFO] [stdout] 40 + for in robots.iter().take(h.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:41:18 [INFO] [stdout] | [INFO] [stdout] 41 | for j in (h.1 + 1)..bound.1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 41 - for j in (h.1 + 1)..bound.1 { [INFO] [stdout] 41 + for in robots.iter().take(bound.1).skip((h.1 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:48:14 [INFO] [stdout] | [INFO] [stdout] 48 | for i in (h.0 + 1)..bound.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 48 - for i in (h.0 + 1)..bound.0 { [INFO] [stdout] 48 + for in robots.iter().take(bound.0).skip((h.0 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:49:18 [INFO] [stdout] | [INFO] [stdout] 49 | for j in 0..h.1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 49 - for j in 0..h.1 { [INFO] [stdout] 49 + for in robots.iter().take(h.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:56:14 [INFO] [stdout] | [INFO] [stdout] 56 | for i in (h.0 + 1)..bound.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 56 - for i in (h.0 + 1)..bound.0 { [INFO] [stdout] 56 + for in robots.iter().take(bound.0).skip((h.0 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:57:18 [INFO] [stdout] | [INFO] [stdout] 57 | for j in (h.1 + 1)..bound.1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 57 - for j in (h.1 + 1)..bound.1 { [INFO] [stdout] 57 + for in robots.iter().take(bound.1).skip((h.1 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day14.rs:91:44 [INFO] [stdout] | [INFO] [stdout] 91 | let print = |index: usize, robots: &Vec<((i32, i32), (i32, i32))>| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day14.rs:108:29 [INFO] [stdout] | [INFO] [stdout] 108 | let tick = |robots: &mut Vec<((i32, i32), (i32, i32))>| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day14.rs:117:30 [INFO] [stdout] | [INFO] [stdout] 117 | let score = |robots: &Vec<((i32, i32), (i32, i32))>| -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:127:22 [INFO] [stdout] | [INFO] [stdout] 127 | for i in 0..h.0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 127 - for i in 0..h.0 { [INFO] [stdout] 127 + for in robots.iter().take(h.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:128:26 [INFO] [stdout] | [INFO] [stdout] 128 | for j in 0..h.1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 128 - for j in 0..h.1 { [INFO] [stdout] 128 + for in robots.iter().take(h.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:135:22 [INFO] [stdout] | [INFO] [stdout] 135 | for i in 0..h.0 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 135 - for i in 0..h.0 { [INFO] [stdout] 135 + for in robots.iter().take(h.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:136:26 [INFO] [stdout] | [INFO] [stdout] 136 | for j in (h.1 + 1)..bound.1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 136 - for j in (h.1 + 1)..bound.1 { [INFO] [stdout] 136 + for in robots.iter().take(bound.1).skip((h.1 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:143:22 [INFO] [stdout] | [INFO] [stdout] 143 | for i in (h.0 + 1)..bound.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 143 - for i in (h.0 + 1)..bound.0 { [INFO] [stdout] 143 + for in robots.iter().take(bound.0).skip((h.0 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:144:26 [INFO] [stdout] | [INFO] [stdout] 144 | for j in 0..h.1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 144 - for j in 0..h.1 { [INFO] [stdout] 144 + for in robots.iter().take(h.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:151:22 [INFO] [stdout] | [INFO] [stdout] 151 | for i in (h.0 + 1)..bound.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 151 - for i in (h.0 + 1)..bound.0 { [INFO] [stdout] 151 + for in robots.iter().take(bound.0).skip((h.0 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `robots` [INFO] [stdout] --> src/solutions/year2024/day14.rs:152:26 [INFO] [stdout] | [INFO] [stdout] 152 | for j in (h.1 + 1)..bound.1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 152 - for j in (h.1 + 1)..bound.1 { [INFO] [stdout] 152 + for in robots.iter().take(bound.1).skip((h.1 + 1)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `true` [INFO] [stdout] --> src/solutions/year2024/day14.rs:193:9 [INFO] [stdout] | [INFO] [stdout] 193 | assert!(true); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the assertion [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/solutions/year2024/day15.rs:169:22 [INFO] [stdout] | [INFO] [stdout] 169 | .map(|(c, char)| match char { [INFO] [stdout] | ______________________^ [INFO] [stdout] 170 | | '#' => [Tile2::Wall, Tile2::Wall], [INFO] [stdout] 171 | | '.' => [Tile2::Empty, Tile2::Empty], [INFO] [stdout] 172 | | 'O' => [Tile2::BoxLeft, Tile2::BoxRight], [INFO] [stdout] ... | [INFO] [stdout] 178 | | }) [INFO] [stdout] 179 | | .flatten() [INFO] [stdout] | |______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 169 ~ .flat_map(|(c, char)| match char { [INFO] [stdout] 170 + '#' => [Tile2::Wall, Tile2::Wall], [INFO] [stdout] 171 + '.' => [Tile2::Empty, Tile2::Empty], [INFO] [stdout] 172 + 'O' => [Tile2::BoxLeft, Tile2::BoxRight], [INFO] [stdout] 173 + '@' => { [INFO] [stdout] 174 + robot = (r, 2 * c); [INFO] [stdout] 175 + [Tile2::Empty, Tile2::Empty] [INFO] [stdout] 176 + } [INFO] [stdout] 177 + _ => unimplemented!(), [INFO] [stdout] 178 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/solutions/year2024/day15.rs:352:14 [INFO] [stdout] | [INFO] [stdout] 352 | .map(|line| line.chars().map(Dir::from)) [INFO] [stdout] | ______________^ [INFO] [stdout] 353 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|line| line.chars().map(Dir::from))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/solutions/year2024/day15.rs:371:14 [INFO] [stdout] | [INFO] [stdout] 371 | .map(|line| line.chars().map(Dir::from)) [INFO] [stdout] | ______________^ [INFO] [stdout] 372 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|line| line.chars().map(Dir::from))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> src/solutions/year2024/day16.rs:58:1 [INFO] [stdout] | [INFO] [stdout] 58 | / impl PartialOrd for StateWithHistory { [INFO] [stdout] 59 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 60 | | Some(self.state.cmp(&other.state)) [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 60 - Some(self.state.cmp(&other.state)) [INFO] [stdout] 61 - } [INFO] [stdout] 59 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2024/day16.rs:79:23 [INFO] [stdout] | [INFO] [stdout] 79 | Some(self.cmp(&other)) [INFO] [stdout] | ^^^^^^ help: change this to: `other` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/solutions/year2024/day18.rs:7:18 [INFO] [stdout] | [INFO] [stdout] 7 | fn simulate(map: &mut Vec>, block: (usize, usize)) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 7 - fn simulate(map: &mut Vec>, block: (usize, usize)) -> bool { [INFO] [stdout] 7 + fn simulate(map: &mut [Vec], block: (usize, usize)) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/solutions/year2024/day19.rs:22:12 [INFO] [stdout] | [INFO] [stdout] 22 | if word.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `word.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2024/day19.rs:40:16 [INFO] [stdout] | [INFO] [stdout] 40 | if word == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `word.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/solutions/year2024/day21.rs:225:23 [INFO] [stdout] | [INFO] [stdout] 225 | Some(self.cmp(&other)) [INFO] [stdout] | ^^^^^^ help: change this to: `other` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/year2024/day21.rs:474:30 [INFO] [stdout] | [INFO] [stdout] 474 | let num: usize = (&line[..3]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line[..3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/year2024/day21.rs:485:30 [INFO] [stdout] | [INFO] [stdout] 485 | let num: usize = (&line[..3]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line[..3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CONNECTED` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day23.rs:6:6 [INFO] [stdout] | [INFO] [stdout] 6 | type CONNECTED = [[bool; MAX_NODE]; MAX_NODE]; [INFO] [stdout] | ^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Connected` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/solutions/year2024/day23.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | let a = 'a' as u8 + a; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [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/solutions/year2024/day23.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | let b = 'a' as u8 + b; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/solutions/year2024/day23.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | let a = a as u8 - 'a' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/solutions/year2024/day23.rs:25:23 [INFO] [stdout] | [INFO] [stdout] 25 | let b = b as u8 - 'a' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [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: the loop variable `i` is only used to index `nodes` [INFO] [stdout] --> src/solutions/year2024/day23.rs:87:18 [INFO] [stdout] | [INFO] [stdout] 87 | for i in 0..l { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 87 - for i in 0..l { [INFO] [stdout] 87 + for in nodes.iter().take(l) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `AND` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day24.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | AND, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `And` [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 `XOR` contains a capitalized acronym [INFO] [stdout] --> src/solutions/year2024/day24.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | XOR, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Xor` [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/solutions/year2024/day24.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | depends: Option<(Gate, Rc>, Rc>)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/solutions/year2024/day24.rs:91:12 [INFO] [stdout] | [INFO] [stdout] 91 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/solutions/year2024/day24.rs:197:32 [INFO] [stdout] | [INFO] [stdout] 197 | let index: usize = (&name[1..]).parse().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `name[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: this assertion is always `true` [INFO] [stdout] --> src/solutions/year2024/day24.rs:377:9 [INFO] [stdout] | [INFO] [stdout] 377 | assert!(true); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove the assertion [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> src/solutions/year2024/day25.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | / let Some(line) = line else { [INFO] [stdout] 13 | | return None; [INFO] [stdout] 14 | | }; [INFO] [stdout] | |__________^ help: replace it with: `let line = line?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/year2019/day14.rs:224:23 [INFO] [stdout] | [INFO] [stdout] 224 | let answers = vec![31, 165, 13312, 180697, 2210736]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[31, 165, 13312, 180697, 2210736]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/year2019/day14.rs:240:23 [INFO] [stdout] | [INFO] [stdout] 240 | let answers = vec![82892753, 5586022, 460664]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[82892753, 5586022, 460664]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/year2024/day04.rs:131:16 [INFO] [stdout] | [INFO] [stdout] 131 | let xmas = vec!['X', 'M', 'A', 'S']; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `['X', 'M', 'A', 'S']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/solutions/year2024/day05.rs:21:23 [INFO] [stdout] | [INFO] [stdout] 21 | let mut visited = vec![false; NUM_PAGE]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[false; NUM_PAGE]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.48s [INFO] running `Command { std: "docker" "inspect" "c3e735cb0429456255fd5374e25b04c18210981bde4e550664a7de73e8f12b7b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c3e735cb0429456255fd5374e25b04c18210981bde4e550664a7de73e8f12b7b", kill_on_drop: false }` [INFO] [stdout] c3e735cb0429456255fd5374e25b04c18210981bde4e550664a7de73e8f12b7b