[INFO] cloning repository https://github.com/morphkurt/aoc-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/morphkurt/aoc-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmorphkurt%2Faoc-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmorphkurt%2Faoc-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 13a5bccd386116d566b5f3be737c0332f7cd3cbb [INFO] linting morphkurt/aoc-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmorphkurt%2Faoc-rust" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-1-tc1/source/.cargo/config.toml [INFO] started tweaking git repo https://github.com/morphkurt/aoc-rust [INFO] finished tweaking git repo https://github.com/morphkurt/aoc-rust [INFO] tweaked toml for git repo https://github.com/morphkurt/aoc-rust written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/morphkurt/aoc-rust 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/morphkurt/aoc-rust already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded mintex v0.1.2 [INFO] [stderr] Downloaded tinyjson v2.5.1 [INFO] [stderr] Downloaded scanf v1.2.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] a07749b7c931c617eee3278001793f5c9229686fba3cc11ed78b5edc7bc37f9b [INFO] running `Command { std: "docker" "start" "-a" "a07749b7c931c617eee3278001793f5c9229686fba3cc11ed78b5edc7bc37f9b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "a07749b7c931c617eee3278001793f5c9229686fba3cc11ed78b5edc7bc37f9b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a07749b7c931c617eee3278001793f5c9229686fba3cc11ed78b5edc7bc37f9b", kill_on_drop: false }` [INFO] [stdout] a07749b7c931c617eee3278001793f5c9229686fba3cc11ed78b5edc7bc37f9b [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 79cf008f22f1a8604f3271c5c93f2cefa12eb88c4ee1a9cfb3b7b5a7554fd21e [INFO] running `Command { std: "docker" "start" "-a" "79cf008f22f1a8604f3271c5c93f2cefa12eb88c4ee1a9cfb3b7b5a7554fd21e", kill_on_drop: false }` [INFO] [stderr] Checking memchr v2.6.4 [INFO] [stderr] Checking tinyjson v2.5.1 [INFO] [stderr] Checking pico-args v0.5.0 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking scanf v1.2.1 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking advent_of_code v0.11.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [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] 54 - data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] 54 + data.sort_unstable_by_key(|a| a.day); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:12:43 [INFO] [stdout] | [INFO] [stdout] 12 | .filter(|&designs| count_possible(&designs, &towels, &mut memo) > 0) [INFO] [stdout] | ^^^^^^^^ help: change this to: `designs` [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: stripping a prefix manually [INFO] [stdout] --> src/bin/19.rs:25:37 [INFO] [stdout] | [INFO] [stdout] 25 | count += count_possible(&pattern[towel.len()..], &towels, memo); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/19.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | if pattern.starts_with(towel) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 24 ~ if let Some() = pattern.strip_prefix(towel) { [INFO] [stdout] 25 ~ count += count_possible(, &towels, memo); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/02.rs:18:20 [INFO] [stdout] | [INFO] [stdout] 18 | if is_safe(&line) { [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/18.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | route: route, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `route` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:25:62 [INFO] [stdout] | [INFO] [stdout] 25 | count += count_possible(&pattern[towel.len()..], &towels, memo); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:39:40 [INFO] [stdout] | [INFO] [stdout] 39 | .map(|&designs| count_possible(&designs, &towels, &mut memo)) [INFO] [stdout] | ^^^^^^^^ help: change this to: `designs` [INFO] [stdout] | [INFO] [stdout] = 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/bin/02.rs:48:17 [INFO] [stdout] | [INFO] [stdout] 48 | found = found && true; [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `found` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | return found; [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] 50 - return found; [INFO] [stdout] 50 + found [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/bin/02.rs:37:18 [INFO] [stdout] | [INFO] [stdout] 37 | fn is_safe(line: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 37 - fn is_safe(line: &Vec) -> bool { [INFO] [stdout] 37 + fn is_safe(line: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `char::MAX` and `result` [INFO] [stdout] --> src/bin/17.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{char::MAX, result}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `IntoParallelIterator` and `StepBy` [INFO] [stdout] --> src/bin/17.rs:3:44 [INFO] [stdout] | [INFO] [stdout] 3 | use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator, StepBy}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/04.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | / if available.len() == 4 { [INFO] [stdout] 113 | | if (available[0].c == Some('S') && available[3].c == Some('M') [INFO] [stdout] 114 | | || available[0].c == Some('M') && available[3].c == Some('S')) [INFO] [stdout] 115 | | && (available[1].c == Some('S') && available[2].c == Some('M') [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 112 ~ if available.len() == 4 [INFO] [stdout] 113 ~ && (available[0].c == Some('S') && available[3].c == Some('M') [INFO] [stdout] 114 | || available[0].c == Some('M') && available[3].c == Some('S')) [INFO] [stdout] ... [INFO] [stdout] 118 | result += 1; [INFO] [stdout] 119 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/template/run_multi.rs:173:26 [INFO] [stdout] | [INFO] [stdout] 173 | let str_timing = line [INFO] [stdout] | __________________________^ [INFO] [stdout] 174 | | .split(" samples)") [INFO] [stdout] 175 | | .next()? [INFO] [stdout] 176 | | .split('(') [INFO] [stdout] 177 | | .last()? [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 177 - .last()? [INFO] [stdout] 177 + .next_back()? [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/bin/18.rs:84:41 [INFO] [stdout] | [INFO] [stdout] 84 | for (_, &(dx, dy)) in DIR.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] 84 - for (_, &(dx, dy)) in DIR.iter().enumerate() { [INFO] [stdout] 84 + for &(dx, dy) in DIR.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_unstable_by_key` [INFO] [stdout] --> src/template/timings.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [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] 54 - data.sort_unstable_by(|a, b| a.day.cmp(&b.day)); [INFO] [stdout] 54 + data.sort_unstable_by_key(|a| a.day); [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/bin/04.rs:143:22 [INFO] [stdout] | [INFO] [stdout] 143 | fn get_point(points: &Vec, x: usize, y: usize, w: usize) -> &Point { [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] 143 - fn get_point(points: &Vec, x: usize, y: usize, w: usize) -> &Point { [INFO] [stdout] 143 + fn get_point(points: &[Point], x: usize, y: usize, w: usize) -> &Point { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/04.rs:160:42 [INFO] [stdout] | [INFO] [stdout] 160 | let neighbor = get_point(&points, x as usize, y as usize, width); [INFO] [stdout] | ^^^^^^^ help: change this to: `points` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/04.rs:194:5 [INFO] [stdout] | [INFO] [stdout] 194 | return false; [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] 194 - return false; [INFO] [stdout] 194 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/04.rs:190:38 [INFO] [stdout] | [INFO] [stdout] 190 | let neighbor = get_point(&points, x as usize, y as usize, width); [INFO] [stdout] | ^^^^^^^ help: change this to: `points` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/10.rs:65:33 [INFO] [stdout] | [INFO] [stdout] 65 | ... x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/10.rs:66:33 [INFO] [stdout] | [INFO] [stdout] 66 | ... y: y, [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/10.rs:102:33 [INFO] [stdout] | [INFO] [stdout] 102 | ... x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/10.rs:103:33 [INFO] [stdout] | [INFO] [stdout] 103 | ... y: y, [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `file_system` [INFO] [stdout] --> src/bin/09.rs:39:14 [INFO] [stdout] | [INFO] [stdout] 39 | for i in 0..file_system.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 39 - for i in 0..file_system.len() { [INFO] [stdout] 39 + for (i, ) in file_system.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/09.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | return Some(sum); [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] 94 - return Some(sum); [INFO] [stdout] 94 + Some(sum) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `IndexedParallelIterator` [INFO] [stdout] --> src/bin/17.rs:3:19 [INFO] [stdout] | [INFO] [stdout] 3 | use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator, StepBy}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ParallelIterator` [INFO] [stdout] --> src/bin/17.rs:3:66 [INFO] [stdout] | [INFO] [stdout] 3 | use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator, StepBy}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/07.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | 'outer: while to_observe.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_observe.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/07.rs:35:46 [INFO] [stdout] | [INFO] [stdout] 35 | if result < totals[i] && current.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!current.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: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/bin/07.rs:44:10 [INFO] [stdout] | [INFO] [stdout] 44 | Some(sum as u64) [INFO] [stdout] | ^^^^^^^^^^ help: try: `sum` [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: length comparison to zero [INFO] [stdout] --> src/bin/07.rs:53:23 [INFO] [stdout] | [INFO] [stdout] 53 | 'outer: while to_observe.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_observe.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/bin/07.rs:64:46 [INFO] [stdout] | [INFO] [stdout] 64 | if result < totals[i] && current.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!current.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: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/bin/07.rs:73:10 [INFO] [stdout] | [INFO] [stdout] 73 | Some(sum as u64) [INFO] [stdout] | ^^^^^^^^^^ help: try: `sum` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `file_id` is used as a loop counter [INFO] [stdout] --> src/bin/09.rs:101:5 [INFO] [stdout] | [INFO] [stdout] 101 | for chunk in input.chars().collect::>().chunks(2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (file_id, chunk) in input.chars().collect::>().chunks(2).enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `chunk.get(0)` [INFO] [stdout] --> src/bin/09.rs:102:39 [INFO] [stdout] | [INFO] [stdout] 102 | if let Some(&file_len_char) = chunk.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `chunk.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/09.rs:144:5 [INFO] [stdout] | [INFO] [stdout] 144 | return (free_space, used_space); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 144 - return (free_space, used_space); [INFO] [stdout] 144 + (free_space, used_space) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `file_id` is used as a loop counter [INFO] [stdout] --> src/bin/09.rs:123:5 [INFO] [stdout] | [INFO] [stdout] 123 | for chunk in input.chars().collect::>().chunks(2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (file_id, chunk) in input.chars().collect::>().chunks(2).enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `chunk.get(0)` [INFO] [stdout] --> src/bin/09.rs:124:39 [INFO] [stdout] | [INFO] [stdout] 124 | if let Some(&file_len_char) = chunk.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `chunk.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `result` [INFO] [stdout] --> src/bin/17.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | let result: Vec> = (165323019388784..165363019388784) [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/17.rs:7:16 [INFO] [stdout] | [INFO] [stdout] 7 | const OPCODES: [fn(Vec, u64) -> (Vec, Option); 8] = [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 integer literal to `f64` is unnecessary [INFO] [stdout] --> src/bin/17.rs:39:24 [INFO] [stdout] | [INFO] [stdout] 39 | reg[1] = reg[0] / ((2 as f64).powf(v as f64) as u64); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/bin/17.rs:46:24 [INFO] [stdout] | [INFO] [stdout] 46 | reg[2] = reg[0] / ((2 as f64).powf(v as f64) as u64); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | reg[0] = reg[0] / ((2 as f64).powf(v as f64) as u64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `reg[0] /= ((2 as f64).powf(v as f64) as u64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/bin/17.rs:53:24 [INFO] [stdout] | [INFO] [stdout] 53 | reg[0] = reg[0] / ((2 as f64).powf(v as f64) as u64); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | r[1] = r[1] ^ operand; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `r[1] ^= operand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 63 | r[1] = r[1] ^ r[2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `r[1] ^= r[2]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `s` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/17.rs:83:26 [INFO] [stdout] | [INFO] [stdout] 82 | if s.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = s` [INFO] [stdout] 83 | out.push(s.unwrap()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [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: useless conversion to the same type: `std::slice::Iter<'_, u64>` [INFO] [stdout] --> src/bin/17.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | / out.iter() [INFO] [stdout] 90 | | .into_iter() [INFO] [stdout] | |________________________^ help: consider removing `.into_iter()`: `out.iter()` [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: name `OUTERWALL` contains a capitalized acronym [INFO] [stdout] --> src/bin/20.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | OUTERWALL(), [INFO] [stdout] | ^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Outerwall` [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: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> src/bin/17.rs:102:33 [INFO] [stdout] | [INFO] [stdout] 102 | let result: Vec> = (165323019388784..165363019388784) [INFO] [stdout] | _________________________________^ [INFO] [stdout] 103 | | .into_iter() [INFO] [stdout] | |____________________^ help: consider removing `.into_iter()`: `(165323019388784..165363019388784)` [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: name `INNER` contains a capitalized acronym [INFO] [stdout] --> src/bin/20.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | INNER(), [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Inner` [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 `EMPTY` contains a capitalized acronym [INFO] [stdout] --> src/bin/20.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | EMPTY(), [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Empty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/bin/17.rs:135:28 [INFO] [stdout] | [INFO] [stdout] 135 | let split: Vec<&str> = input.split("\n\n").into_iter().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `input.split("\n\n")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/bin/17.rs:141:34 [INFO] [stdout] | [INFO] [stdout] 141 | let program: Vec> = split[1][9..] [INFO] [stdout] | __________________________________^ [INFO] [stdout] 142 | | .split(",") [INFO] [stdout] 143 | | .into_iter() [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 141 ~ let program: Vec> = split[1][9..] [INFO] [stdout] 142 + .split(",") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/10.rs:46:11 [INFO] [stdout] | [INFO] [stdout] 46 | while to_visit.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_visit.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: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/10.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | / if node_val + 1 == value { [INFO] [stdout] 55 | | if !node.visited.contains(&(x, y)) { [INFO] [stdout] 56 | | let mut node_visited: HashSet<(i32, i32)> = node.visited.clone(); [INFO] [stdout] 57 | | node_visited.insert((node.x, node.y)); [INFO] [stdout] ... | [INFO] [stdout] 71 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 54 ~ if node_val + 1 == value [INFO] [stdout] 55 ~ && !node.visited.contains(&(x, y)) { [INFO] [stdout] 56 | let mut node_visited: HashSet<(i32, i32)> = node.visited.clone(); [INFO] [stdout] ... [INFO] [stdout] 69 | } [INFO] [stdout] 70 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/10.rs:86:11 [INFO] [stdout] | [INFO] [stdout] 86 | while to_visit.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_visit.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/10.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 94 | / if node_val + 1 == value { [INFO] [stdout] 95 | | if !node.visited.contains(&(x, y)) { [INFO] [stdout] 96 | | let mut node_visited: HashSet<(i32, i32)> = node.visited.clone(); [INFO] [stdout] 97 | | node_visited.insert((node.x, node.y)); [INFO] [stdout] ... | [INFO] [stdout] 108 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 94 ~ if node_val + 1 == value [INFO] [stdout] 95 ~ && !node.visited.contains(&(x, y)) { [INFO] [stdout] 96 | let mut node_visited: HashSet<(i32, i32)> = node.visited.clone(); [INFO] [stdout] ... [INFO] [stdout] 106 | } [INFO] [stdout] 107 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `y` is used as a loop counter [INFO] [stdout] --> src/bin/10.rs:119:5 [INFO] [stdout] | [INFO] [stdout] 119 | for line in input.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (y, line) in input.lines().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `x` is used as a loop counter [INFO] [stdout] --> src/bin/10.rs:122:9 [INFO] [stdout] | [INFO] [stdout] 122 | for number in line.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (x, number) in line.chars().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/20.rs:143:5 [INFO] [stdout] | [INFO] [stdout] 143 | return (0, Vec::new()); [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] 143 - return (0, Vec::new()); [INFO] [stdout] 143 + (0, Vec::new()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `borrow::BorrowMut`, `iter`, and `rc::Rc` [INFO] [stdout] --> src/bin/15.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{borrow::BorrowMut, collections::HashMap, iter, rc::Rc}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/20.rs:117:13 [INFO] [stdout] | [INFO] [stdout] 117 | / if grid.contains_key(&(node.loc.0 + dir.0, node.loc.1 + dir.1)) { [INFO] [stdout] 118 | | if grid [INFO] [stdout] 119 | | .get(&(node.loc.0 + dir.0, node.loc.1 + dir.1)) [INFO] [stdout] 120 | | .unwrap() [INFO] [stdout] ... | [INFO] [stdout] 140 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 117 ~ if grid.contains_key(&(node.loc.0 + dir.0, node.loc.1 + dir.1)) [INFO] [stdout] 118 ~ && grid [INFO] [stdout] 119 | .get(&(node.loc.0 + dir.0, node.loc.1 + dir.1)) [INFO] [stdout] ... [INFO] [stdout] 138 | } [INFO] [stdout] 139 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/20.rs:146:26 [INFO] [stdout] | [INFO] [stdout] 146 | fn parse(input: &str) -> (HashMap<(i32, i32), Space>, (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] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `y` is used as a loop counter [INFO] [stdout] --> src/bin/20.rs:151:5 [INFO] [stdout] | [INFO] [stdout] 151 | for rows in input.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (y, rows) in (0_i32..).zip(input.lines())` [INFO] [stdout] | [INFO] [stdout] = note: `y` is of type `i32`, making it ineligible for `Iterator::enumerate` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `x` is used as a loop counter [INFO] [stdout] --> src/bin/20.rs:153:9 [INFO] [stdout] | [INFO] [stdout] 153 | for c in rows.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (x, c) in (0_i32..).zip(rows.chars())` [INFO] [stdout] | [INFO] [stdout] = note: `x` is of type `i32`, making it ineligible for `Iterator::enumerate` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statement with no effect [INFO] [stdout] --> src/bin/20.rs:162:25 [INFO] [stdout] | [INFO] [stdout] 162 | SpaceType::OUTERWALL(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect [INFO] [stdout] = note: `#[warn(clippy::no_effect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max_x` [INFO] [stdout] --> src/bin/12.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | let max_x= region.points.iter().map(|f|f.0).max().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_max_x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max_y` [INFO] [stdout] --> src/bin/12.rs:119:9 [INFO] [stdout] | [INFO] [stdout] 119 | let max_y= region.points.iter().map(|f: &(i32, i32)|f.1).max().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_max_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `min_x` [INFO] [stdout] --> src/bin/12.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | let min_x= region.points.iter().map(|f: &(i32, i32)|f.0).min().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_min_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `min_y` [INFO] [stdout] --> src/bin/12.rs:121:9 [INFO] [stdout] | [INFO] [stdout] 121 | let min_y= region.points.iter().map(|f: &(i32, i32)|f.1).min().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_min_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Point` is never constructed [INFO] [stdout] --> src/bin/12.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 6 | struct Point { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Region` is never constructed [INFO] [stdout] --> src/bin/12.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | struct Region { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `search_region` is never used [INFO] [stdout] --> src/bin/12.rs:112:4 [INFO] [stdout] | [INFO] [stdout] 112 | fn search_region(id: i32, region_cluster: HashMap) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_region_id` is never used [INFO] [stdout] --> src/bin/12.rs:141:4 [INFO] [stdout] | [INFO] [stdout] 141 | fn get_region_id(point: (i32,i32), map: HashMap) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/12.rs:31:11 [INFO] [stdout] | [INFO] [stdout] 31 | while grid.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!grid.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/12.rs:34:15 [INFO] [stdout] | [INFO] [stdout] 34 | while to_visit.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_visit.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/12.rs:41:17 [INFO] [stdout] | [INFO] [stdout] 41 | / if grid.contains_key(&(x, y)) { [INFO] [stdout] 42 | | if grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 43 | | to_visit.insert((x, y)); [INFO] [stdout] 44 | | } [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 41 ~ if grid.contains_key(&(x, y)) [INFO] [stdout] 42 ~ && grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 43 | to_visit.insert((x, y)); [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/12.rs:46:17 [INFO] [stdout] | [INFO] [stdout] 46 | / if orignal_grid.contains_key(&(x, y)) { [INFO] [stdout] 47 | | if orignal_grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 48 | | neighbors -= 1; [INFO] [stdout] 49 | | } [INFO] [stdout] 50 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 46 ~ if orignal_grid.contains_key(&(x, y)) [INFO] [stdout] 47 ~ && orignal_grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 48 | neighbors -= 1; [INFO] [stdout] 49 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `OUTERWALL` contains a capitalized acronym [INFO] [stdout] --> src/bin/20.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | OUTERWALL(), [INFO] [stdout] | ^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Outerwall` [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 `INNER` contains a capitalized acronym [INFO] [stdout] --> src/bin/20.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | INNER(), [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Inner` [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 `EMPTY` contains a capitalized acronym [INFO] [stdout] --> src/bin/20.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | EMPTY(), [INFO] [stdout] | ^^^^^ help: consider making the acronym lowercase, except the initial letter: `Empty` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/20.rs:143:5 [INFO] [stdout] | [INFO] [stdout] 143 | return (0, Vec::new()); [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] 143 - return (0, Vec::new()); [INFO] [stdout] 143 + (0, Vec::new()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/20.rs:117:13 [INFO] [stdout] | [INFO] [stdout] 117 | / if grid.contains_key(&(node.loc.0 + dir.0, node.loc.1 + dir.1)) { [INFO] [stdout] 118 | | if grid [INFO] [stdout] 119 | | .get(&(node.loc.0 + dir.0, node.loc.1 + dir.1)) [INFO] [stdout] 120 | | .unwrap() [INFO] [stdout] ... | [INFO] [stdout] 140 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 117 ~ if grid.contains_key(&(node.loc.0 + dir.0, node.loc.1 + dir.1)) [INFO] [stdout] 118 ~ && grid [INFO] [stdout] 119 | .get(&(node.loc.0 + dir.0, node.loc.1 + dir.1)) [INFO] [stdout] ... [INFO] [stdout] 138 | } [INFO] [stdout] 139 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/20.rs:146:26 [INFO] [stdout] | [INFO] [stdout] 146 | fn parse(input: &str) -> (HashMap<(i32, i32), Space>, (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] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:97:29 [INFO] [stdout] | [INFO] [stdout] 97 | ... route: route, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `route` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:166:29 [INFO] [stdout] | [INFO] [stdout] 166 | ... route: route, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `route` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `y` is used as a loop counter [INFO] [stdout] --> src/bin/20.rs:151:5 [INFO] [stdout] | [INFO] [stdout] 151 | for rows in input.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (y, rows) in (0_i32..).zip(input.lines())` [INFO] [stdout] | [INFO] [stdout] = note: `y` is of type `i32`, making it ineligible for `Iterator::enumerate` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `x` is used as a loop counter [INFO] [stdout] --> src/bin/20.rs:153:9 [INFO] [stdout] | [INFO] [stdout] 153 | for c in rows.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (x, c) in (0_i32..).zip(rows.chars())` [INFO] [stdout] | [INFO] [stdout] = note: `x` is of type `i32`, making it ineligible for `Iterator::enumerate` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statement with no effect [INFO] [stdout] --> src/bin/20.rs:162:25 [INFO] [stdout] | [INFO] [stdout] 162 | SpaceType::OUTERWALL(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect [INFO] [stdout] = note: `#[warn(clippy::no_effect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/12.rs:74:11 [INFO] [stdout] | [INFO] [stdout] 74 | while grid.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!grid.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/bin/12.rs:78:15 [INFO] [stdout] | [INFO] [stdout] 78 | while to_visit.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_visit.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/02.rs:18:20 [INFO] [stdout] | [INFO] [stdout] 18 | if is_safe(&line) { [INFO] [stdout] | ^^^^^ help: change this to: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/02.rs:48:17 [INFO] [stdout] | [INFO] [stdout] 48 | found = found && true; [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `found` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `d` is used as a loop counter [INFO] [stdout] --> src/bin/12.rs:83:13 [INFO] [stdout] | [INFO] [stdout] 83 | for (dx, dy) in DIR.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (d, (dx, dy)) in DIR.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/12.rs:86:17 [INFO] [stdout] | [INFO] [stdout] 86 | / if grid.contains_key(&(x, y)) { [INFO] [stdout] 87 | | if grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 88 | | to_visit.insert((x, y)); [INFO] [stdout] 89 | | } [INFO] [stdout] 90 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ if grid.contains_key(&(x, y)) [INFO] [stdout] 87 ~ && grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 88 | to_visit.insert((x, y)); [INFO] [stdout] 89 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/12.rs:91:17 [INFO] [stdout] | [INFO] [stdout] 91 | / if orignal_grid.contains_key(&(x, y)) { [INFO] [stdout] 92 | | if orignal_grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 93 | | neighbors -= 1; [INFO] [stdout] 94 | | crn[d]+=1; [INFO] [stdout] 95 | | } [INFO] [stdout] 96 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 91 ~ if orignal_grid.contains_key(&(x, y)) [INFO] [stdout] 92 ~ && orignal_grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 93 | neighbors -= 1; [INFO] [stdout] 94 | crn[d]+=1; [INFO] [stdout] 95 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/02.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | return found; [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] 50 - return found; [INFO] [stdout] 50 + found [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/bin/02.rs:37:18 [INFO] [stdout] | [INFO] [stdout] 37 | fn is_safe(line: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 37 - fn is_safe(line: &Vec) -> bool { [INFO] [stdout] 37 + fn is_safe(line: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:97:29 [INFO] [stdout] | [INFO] [stdout] 97 | ... route: route, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `route` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/16.rs:166:29 [INFO] [stdout] | [INFO] [stdout] 166 | ... route: route, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `route` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/12.rs:147:5 [INFO] [stdout] | [INFO] [stdout] 147 | return -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] 147 - return -1; [INFO] [stdout] 147 + -1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `OBSTACLE` contains a capitalized acronym [INFO] [stdout] --> src/bin/06.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | OBSTACLE, [INFO] [stdout] | ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Obstacle` [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: redundant field names in struct initialization [INFO] [stdout] --> src/bin/18.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | route: route, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `route` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/10.rs:65:33 [INFO] [stdout] | [INFO] [stdout] 65 | ... x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/10.rs:66:33 [INFO] [stdout] | [INFO] [stdout] 66 | ... y: y, [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/10.rs:102:33 [INFO] [stdout] | [INFO] [stdout] 102 | ... x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/10.rs:103:33 [INFO] [stdout] | [INFO] [stdout] 103 | ... y: y, [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/bin/06.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / match self.map.get(&point) { [INFO] [stdout] 45 | | Some(Object::OBSTACLE) => true, [INFO] [stdout] 46 | | _ => false, [INFO] [stdout] 47 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 44 - match self.map.get(&point) { [INFO] [stdout] 45 - Some(Object::OBSTACLE) => true, [INFO] [stdout] 46 - _ => false, [INFO] [stdout] 47 - } [INFO] [stdout] 44 + matches!(self.map.get(&point), Some(Object::OBSTACLE)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/04.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | / if available.len() == 4 { [INFO] [stdout] 113 | | if (available[0].c == Some('S') && available[3].c == Some('M') [INFO] [stdout] 114 | | || available[0].c == Some('M') && available[3].c == Some('S')) [INFO] [stdout] 115 | | && (available[1].c == Some('S') && available[2].c == Some('M') [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 112 ~ if available.len() == 4 [INFO] [stdout] 113 ~ && (available[0].c == Some('S') && available[3].c == Some('M') [INFO] [stdout] 114 | || available[0].c == Some('M') && available[3].c == Some('S')) [INFO] [stdout] ... [INFO] [stdout] 118 | result += 1; [INFO] [stdout] 119 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dir` [INFO] [stdout] --> src/bin/15.rs:84:16 [INFO] [stdout] | [INFO] [stdout] 84 | let (grid, dir,w,h) = parse_pt2(input); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_dir` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) 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/bin/04.rs:143:22 [INFO] [stdout] | [INFO] [stdout] 143 | fn get_point(points: &Vec, x: usize, y: usize, w: usize) -> &Point { [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] 143 - fn get_point(points: &Vec, x: usize, y: usize, w: usize) -> &Point { [INFO] [stdout] 143 + fn get_point(points: &[Point], x: usize, y: usize, w: usize) -> &Point { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/04.rs:160:42 [INFO] [stdout] | [INFO] [stdout] 160 | let neighbor = get_point(&points, x as usize, y as usize, width); [INFO] [stdout] | ^^^^^^^ help: change this to: `points` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/04.rs:194:5 [INFO] [stdout] | [INFO] [stdout] 194 | return false; [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] 194 - return false; [INFO] [stdout] 194 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Movable` is never used [INFO] [stdout] --> src/bin/15.rs:24:7 [INFO] [stdout] | [INFO] [stdout] 24 | trait Movable { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | self.pos[0][0] = self.pos[0][0] + DIR[dir as usize].0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[0][0] += DIR[dir as usize].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | self.pos[0][1] = self.pos[0][1] + DIR[dir as usize].1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[0][1] += DIR[dir as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | self.pos[1][0] = self.pos[1][0] + DIR[dir as usize].0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[1][0] += DIR[dir as usize].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | self.pos[1][1] = self.pos[1][1] + DIR[dir as usize].1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[1][1] += DIR[dir as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | self.pos[0] = self.pos[0] + DIR[dir as usize].0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[0] += DIR[dir as usize].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | self.pos[1] = self.pos[1] + DIR[dir as usize].1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[1] += DIR[dir as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/10.rs:46:11 [INFO] [stdout] | [INFO] [stdout] 46 | while to_visit.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_visit.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: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/10.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | / if node_val + 1 == value { [INFO] [stdout] 55 | | if !node.visited.contains(&(x, y)) { [INFO] [stdout] 56 | | let mut node_visited: HashSet<(i32, i32)> = node.visited.clone(); [INFO] [stdout] 57 | | node_visited.insert((node.x, node.y)); [INFO] [stdout] ... | [INFO] [stdout] 71 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 54 ~ if node_val + 1 == value [INFO] [stdout] 55 ~ && !node.visited.contains(&(x, y)) { [INFO] [stdout] 56 | let mut node_visited: HashSet<(i32, i32)> = node.visited.clone(); [INFO] [stdout] ... [INFO] [stdout] 69 | } [INFO] [stdout] 70 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/10.rs:86:11 [INFO] [stdout] | [INFO] [stdout] 86 | while to_visit.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_visit.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/10.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 94 | / if node_val + 1 == value { [INFO] [stdout] 95 | | if !node.visited.contains(&(x, y)) { [INFO] [stdout] 96 | | let mut node_visited: HashSet<(i32, i32)> = node.visited.clone(); [INFO] [stdout] 97 | | node_visited.insert((node.x, node.y)); [INFO] [stdout] ... | [INFO] [stdout] 108 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 94 ~ if node_val + 1 == value [INFO] [stdout] 95 ~ && !node.visited.contains(&(x, y)) { [INFO] [stdout] 96 | let mut node_visited: HashSet<(i32, i32)> = node.visited.clone(); [INFO] [stdout] ... [INFO] [stdout] 106 | } [INFO] [stdout] 107 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/15.rs:93:23 [INFO] [stdout] | [INFO] [stdout] 93 | .map(|(k, _)| k.clone()) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` 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/bin/04.rs:190:38 [INFO] [stdout] | [INFO] [stdout] 190 | let neighbor = get_point(&points, x as usize, y as usize, width); [INFO] [stdout] | ^^^^^^^ help: change this to: `points` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `y` is used as a loop counter [INFO] [stdout] --> src/bin/10.rs:119:5 [INFO] [stdout] | [INFO] [stdout] 119 | for line in input.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (y, line) in input.lines().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `x` is used as a loop counter [INFO] [stdout] --> src/bin/10.rs:122:9 [INFO] [stdout] | [INFO] [stdout] 122 | for number in line.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (x, number) in line.chars().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/15.rs:124:26 [INFO] [stdout] | [INFO] [stdout] 124 | fn parse(input: &str) -> (HashMap<(i32, i32), char>, Vec, (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] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/15.rs:140:13 [INFO] [stdout] | [INFO] [stdout] 140 | / return match c { [INFO] [stdout] 141 | | '^' => 0, [INFO] [stdout] 142 | | '>' => 1, [INFO] [stdout] 143 | | 'v' => 2, [INFO] [stdout] 144 | | '<' => 3, [INFO] [stdout] 145 | | _ => 0, [INFO] [stdout] 146 | | }; [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] 140 ~ match c { [INFO] [stdout] 141 + '^' => 0, [INFO] [stdout] 142 + '>' => 1, [INFO] [stdout] 143 + 'v' => 2, [INFO] [stdout] 144 + '<' => 3, [INFO] [stdout] 145 + _ => 0, [INFO] [stdout] 146 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/15.rs:194:13 [INFO] [stdout] | [INFO] [stdout] 194 | / return match c { [INFO] [stdout] 195 | | '^' => 0, [INFO] [stdout] 196 | | '>' => 1, [INFO] [stdout] 197 | | 'v' => 2, [INFO] [stdout] 198 | | '<' => 3, [INFO] [stdout] 199 | | _ => 0, [INFO] [stdout] 200 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 194 ~ match c { [INFO] [stdout] 195 + '^' => 0, [INFO] [stdout] 196 + '>' => 1, [INFO] [stdout] 197 + 'v' => 2, [INFO] [stdout] 198 + '<' => 3, [INFO] [stdout] 199 + _ => 0, [INFO] [stdout] 200 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/15.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 211 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/15.rs:239:9 [INFO] [stdout] | [INFO] [stdout] 239 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/15.rs:267:5 [INFO] [stdout] | [INFO] [stdout] 267 | return Some(Obstacle::Empty(Empty {})); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 267 - return Some(Obstacle::Empty(Empty {})); [INFO] [stdout] 267 + Some(Obstacle::Empty(Empty {})) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, char>` [INFO] [stdout] --> src/bin/06.rs:130:22 [INFO] [stdout] | [INFO] [stdout] 130 | for (y, line) in input.split('\n').into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `input.split('\n')` [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: unused variable: `input` [INFO] [stdout] --> src/bin/13.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/bin/18.rs:84:41 [INFO] [stdout] | [INFO] [stdout] 84 | for (_, &(dx, dy)) in DIR.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] 84 - for (_, &(dx, dy)) in DIR.iter().enumerate() { [INFO] [stdout] 84 + for &(dx, dy) in DIR.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/13.rs:18:62 [INFO] [stdout] | [INFO] [stdout] 18 | let s: u64 = g.iter().map(|f|calc(f.clone())).filter(|f|f.len() > 0).map(|f| 3* f[0]+ 1*f[1]).sum(); [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!f.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: this operation has no effect [INFO] [stdout] --> src/bin/13.rs:18:92 [INFO] [stdout] | [INFO] [stdout] 18 | let s: u64 = g.iter().map(|f|calc(f.clone())).filter(|f|f.len() > 0).map(|f| 3* f[0]+ 1*f[1]).sum(); [INFO] [stdout] | ^^^^^^ help: consider reducing it to: `f[1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/bin/13.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | Some(s as u64) [INFO] [stdout] | ^^^^^^^^ help: try: `s` [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: compiling a regex in a loop [INFO] [stdout] --> src/bin/13.rs:44:22 [INFO] [stdout] | [INFO] [stdout] 44 | let re = Regex::new(r"[+-]?\d+").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/13.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | for line in game.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/16.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | i32, usize, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/16.rs:4:10 [INFO] [stdout] | [INFO] [stdout] 4 | i32, usize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/16.rs:177:30 [INFO] [stdout] | [INFO] [stdout] 177 | pub fn parse(input: &str) -> (HashMap<(i32, i32), char>, (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] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/16.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | i32, usize, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/16.rs:4:10 [INFO] [stdout] | [INFO] [stdout] 4 | i32, usize, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:45:51 [INFO] [stdout] | [INFO] [stdout] 45 | fn is_ordered(map: &HashMap>, item: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 45 - fn is_ordered(map: &HashMap>, item: &Vec) -> bool { [INFO] [stdout] 45 + fn is_ordered(map: &HashMap>, item: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/05.rs:49:16 [INFO] [stdout] | [INFO] [stdout] 49 | if dep.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!dep.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: the loop variable `j` is only used to index `item` [INFO] [stdout] --> src/bin/05.rs:50:26 [INFO] [stdout] | [INFO] [stdout] 50 | for j in i + 1..item.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 50 - for j in i + 1..item.len() { [INFO] [stdout] 50 + for in item.iter().skip(i + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/bin/05.rs:72:24 [INFO] [stdout] | [INFO] [stdout] 72 | map.entry(key).or_insert_with(Vec::new).push(value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/bin/05.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | while let Some(part) = parts.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for part in parts` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `char::MAX` and `result` [INFO] [stdout] --> src/bin/17.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{char::MAX, result}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `IntoParallelIterator` and `StepBy` [INFO] [stdout] --> src/bin/17.rs:3:44 [INFO] [stdout] | [INFO] [stdout] 3 | use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator, StepBy}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `borrow::BorrowMut`, `iter`, and `rc::Rc` [INFO] [stdout] --> src/bin/15.rs:1:11 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{borrow::BorrowMut, collections::HashMap, iter, rc::Rc}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^ ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `IndexedParallelIterator` [INFO] [stdout] --> src/bin/17.rs:3:19 [INFO] [stdout] | [INFO] [stdout] 3 | use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator, StepBy}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/13.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ParallelIterator` [INFO] [stdout] --> src/bin/17.rs:3:66 [INFO] [stdout] | [INFO] [stdout] 3 | use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator, StepBy}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `result` [INFO] [stdout] --> src/bin/17.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | let result: Vec> = (165323019388784..165363019388784) [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/17.rs:7:16 [INFO] [stdout] | [INFO] [stdout] 7 | const OPCODES: [fn(Vec, u64) -> (Vec, Option); 8] = [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 integer literal to `f64` is unnecessary [INFO] [stdout] --> src/bin/17.rs:39:24 [INFO] [stdout] | [INFO] [stdout] 39 | reg[1] = reg[0] / ((2 as f64).powf(v as f64) as u64); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/bin/17.rs:46:24 [INFO] [stdout] | [INFO] [stdout] 46 | reg[2] = reg[0] / ((2 as f64).powf(v as f64) as u64); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | reg[0] = reg[0] / ((2 as f64).powf(v as f64) as u64); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `reg[0] /= ((2 as f64).powf(v as f64) as u64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `f64` is unnecessary [INFO] [stdout] --> src/bin/17.rs:53:24 [INFO] [stdout] | [INFO] [stdout] 53 | reg[0] = reg[0] / ((2 as f64).powf(v as f64) as u64); [INFO] [stdout] | ^^^^^^^^^^ help: try: `2_f64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | r[1] = r[1] ^ operand; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `r[1] ^= operand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/17.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 63 | r[1] = r[1] ^ r[2]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `r[1] ^= r[2]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `s` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/17.rs:83:26 [INFO] [stdout] | [INFO] [stdout] 82 | if s.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = s` [INFO] [stdout] 83 | out.push(s.unwrap()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [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: name `OBSTACLE` contains a capitalized acronym [INFO] [stdout] --> src/bin/06.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | OBSTACLE, [INFO] [stdout] | ^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Obstacle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `file_system` [INFO] [stdout] --> src/bin/09.rs:39:14 [INFO] [stdout] | [INFO] [stdout] 39 | for i in 0..file_system.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 39 - for i in 0..file_system.len() { [INFO] [stdout] 39 + for (i, ) in file_system.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/09.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | return Some(sum); [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] 94 - return Some(sum); [INFO] [stdout] 94 + Some(sum) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max_x` [INFO] [stdout] --> src/bin/12.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | let max_x= region.points.iter().map(|f|f.0).max().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_max_x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `max_y` [INFO] [stdout] --> src/bin/12.rs:119:9 [INFO] [stdout] | [INFO] [stdout] 119 | let max_y= region.points.iter().map(|f: &(i32, i32)|f.1).max().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_max_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `min_x` [INFO] [stdout] --> src/bin/12.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | let min_x= region.points.iter().map(|f: &(i32, i32)|f.0).min().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_min_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `min_y` [INFO] [stdout] --> src/bin/12.rs:121:9 [INFO] [stdout] | [INFO] [stdout] 121 | let min_y= region.points.iter().map(|f: &(i32, i32)|f.1).min().unwrap(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_min_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Point` is never constructed [INFO] [stdout] --> src/bin/12.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 6 | struct Point { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Region` is never constructed [INFO] [stdout] --> src/bin/12.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | struct Region { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `search_region` is never used [INFO] [stdout] --> src/bin/12.rs:112:4 [INFO] [stdout] | [INFO] [stdout] 112 | fn search_region(id: i32, region_cluster: HashMap) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_region_id` is never used [INFO] [stdout] --> src/bin/12.rs:141:4 [INFO] [stdout] | [INFO] [stdout] 141 | fn get_region_id(point: (i32,i32), map: HashMap) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `file_id` is used as a loop counter [INFO] [stdout] --> src/bin/09.rs:101:5 [INFO] [stdout] | [INFO] [stdout] 101 | for chunk in input.chars().collect::>().chunks(2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (file_id, chunk) in input.chars().collect::>().chunks(2).enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `chunk.get(0)` [INFO] [stdout] --> src/bin/09.rs:102:39 [INFO] [stdout] | [INFO] [stdout] 102 | if let Some(&file_len_char) = chunk.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `chunk.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/09.rs:144:5 [INFO] [stdout] | [INFO] [stdout] 144 | return (free_space, used_space); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 144 - return (free_space, used_space); [INFO] [stdout] 144 + (free_space, used_space) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `file_id` is used as a loop counter [INFO] [stdout] --> src/bin/09.rs:123:5 [INFO] [stdout] | [INFO] [stdout] 123 | for chunk in input.chars().collect::>().chunks(2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (file_id, chunk) in input.chars().collect::>().chunks(2).enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `chunk.get(0)` [INFO] [stdout] --> src/bin/09.rs:124:39 [INFO] [stdout] | [INFO] [stdout] 124 | if let Some(&file_len_char) = chunk.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `chunk.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/13.rs:18:62 [INFO] [stdout] | [INFO] [stdout] 18 | let s: u64 = g.iter().map(|f|calc(f.clone())).filter(|f|f.len() > 0).map(|f| 3* f[0]+ 1*f[1]).sum(); [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!f.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: this operation has no effect [INFO] [stdout] --> src/bin/13.rs:18:92 [INFO] [stdout] | [INFO] [stdout] 18 | let s: u64 = g.iter().map(|f|calc(f.clone())).filter(|f|f.len() > 0).map(|f| 3* f[0]+ 1*f[1]).sum(); [INFO] [stdout] | ^^^^^^ help: consider reducing it to: `f[1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/12.rs:31:11 [INFO] [stdout] | [INFO] [stdout] 31 | while grid.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!grid.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: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/bin/13.rs:19:10 [INFO] [stdout] | [INFO] [stdout] 19 | Some(s as u64) [INFO] [stdout] | ^^^^^^^^ help: try: `s` [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: length comparison to zero [INFO] [stdout] --> src/bin/12.rs:34:15 [INFO] [stdout] | [INFO] [stdout] 34 | while to_visit.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_visit.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/12.rs:41:17 [INFO] [stdout] | [INFO] [stdout] 41 | / if grid.contains_key(&(x, y)) { [INFO] [stdout] 42 | | if grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 43 | | to_visit.insert((x, y)); [INFO] [stdout] 44 | | } [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 41 ~ if grid.contains_key(&(x, y)) [INFO] [stdout] 42 ~ && grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 43 | to_visit.insert((x, y)); [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/12.rs:46:17 [INFO] [stdout] | [INFO] [stdout] 46 | / if orignal_grid.contains_key(&(x, y)) { [INFO] [stdout] 47 | | if orignal_grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 48 | | neighbors -= 1; [INFO] [stdout] 49 | | } [INFO] [stdout] 50 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 46 ~ if orignal_grid.contains_key(&(x, y)) [INFO] [stdout] 47 ~ && orignal_grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 48 | neighbors -= 1; [INFO] [stdout] 49 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: compiling a regex in a loop [INFO] [stdout] --> src/bin/13.rs:44:22 [INFO] [stdout] | [INFO] [stdout] 44 | let re = Regex::new(r"[+-]?\d+").unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: move the regex construction outside this loop [INFO] [stdout] --> src/bin/13.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | for line in game.lines() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops [INFO] [stdout] = note: `#[warn(clippy::regex_creation_in_loops)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::slice::Iter<'_, u64>` [INFO] [stdout] --> src/bin/17.rs:89:9 [INFO] [stdout] | [INFO] [stdout] 89 | / out.iter() [INFO] [stdout] 90 | | .into_iter() [INFO] [stdout] | |________________________^ help: consider removing `.into_iter()`: `out.iter()` [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: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> src/bin/17.rs:102:33 [INFO] [stdout] | [INFO] [stdout] 102 | let result: Vec> = (165323019388784..165363019388784) [INFO] [stdout] | _________________________________^ [INFO] [stdout] 103 | | .into_iter() [INFO] [stdout] | |____________________^ help: consider removing `.into_iter()`: `(165323019388784..165363019388784)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/bin/17.rs:135:28 [INFO] [stdout] | [INFO] [stdout] 135 | let split: Vec<&str> = input.split("\n\n").into_iter().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `input.split("\n\n")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/bin/17.rs:141:34 [INFO] [stdout] | [INFO] [stdout] 141 | let program: Vec> = split[1][9..] [INFO] [stdout] | __________________________________^ [INFO] [stdout] 142 | | .split(",") [INFO] [stdout] 143 | | .into_iter() [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 141 ~ let program: Vec> = split[1][9..] [INFO] [stdout] 142 + .split(",") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/bin/06.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | / match self.map.get(&point) { [INFO] [stdout] 45 | | Some(Object::OBSTACLE) => true, [INFO] [stdout] 46 | | _ => false, [INFO] [stdout] 47 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 44 - match self.map.get(&point) { [INFO] [stdout] 45 - Some(Object::OBSTACLE) => true, [INFO] [stdout] 46 - _ => false, [INFO] [stdout] 47 - } [INFO] [stdout] 44 + matches!(self.map.get(&point), Some(Object::OBSTACLE)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/12.rs:74:11 [INFO] [stdout] | [INFO] [stdout] 74 | while grid.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!grid.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/bin/12.rs:78:15 [INFO] [stdout] | [INFO] [stdout] 78 | while to_visit.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_visit.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `d` is used as a loop counter [INFO] [stdout] --> src/bin/12.rs:83:13 [INFO] [stdout] | [INFO] [stdout] 83 | for (dx, dy) in DIR.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (d, (dx, dy)) in DIR.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/12.rs:86:17 [INFO] [stdout] | [INFO] [stdout] 86 | / if grid.contains_key(&(x, y)) { [INFO] [stdout] 87 | | if grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 88 | | to_visit.insert((x, y)); [INFO] [stdout] 89 | | } [INFO] [stdout] 90 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 86 ~ if grid.contains_key(&(x, y)) [INFO] [stdout] 87 ~ && grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 88 | to_visit.insert((x, y)); [INFO] [stdout] 89 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/12.rs:91:17 [INFO] [stdout] | [INFO] [stdout] 91 | / if orignal_grid.contains_key(&(x, y)) { [INFO] [stdout] 92 | | if orignal_grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 93 | | neighbors -= 1; [INFO] [stdout] 94 | | crn[d]+=1; [INFO] [stdout] 95 | | } [INFO] [stdout] 96 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 91 ~ if orignal_grid.contains_key(&(x, y)) [INFO] [stdout] 92 ~ && orignal_grid.get(&(x, y)).unwrap() == grid.get(&(node.0, node.1)).unwrap() { [INFO] [stdout] 93 | neighbors -= 1; [INFO] [stdout] 94 | crn[d]+=1; [INFO] [stdout] 95 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/12.rs:147:5 [INFO] [stdout] | [INFO] [stdout] 147 | return -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] 147 - return -1; [INFO] [stdout] 147 + -1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/07.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | 'outer: while to_observe.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_observe.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/07.rs:35:46 [INFO] [stdout] | [INFO] [stdout] 35 | if result < totals[i] && current.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!current.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: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/bin/07.rs:44:10 [INFO] [stdout] | [INFO] [stdout] 44 | Some(sum as u64) [INFO] [stdout] | ^^^^^^^^^^ help: try: `sum` [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: length comparison to zero [INFO] [stdout] --> src/bin/07.rs:53:23 [INFO] [stdout] | [INFO] [stdout] 53 | 'outer: while to_observe.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!to_observe.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/bin/07.rs:64:46 [INFO] [stdout] | [INFO] [stdout] 64 | if result < totals[i] && current.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!current.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: unused variable: `dir` [INFO] [stdout] --> src/bin/15.rs:84:16 [INFO] [stdout] | [INFO] [stdout] 84 | let (grid, dir,w,h) = parse_pt2(input); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_dir` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u64` -> `u64`) [INFO] [stdout] --> src/bin/07.rs:73:10 [INFO] [stdout] | [INFO] [stdout] 73 | Some(sum as u64) [INFO] [stdout] | ^^^^^^^^^^ help: try: `sum` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/16.rs:177:30 [INFO] [stdout] | [INFO] [stdout] 177 | pub fn parse(input: &str) -> (HashMap<(i32, i32), char>, (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] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, char>` [INFO] [stdout] --> src/bin/06.rs:130:22 [INFO] [stdout] | [INFO] [stdout] 130 | for (y, line) in input.split('\n').into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `input.split('\n')` [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: trait `Movable` is never used [INFO] [stdout] --> src/bin/15.rs:24:7 [INFO] [stdout] | [INFO] [stdout] 24 | trait Movable { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | self.pos[0][0] = self.pos[0][0] + DIR[dir as usize].0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[0][0] += DIR[dir as usize].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | self.pos[0][1] = self.pos[0][1] + DIR[dir as usize].1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[0][1] += DIR[dir as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | self.pos[1][0] = self.pos[1][0] + DIR[dir as usize].0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[1][0] += DIR[dir as usize].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | self.pos[1][1] = self.pos[1][1] + DIR[dir as usize].1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[1][1] += DIR[dir as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | self.pos[0] = self.pos[0] + DIR[dir as usize].0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[0] += DIR[dir as usize].0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/15.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | self.pos[1] = self.pos[1] + DIR[dir as usize].1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.pos[1] += DIR[dir as usize].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, char>` [INFO] [stdout] --> src/bin/08.rs:165:22 [INFO] [stdout] | [INFO] [stdout] 165 | for (y, line) in input.split('\n').into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `input.split('\n')` [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: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/15.rs:93:23 [INFO] [stdout] | [INFO] [stdout] 93 | .map(|(k, _)| k.clone()) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*k` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/15.rs:124:26 [INFO] [stdout] | [INFO] [stdout] 124 | fn parse(input: &str) -> (HashMap<(i32, i32), char>, Vec, (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] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/15.rs:140:13 [INFO] [stdout] | [INFO] [stdout] 140 | / return match c { [INFO] [stdout] 141 | | '^' => 0, [INFO] [stdout] 142 | | '>' => 1, [INFO] [stdout] 143 | | 'v' => 2, [INFO] [stdout] 144 | | '<' => 3, [INFO] [stdout] 145 | | _ => 0, [INFO] [stdout] 146 | | }; [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] 140 ~ match c { [INFO] [stdout] 141 + '^' => 0, [INFO] [stdout] 142 + '>' => 1, [INFO] [stdout] 143 + 'v' => 2, [INFO] [stdout] 144 + '<' => 3, [INFO] [stdout] 145 + _ => 0, [INFO] [stdout] 146 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/15.rs:194:13 [INFO] [stdout] | [INFO] [stdout] 194 | / return match c { [INFO] [stdout] 195 | | '^' => 0, [INFO] [stdout] 196 | | '>' => 1, [INFO] [stdout] 197 | | 'v' => 2, [INFO] [stdout] 198 | | '<' => 3, [INFO] [stdout] 199 | | _ => 0, [INFO] [stdout] 200 | | }; [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 194 ~ match c { [INFO] [stdout] 195 + '^' => 0, [INFO] [stdout] 196 + '>' => 1, [INFO] [stdout] 197 + 'v' => 2, [INFO] [stdout] 198 + '<' => 3, [INFO] [stdout] 199 + _ => 0, [INFO] [stdout] 200 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/15.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 211 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/15.rs:239:9 [INFO] [stdout] | [INFO] [stdout] 239 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/15.rs:267:5 [INFO] [stdout] | [INFO] [stdout] 267 | return Some(Obstacle::Empty(Empty {})); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 267 - return Some(Obstacle::Empty(Empty {})); [INFO] [stdout] 267 + Some(Obstacle::Empty(Empty {})) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:12:43 [INFO] [stdout] | [INFO] [stdout] 12 | .filter(|&designs| count_possible(&designs, &towels, &mut memo) > 0) [INFO] [stdout] | ^^^^^^^^ help: change this to: `designs` [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: stripping a prefix manually [INFO] [stdout] --> src/bin/19.rs:25:37 [INFO] [stdout] | [INFO] [stdout] 25 | count += count_possible(&pattern[towel.len()..], &towels, memo); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/bin/19.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | if pattern.starts_with(towel) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 24 ~ if let Some() = pattern.strip_prefix(towel) { [INFO] [stdout] 25 ~ count += count_possible(, &towels, memo); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:25:62 [INFO] [stdout] | [INFO] [stdout] 25 | count += count_possible(&pattern[towel.len()..], &towels, memo); [INFO] [stdout] | ^^^^^^^ help: change this to: `towels` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/19.rs:39:40 [INFO] [stdout] | [INFO] [stdout] 39 | .map(|&designs| count_possible(&designs, &towels, &mut memo)) [INFO] [stdout] | ^^^^^^^^ help: change this to: `designs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/14.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/bin/14.rs:58:28 [INFO] [stdout] | [INFO] [stdout] 58 | fn print_matrix_with_point(x: usize, y: usize, set: HashSet) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/bin/14.rs:58:38 [INFO] [stdout] | [INFO] [stdout] 58 | fn print_matrix_with_point(x: usize, y: usize, set: HashSet) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/14.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, i32}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/14.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | return vec![f[0], f[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] 30 - return vec![f[0], f[1]]; [INFO] [stdout] 30 + vec![f[0], f[1]] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Lines<'_>` [INFO] [stdout] --> src/bin/14.rs:79:5 [INFO] [stdout] | [INFO] [stdout] 79 | / input [INFO] [stdout] 80 | | .lines() [INFO] [stdout] 81 | | .into_iter() [INFO] [stdout] | |____________________^ [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] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 79 ~ input [INFO] [stdout] 80 + .lines() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, char>` [INFO] [stdout] --> src/bin/08.rs:165:22 [INFO] [stdout] | [INFO] [stdout] 165 | for (y, line) in input.split('\n').into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `input.split('\n')` [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 `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/05.rs:45:51 [INFO] [stdout] | [INFO] [stdout] 45 | fn is_ordered(map: &HashMap>, item: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 45 - fn is_ordered(map: &HashMap>, item: &Vec) -> bool { [INFO] [stdout] 45 + fn is_ordered(map: &HashMap>, item: &[i32]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/05.rs:49:16 [INFO] [stdout] | [INFO] [stdout] 49 | if dep.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!dep.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: the loop variable `j` is only used to index `item` [INFO] [stdout] --> src/bin/05.rs:50:26 [INFO] [stdout] | [INFO] [stdout] 50 | for j in i + 1..item.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 50 - for j in i + 1..item.len() { [INFO] [stdout] 50 + for in item.iter().skip(i + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/14.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/bin/14.rs:58:28 [INFO] [stdout] | [INFO] [stdout] 58 | fn print_matrix_with_point(x: usize, y: usize, set: HashSet) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/bin/05.rs:72:24 [INFO] [stdout] | [INFO] [stdout] 72 | map.entry(key).or_insert_with(Vec::new).push(value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/bin/05.rs:78:9 [INFO] [stdout] | [INFO] [stdout] 78 | while let Some(part) = parts.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for part in parts` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/bin/14.rs:58:38 [INFO] [stdout] | [INFO] [stdout] 58 | fn print_matrix_with_point(x: usize, y: usize, set: HashSet) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/bin/14.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, i32}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/14.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | return vec![f[0], f[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] 30 - return vec![f[0], f[1]]; [INFO] [stdout] 30 + vec![f[0], f[1]] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Lines<'_>` [INFO] [stdout] --> src/bin/14.rs:79:5 [INFO] [stdout] | [INFO] [stdout] 79 | / input [INFO] [stdout] 80 | | .lines() [INFO] [stdout] 81 | | .into_iter() [INFO] [stdout] | |____________________^ [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] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 79 ~ input [INFO] [stdout] 80 + .lines() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.10s [INFO] running `Command { std: "docker" "inspect" "79cf008f22f1a8604f3271c5c93f2cefa12eb88c4ee1a9cfb3b7b5a7554fd21e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "79cf008f22f1a8604f3271c5c93f2cefa12eb88c4ee1a9cfb3b7b5a7554fd21e", kill_on_drop: false }` [INFO] [stdout] 79cf008f22f1a8604f3271c5c93f2cefa12eb88c4ee1a9cfb3b7b5a7554fd21e