[INFO] cloning repository https://github.com/mturner47/advent_of_code_rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mturner47/advent_of_code_rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmturner47%2Fadvent_of_code_rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmturner47%2Fadvent_of_code_rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 062c876b605fd0d06b5e74843fd0769a7c4abdd0 [INFO] linting mturner47/advent_of_code_rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmturner47%2Fadvent_of_code_rust" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/mturner47/advent_of_code_rust [INFO] finished tweaking git repo https://github.com/mturner47/advent_of_code_rust [INFO] tweaked toml for git repo https://github.com/mturner47/advent_of_code_rust written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/mturner47/advent_of_code_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/mturner47/advent_of_code_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] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 4d5b9f6e8eb518000ca2f32ed8bd01b3f786585940840c339dbf63fe9d10a320 [INFO] running `Command { std: "docker" "start" "-a" "4d5b9f6e8eb518000ca2f32ed8bd01b3f786585940840c339dbf63fe9d10a320", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "4d5b9f6e8eb518000ca2f32ed8bd01b3f786585940840c339dbf63fe9d10a320", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4d5b9f6e8eb518000ca2f32ed8bd01b3f786585940840c339dbf63fe9d10a320", kill_on_drop: false }` [INFO] [stdout] 4d5b9f6e8eb518000ca2f32ed8bd01b3f786585940840c339dbf63fe9d10a320 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 2229a44061649f03e0f2eca51d02cf30bd147938a596663054a888ca1eafebfd [INFO] running `Command { std: "docker" "start" "-a" "2229a44061649f03e0f2eca51d02cf30bd147938a596663054a888ca1eafebfd", kill_on_drop: false }` [INFO] [stderr] Checking advent_of_code v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: usage of `.map(...).all(identity)` [INFO] [stdout] --> src/year2020/day4.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | .map(|rk| { [INFO] [stdout] | __________________^ [INFO] [stdout] 29 | | let matching_kvp_option = [INFO] [stdout] 30 | | key_value_pairs.iter().filter(|kvp| kvp.0 == *rk).next(); [INFO] [stdout] 31 | | if matching_kvp_option == None { [INFO] [stdout] ... | [INFO] [stdout] 49 | | }) [INFO] [stdout] 50 | | .all(|x| x) [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity [INFO] [stdout] = note: `#[warn(clippy::map_all_any_identity)]` on by default [INFO] [stdout] help: use `.all(...)` instead [INFO] [stdout] | [INFO] [stdout] 28 ~ .all(|rk| { [INFO] [stdout] 29 + let matching_kvp_option = [INFO] [stdout] 30 + key_value_pairs.iter().filter(|kvp| kvp.0 == *rk).next(); [INFO] [stdout] 31 + if matching_kvp_option == None { [INFO] [stdout] 32 + false [INFO] [stdout] 33 + } else if !should_do_hard_mode { [INFO] [stdout] 34 + true [INFO] [stdout] 35 + } else { [INFO] [stdout] 36 + let matching_kvp = matching_kvp_option.unwrap(); [INFO] [stdout] 37 + let value = matching_kvp.1; [INFO] [stdout] 38 + match *rk { [INFO] [stdout] 39 + "byr" => is_in_range(value, 1920, 2002), [INFO] [stdout] 40 + "iyr" => is_in_range(value, 2010, 2020), [INFO] [stdout] 41 + "eyr" => is_in_range(value, 2020, 2030), [INFO] [stdout] 42 + "hgt" => is_valid_height(value), [INFO] [stdout] 43 + "hcl" => hair_color_regex.is_match(value), [INFO] [stdout] 44 + "ecl" => valid_eye_colors.contains(&value), [INFO] [stdout] 45 + "pid" => passport_id_regex.is_match(value), [INFO] [stdout] 46 + _ => false, [INFO] [stdout] 47 + } [INFO] [stdout] 48 + } [INFO] [stdout] 49 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2020/day4.rs:30:25 [INFO] [stdout] | [INFO] [stdout] 30 | key_value_pairs.iter().filter(|kvp| kvp.0 == *rk).next(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `key_value_pairs.iter().find(|kvp| kvp.0 == *rk)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/year2020/day4.rs:31:24 [INFO] [stdout] | [INFO] [stdout] 31 | if matching_kvp_option == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `matching_kvp_option.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2020/day5.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | ...rue => seat_values.iter().filter(|sv| !seat_values.contains(&(**sv - 1)) && seat_values.contains(&(*sv - 2))).next().unwrap() - 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `seat_values.iter().find(|sv| !seat_values.contains(&(**sv - 1)) && seat_values.contains(&(*sv - 2)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `.map(...).all(identity)` [INFO] [stdout] --> src/year2020/day4.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | .map(|rk| { [INFO] [stdout] | __________________^ [INFO] [stdout] 29 | | let matching_kvp_option = [INFO] [stdout] 30 | | key_value_pairs.iter().filter(|kvp| kvp.0 == *rk).next(); [INFO] [stdout] 31 | | if matching_kvp_option == None { [INFO] [stdout] ... | [INFO] [stdout] 49 | | }) [INFO] [stdout] 50 | | .all(|x| x) [INFO] [stdout] | |___________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity [INFO] [stdout] = note: `#[warn(clippy::map_all_any_identity)]` on by default [INFO] [stdout] help: use `.all(...)` instead [INFO] [stdout] | [INFO] [stdout] 28 ~ .all(|rk| { [INFO] [stdout] 29 + let matching_kvp_option = [INFO] [stdout] 30 + key_value_pairs.iter().filter(|kvp| kvp.0 == *rk).next(); [INFO] [stdout] 31 + if matching_kvp_option == None { [INFO] [stdout] 32 + false [INFO] [stdout] 33 + } else if !should_do_hard_mode { [INFO] [stdout] 34 + true [INFO] [stdout] 35 + } else { [INFO] [stdout] 36 + let matching_kvp = matching_kvp_option.unwrap(); [INFO] [stdout] 37 + let value = matching_kvp.1; [INFO] [stdout] 38 + match *rk { [INFO] [stdout] 39 + "byr" => is_in_range(value, 1920, 2002), [INFO] [stdout] 40 + "iyr" => is_in_range(value, 2010, 2020), [INFO] [stdout] 41 + "eyr" => is_in_range(value, 2020, 2030), [INFO] [stdout] 42 + "hgt" => is_valid_height(value), [INFO] [stdout] 43 + "hcl" => hair_color_regex.is_match(value), [INFO] [stdout] 44 + "ecl" => valid_eye_colors.contains(&value), [INFO] [stdout] 45 + "pid" => passport_id_regex.is_match(value), [INFO] [stdout] 46 + _ => false, [INFO] [stdout] 47 + } [INFO] [stdout] 48 + } [INFO] [stdout] 49 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2020/day4.rs:30:25 [INFO] [stdout] | [INFO] [stdout] 30 | key_value_pairs.iter().filter(|kvp| kvp.0 == *rk).next(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `key_value_pairs.iter().find(|kvp| kvp.0 == *rk)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] = note: `#[warn(clippy::filter_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/year2020/day4.rs:31:24 [INFO] [stdout] | [INFO] [stdout] 31 | if matching_kvp_option == None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `matching_kvp_option.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2020/day5.rs:17:17 [INFO] [stdout] | [INFO] [stdout] 17 | ...rue => seat_values.iter().filter(|sv| !seat_values.contains(&(**sv - 1)) && seat_values.contains(&(*sv - 2))).next().unwrap() - 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `seat_values.iter().find(|sv| !seat_values.contains(&(**sv - 1)) && seat_values.contains(&(*sv - 2)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2020/day7.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | .map(|l| convert_to_rule(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `convert_to_rule` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/year2020/day7.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / let mut colors_to_check:Vec<&String> = Vec::new(); [INFO] [stdout] 20 | | colors_to_check.push(bag_color_to_check); [INFO] [stdout] | |_____________________________________________^ help: consider using the `vec![]` macro: `let mut colors_to_check: Vec<&String> = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/year2020/day7.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 31 | let c = a; [INFO] [stdout] | ---------- unnecessary `let` binding [INFO] [stdout] 32 | c [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 31 ~ [INFO] [stdout] 32 ~ a [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2020/day7.rs:8:14 [INFO] [stdout] | [INFO] [stdout] 8 | .map(|l| convert_to_rule(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `convert_to_rule` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/year2020/day7.rs:37:48 [INFO] [stdout] | [INFO] [stdout] 37 | found_colors.extend(colors_pointer.into_iter()); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/year2020/day7.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / let mut colors_to_check:Vec<&String> = Vec::new(); [INFO] [stdout] 20 | | colors_to_check.push(bag_color_to_check); [INFO] [stdout] | |_____________________________________________^ help: consider using the `vec![]` macro: `let mut colors_to_check: Vec<&String> = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/year2020/day7.rs:37:33 [INFO] [stdout] | [INFO] [stdout] 37 | found_colors.extend(colors_pointer.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 37 - found_colors.extend(colors_pointer.into_iter()); [INFO] [stdout] 37 + found_colors.extend(&*colors_pointer); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/year2020/day7.rs:38:55 [INFO] [stdout] | [INFO] [stdout] 38 | new_colors_to_check.extend(colors_pointer.into_iter()); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/year2020/day7.rs:38:40 [INFO] [stdout] | [INFO] [stdout] 38 | new_colors_to_check.extend(colors_pointer.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 38 - new_colors_to_check.extend(colors_pointer.into_iter()); [INFO] [stdout] 38 + new_colors_to_check.extend(&*colors_pointer); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/year2020/day7.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 40 | if new_colors_to_check.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `new_colors_to_check.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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2020/day7.rs:54:25 [INFO] [stdout] | [INFO] [stdout] 54 | let rule_to_check = rules.iter().filter(|r| r.holder_bag_color == *bag_color_to_check).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rules.iter().find(|r| r.holder_bag_color == *bag_color_to_check)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2020/day7.rs:57:34 [INFO] [stdout] | [INFO] [stdout] 57 | get_held_bags(rule_to_check, &rules) - 1 [INFO] [stdout] | ^^^^^^ help: change this to: `rules` [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: length comparison to zero [INFO] [stdout] --> src/year2020/day7.rs:61:8 [INFO] [stdout] | [INFO] [stdout] 61 | if rule_to_check.held_bags.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `rule_to_check.held_bags.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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2020/day7.rs:68:24 [INFO] [stdout] | [INFO] [stdout] 68 | let bag_rule = rules.iter().filter(|r| r.holder_bag_color == *bag_color).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rules.iter().find(|r| r.holder_bag_color == *bag_color)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/year2020/day7.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 31 | let c = a; [INFO] [stdout] | ---------- unnecessary `let` binding [INFO] [stdout] 32 | c [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 31 ~ [INFO] [stdout] 32 ~ a [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/year2020/day7.rs:37:48 [INFO] [stdout] | [INFO] [stdout] 37 | found_colors.extend(colors_pointer.into_iter()); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/year2020/day7.rs:37:33 [INFO] [stdout] | [INFO] [stdout] 37 | found_colors.extend(colors_pointer.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 37 - found_colors.extend(colors_pointer.into_iter()); [INFO] [stdout] 37 + found_colors.extend(&*colors_pointer); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/year2020/day7.rs:38:55 [INFO] [stdout] | [INFO] [stdout] 38 | new_colors_to_check.extend(colors_pointer.into_iter()); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/year2020/day7.rs:38:40 [INFO] [stdout] | [INFO] [stdout] 38 | new_colors_to_check.extend(colors_pointer.into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:416:17 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 38 - new_colors_to_check.extend(colors_pointer.into_iter()); [INFO] [stdout] 38 + new_colors_to_check.extend(&*colors_pointer); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/year2020/day7.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 40 | if new_colors_to_check.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `new_colors_to_check.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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2020/day7.rs:54:25 [INFO] [stdout] | [INFO] [stdout] 54 | let rule_to_check = rules.iter().filter(|r| r.holder_bag_color == *bag_color_to_check).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rules.iter().find(|r| r.holder_bag_color == *bag_color_to_check)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2020/day7.rs:57:34 [INFO] [stdout] | [INFO] [stdout] 57 | get_held_bags(rule_to_check, &rules) - 1 [INFO] [stdout] | ^^^^^^ help: change this to: `rules` [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: length comparison to zero [INFO] [stdout] --> src/year2020/day7.rs:61:8 [INFO] [stdout] | [INFO] [stdout] 61 | if rule_to_check.held_bags.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `rule_to_check.held_bags.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: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2020/day7.rs:68:24 [INFO] [stdout] | [INFO] [stdout] 68 | let bag_rule = rules.iter().filter(|r| r.holder_bag_color == *bag_color).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `rules.iter().find(|r| r.holder_bag_color == *bag_color)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2021/day2.rs:10:14 [INFO] [stdout] | [INFO] [stdout] 10 | .map(|l| convert_string_to_movement(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `convert_string_to_movement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/year2021/day3.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | return gamma * epsilon; [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] 43 - return gamma * epsilon; [INFO] [stdout] 43 + gamma * epsilon [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day3.rs:21:46 [INFO] [stdout] | [INFO] [stdout] 21 | let mut total_vec: Vec = vec![0i32; bit_strings[0].len().try_into().unwrap()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day3.rs:22:46 [INFO] [stdout] | [INFO] [stdout] 22 | let mut gamma_vec: Vec = vec![0i32; bit_strings[0].len().try_into().unwrap()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day3.rs:23:48 [INFO] [stdout] | [INFO] [stdout] 23 | let mut epsilon_vec: Vec = vec![0i32; bit_strings[0].len().try_into().unwrap()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day3.rs:26:34 [INFO] [stdout] | [INFO] [stdout] 26 | let usize_i: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day3.rs:32:30 [INFO] [stdout] | [INFO] [stdout] 32 | let usize_i: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: unneeded `return` statement [INFO] [stdout] --> src/year2021/day3.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 63 | return oxygen * co2; [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] 63 - return oxygen * co2; [INFO] [stdout] 63 + oxygen * co2 [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/year2021/day3.rs:46:41 [INFO] [stdout] | [INFO] [stdout] 46 | fn get_value_for_hard_mode(bit_strings: &Vec<&str>) -> i32 { [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] 46 - fn get_value_for_hard_mode(bit_strings: &Vec<&str>) -> i32 { [INFO] [stdout] 46 + fn get_value_for_hard_mode(bit_strings: &[&str]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day3.rs:52:30 [INFO] [stdout] | [INFO] [stdout] 52 | let usize_j: usize = j.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: redundant closure [INFO] [stdout] --> src/year2021/day2.rs:10:14 [INFO] [stdout] | [INFO] [stdout] 10 | .map(|l| convert_string_to_movement(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `convert_string_to_movement` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day3.rs:55:38 [INFO] [stdout] | [INFO] [stdout] 55 | let usize_i: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: this boolean expression can be simplified [INFO] [stdout] --> src/year2021/day3.rs:73:8 [INFO] [stdout] | [INFO] [stdout] 73 | if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 - if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] 73 + if !(!use_highest && sum >= 0 || sum != 0 && use_highest && sum <= 0) { [INFO] [stdout] | [INFO] [stdout] 73 - if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] 73 + if (sum > 0 || !use_highest || sum == 0) && (sum < 0 || use_highest) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/year2021/day3.rs:73:8 [INFO] [stdout] | [INFO] [stdout] 73 | if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 - if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] 73 + if !(!use_highest || sum != 0 && sum <= 0) || (!use_highest && sum < 0) { [INFO] [stdout] | [INFO] [stdout] 73 - if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] 73 + if (sum > 0 || sum == 0) && use_highest || (!use_highest && sum < 0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/year2021/day3.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | return filter_values(&new_ints, index + 1, use_highest); [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] 87 - return filter_values(&new_ints, index + 1, use_highest); [INFO] [stdout] 87 + filter_values(&new_ints, index + 1, use_highest) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/year2021/day3.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | return 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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 97 - return sum; [INFO] [stdout] 97 + sum [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/year2021/day3.rs:90:30 [INFO] [stdout] | [INFO] [stdout] 90 | fn convert_bits_to_int(bits: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 90 - fn convert_bits_to_int(bits: &Vec) -> i32 { [INFO] [stdout] 90 + fn convert_bits_to_int(bits: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/year2021/day3.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | sum = sum + bits[i] * multiplier; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sum += bits[i] * multiplier` [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: redundant closure [INFO] [stdout] --> src/year2021/day4.rs:17:14 [INFO] [stdout] | [INFO] [stdout] 17 | .map(|c| convert_to_bingo_board(c)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `convert_to_bingo_board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2021/day4.rs:25:53 [INFO] [stdout] | [INFO] [stdout] 25 | .partition(|bb| is_bingo_board_a_winner(&bb)); [INFO] [stdout] | ^^^ help: change this to: `bb` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/year2021/day4.rs:26:66 [INFO] [stdout] | [INFO] [stdout] 26 | if winning_boards.len() == 1 && (!should_do_hard_mode || losing_boards.len() == 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `losing_boards.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: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/year2021/day4.rs:63:14 [INFO] [stdout] | [INFO] [stdout] 63 | .trim() [INFO] [stdout] | ______________^ [INFO] [stdout] 64 | | .split_whitespace() [INFO] [stdout] | |_____________^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/year2021/day3.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | return gamma * epsilon; [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] 43 - return gamma * epsilon; [INFO] [stdout] 43 + gamma * epsilon [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/year2021/day4.rs:74:44 [INFO] [stdout] | [INFO] [stdout] 74 | fn update_bingo_boards_with_number(boards: &Vec, number: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 74 - fn update_bingo_boards_with_number(boards: &Vec, number: i32) -> Vec { [INFO] [stdout] 74 + fn update_bingo_boards_with_number(boards: &[BingoBoard], number: i32) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day3.rs:21:46 [INFO] [stdout] | [INFO] [stdout] 21 | let mut total_vec: Vec = vec![0i32; bit_strings[0].len().try_into().unwrap()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day3.rs:22:46 [INFO] [stdout] | [INFO] [stdout] 22 | let mut gamma_vec: Vec = vec![0i32; bit_strings[0].len().try_into().unwrap()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: redundant closure [INFO] [stdout] --> src/year2021/day4.rs:105:28 [INFO] [stdout] | [INFO] [stdout] 105 | board.lines.iter().map(|l| sum_bingo_line(l)).sum() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `sum_bingo_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day3.rs:23:48 [INFO] [stdout] | [INFO] [stdout] 23 | let mut epsilon_vec: Vec = vec![0i32; bit_strings[0].len().try_into().unwrap()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day3.rs:26:34 [INFO] [stdout] | [INFO] [stdout] 26 | let usize_i: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day4.rs:124:30 [INFO] [stdout] | [INFO] [stdout] 124 | let i_usize: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day3.rs:32:30 [INFO] [stdout] | [INFO] [stdout] 32 | let usize_i: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: redundant closure [INFO] [stdout] --> src/year2021/day5.rs:10:14 [INFO] [stdout] | [INFO] [stdout] 10 | .map(|l| convert_line_string_to_line(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `convert_line_string_to_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/year2021/day3.rs:63:5 [INFO] [stdout] | [INFO] [stdout] 63 | return oxygen * co2; [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] 63 - return oxygen * co2; [INFO] [stdout] 63 + oxygen * co2 [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/year2021/day3.rs:46:41 [INFO] [stdout] | [INFO] [stdout] 46 | fn get_value_for_hard_mode(bit_strings: &Vec<&str>) -> i32 { [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] 46 - fn get_value_for_hard_mode(bit_strings: &Vec<&str>) -> i32 { [INFO] [stdout] 46 + fn get_value_for_hard_mode(bit_strings: &[&str]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day3.rs:52:30 [INFO] [stdout] | [INFO] [stdout] 52 | let usize_j: usize = j.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: `usize` [INFO] [stdout] --> src/year2021/day3.rs:55:38 [INFO] [stdout] | [INFO] [stdout] 55 | let usize_i: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: unneeded `return` statement [INFO] [stdout] --> src/year2021/day5.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | return vec![vec![0i32; (max_y + 1).try_into().unwrap()]; (max_x + 1).try_into().unwrap()]; [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] 82 - return vec![vec![0i32; (max_y + 1).try_into().unwrap()]; (max_x + 1).try_into().unwrap()]; [INFO] [stdout] 82 + vec![vec![0i32; (max_y + 1).try_into().unwrap()]; (max_x + 1).try_into().unwrap()] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/year2021/day3.rs:73:8 [INFO] [stdout] | [INFO] [stdout] 73 | if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 - if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] 73 + if !(!use_highest && sum >= 0 || sum != 0 && use_highest && sum <= 0) { [INFO] [stdout] | [INFO] [stdout] 73 - if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] 73 + if (sum > 0 || !use_highest || sum == 0) && (sum < 0 || use_highest) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/year2021/day5.rs:85:35 [INFO] [stdout] | [INFO] [stdout] 85 | fn add_line_to_vent_map(vent_map: &mut Vec>, line: &Line, should_include_diagonals: bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 85 - fn add_line_to_vent_map(vent_map: &mut Vec>, line: &Line, should_include_diagonals: bool) { [INFO] [stdout] 85 + fn add_line_to_vent_map(vent_map: &mut [Vec], line: &Line, should_include_diagonals: bool) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/year2021/day3.rs:73:8 [INFO] [stdout] | [INFO] [stdout] 73 | if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 73 - if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] 73 + if !(!use_highest || sum != 0 && sum <= 0) || (!use_highest && sum < 0) { [INFO] [stdout] | [INFO] [stdout] 73 - if (sum == 0 && use_highest) || (use_highest && sum > 0) || (!use_highest && sum < 0) { [INFO] [stdout] 73 + if (sum > 0 || sum == 0) && use_highest || (!use_highest && sum < 0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/year2021/day3.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | return filter_values(&new_ints, index + 1, use_highest); [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] 87 - return filter_values(&new_ints, index + 1, use_highest); [INFO] [stdout] 87 + filter_values(&new_ints, index + 1, use_highest) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day6.rs:13:30 [INFO] [stdout] | [INFO] [stdout] 13 | let i_usize: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: unneeded `return` statement [INFO] [stdout] --> src/year2021/day3.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | return 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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 97 - return sum; [INFO] [stdout] 97 + sum [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/year2021/day3.rs:90:30 [INFO] [stdout] | [INFO] [stdout] 90 | fn convert_bits_to_int(bits: &Vec) -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 90 - fn convert_bits_to_int(bits: &Vec) -> i32 { [INFO] [stdout] 90 + fn convert_bits_to_int(bits: &[i32]) -> i32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/year2021/day3.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | sum = sum + bits[i] * multiplier; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `sum += bits[i] * multiplier` [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: the loop variable `j` is used to index `crab_buckets` [INFO] [stdout] --> src/year2021/day7.rs:22:18 [INFO] [stdout] | [INFO] [stdout] 22 | for j in 0..=*max_value { [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] 22 - for j in 0..=*max_value { [INFO] [stdout] 22 + for (j, ) in crab_buckets.iter().enumerate().take(*max_value + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual absolute difference pattern without using `abs_diff` [INFO] [stdout] --> src/year2021/day7.rs:23:24 [INFO] [stdout] | [INFO] [stdout] 23 | let diff = if i < j { j - i } else { i - j }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `abs_diff`: `j.abs_diff(i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff [INFO] [stdout] = note: `#[warn(clippy::manual_abs_diff)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2021/day4.rs:17:14 [INFO] [stdout] | [INFO] [stdout] 17 | .map(|c| convert_to_bingo_board(c)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `convert_to_bingo_board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2021/day4.rs:25:53 [INFO] [stdout] | [INFO] [stdout] 25 | .partition(|bb| is_bingo_board_a_winner(&bb)); [INFO] [stdout] | ^^^ help: change this to: `bb` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/year2021/day4.rs:26:66 [INFO] [stdout] | [INFO] [stdout] 26 | if winning_boards.len() == 1 && (!should_do_hard_mode || losing_boards.len() == 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `losing_boards.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: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/year2021/day4.rs:63:14 [INFO] [stdout] | [INFO] [stdout] 63 | .trim() [INFO] [stdout] | ______________^ [INFO] [stdout] 64 | | .split_whitespace() [INFO] [stdout] | |_____________^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` 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/year2021/day4.rs:74:44 [INFO] [stdout] | [INFO] [stdout] 74 | fn update_bingo_boards_with_number(boards: &Vec, number: i32) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 74 - fn update_bingo_boards_with_number(boards: &Vec, number: i32) -> Vec { [INFO] [stdout] 74 + fn update_bingo_boards_with_number(boards: &[BingoBoard], number: i32) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:32:35 [INFO] [stdout] | [INFO] [stdout] 32 | let signal_1:&Vec = signals.iter().filter(|f| f.len() == 2).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:33:35 [INFO] [stdout] | [INFO] [stdout] 33 | let signal_4:&Vec = signals.iter().filter(|f| f.len() == 4).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:34:35 [INFO] [stdout] | [INFO] [stdout] 34 | let signal_7:&Vec = signals.iter().filter(|f| f.len() == 3).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:35:35 [INFO] [stdout] | [INFO] [stdout] 35 | let signal_8:&Vec = signals.iter().filter(|f| f.len() == 7).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 7)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/year2021/day8.rs:39:54 [INFO] [stdout] | [INFO] [stdout] 39 | let waist_and_left_arm:Vec<&char> = signal_4.into_iter().filter(|c| !signal_1.contains(c)).collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:40:35 [INFO] [stdout] | [INFO] [stdout] 40 | let signal_0:&Vec = signals.iter() [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 41 | | .filter(|f| f.len() == 6 && f.contains(&waist_and_left_arm[0]) != f.contains(&waist_and_left_arm[1])) [INFO] [stdout] 42 | | .next().unwrap(); [INFO] [stdout] | |___________________^ help: try: `signals.iter().find(|f| f.len() == 6 && f.contains(&waist_and_left_arm[0]) != f.contains(&waist_and_left_arm[1]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2021/day8.rs:41:52 [INFO] [stdout] | [INFO] [stdout] 41 | .filter(|f| f.len() == 6 && f.contains(&waist_and_left_arm[0]) != f.contains(&waist_and_left_arm[1])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `waist_and_left_arm[0]` [INFO] [stdout] | [INFO] [stdout] = 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/year2021/day8.rs:41:90 [INFO] [stdout] | [INFO] [stdout] 41 | .filter(|f| f.len() == 6 && f.contains(&waist_and_left_arm[0]) != f.contains(&waist_and_left_arm[1])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `waist_and_left_arm[1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2021/day8.rs:46:45 [INFO] [stdout] | [INFO] [stdout] 46 | let left_arm = if signal_0.contains(&waist_and_left_arm[0]) { waist_and_left_arm[0] } else { waist_and_left_arm[1] }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `waist_and_left_arm[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:48:35 [INFO] [stdout] | [INFO] [stdout] 48 | let signal_5:&Vec = signals.iter().filter(|f| f.len() == 5 && f.contains(&left_arm)).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 5 && f.contains(&left_arm))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2021/day8.rs:48:88 [INFO] [stdout] | [INFO] [stdout] 48 | let signal_5:&Vec = signals.iter().filter(|f| f.len() == 5 && f.contains(&left_arm)).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `left_arm` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:51:35 [INFO] [stdout] | [INFO] [stdout] 51 | ...ec = signals.iter().filter(|f| f.len() == 5 && f.contains(&signal_1[0]) && f.contains(&signal_1[1])).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 5 && f.contains(&signal_1[0]) && f.contains(&signal_1[1]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/year2021/day4.rs:105:28 [INFO] [stdout] | [INFO] [stdout] 105 | board.lines.iter().map(|l| sum_bingo_line(l)).sum() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `sum_bingo_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day4.rs:124:30 [INFO] [stdout] | [INFO] [stdout] 124 | let i_usize: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: redundant closure [INFO] [stdout] --> src/year2021/day5.rs:10:14 [INFO] [stdout] | [INFO] [stdout] 10 | .map(|l| convert_line_string_to_line(l)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `convert_line_string_to_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:54:35 [INFO] [stdout] | [INFO] [stdout] 54 | let signal_2:&Vec = signals.iter().filter(|f| f.len() == 5 && f != &signal_5 && f != &signal_3).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 5 && f != &signal_5 && f != &signal_3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:57:35 [INFO] [stdout] | [INFO] [stdout] 57 | ... = signals.iter().filter(|f| f.len() == 6 && f != &signal_0 && f.contains(&signal_1[0]) && f.contains(&signal_1[1])).next().unwra... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 6 && f != &signal_0 && f.contains(&signal_1[0]) && f.contains(&signal_1[1]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:60:35 [INFO] [stdout] | [INFO] [stdout] 60 | let signal_6:&Vec = signals.iter().filter(|f| f.len() == 6 && f != &signal_0 && f != &signal_9).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 6 && f != &signal_0 && f != &signal_9)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/year2021/day8.rs:81:32 [INFO] [stdout] | [INFO] [stdout] 81 | fn are_equal(a: &Vec, b: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 81 - fn are_equal(a: &Vec, b: &Vec) -> bool { [INFO] [stdout] 81 + fn are_equal(a: &Vec, b: &[char]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/year2021/day5.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | return vec![vec![0i32; (max_y + 1).try_into().unwrap()]; (max_x + 1).try_into().unwrap()]; [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] 82 - return vec![vec![0i32; (max_y + 1).try_into().unwrap()]; (max_x + 1).try_into().unwrap()]; [INFO] [stdout] 82 + vec![vec![0i32; (max_y + 1).try_into().unwrap()]; (max_x + 1).try_into().unwrap()] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/year2021/day5.rs:85:35 [INFO] [stdout] | [INFO] [stdout] 85 | fn add_line_to_vent_map(vent_map: &mut Vec>, line: &Line, should_include_diagonals: bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 85 - fn add_line_to_vent_map(vent_map: &mut Vec>, line: &Line, should_include_diagonals: bool) { [INFO] [stdout] 85 + fn add_line_to_vent_map(vent_map: &mut [Vec], line: &Line, should_include_diagonals: bool) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/year2021/day6.rs:13:30 [INFO] [stdout] | [INFO] [stdout] 13 | let i_usize: usize = i.try_into().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: the loop variable `j` is used to index `crab_buckets` [INFO] [stdout] --> src/year2021/day7.rs:22:18 [INFO] [stdout] | [INFO] [stdout] 22 | for j in 0..=*max_value { [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] 22 - for j in 0..=*max_value { [INFO] [stdout] 22 + for (j, ) in crab_buckets.iter().enumerate().take(*max_value + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual absolute difference pattern without using `abs_diff` [INFO] [stdout] --> src/year2021/day7.rs:23:24 [INFO] [stdout] | [INFO] [stdout] 23 | let diff = if i < j { j - i } else { i - j }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `abs_diff`: `j.abs_diff(i)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff [INFO] [stdout] = note: `#[warn(clippy::manual_abs_diff)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:32:35 [INFO] [stdout] | [INFO] [stdout] 32 | let signal_1:&Vec = signals.iter().filter(|f| f.len() == 2).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:33:35 [INFO] [stdout] | [INFO] [stdout] 33 | let signal_4:&Vec = signals.iter().filter(|f| f.len() == 4).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:34:35 [INFO] [stdout] | [INFO] [stdout] 34 | let signal_7:&Vec = signals.iter().filter(|f| f.len() == 3).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:35:35 [INFO] [stdout] | [INFO] [stdout] 35 | let signal_8:&Vec = signals.iter().filter(|f| f.len() == 7).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 7)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/year2021/day8.rs:39:54 [INFO] [stdout] | [INFO] [stdout] 39 | let waist_and_left_arm:Vec<&char> = signal_4.into_iter().filter(|c| !signal_1.contains(c)).collect(); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:40:35 [INFO] [stdout] | [INFO] [stdout] 40 | let signal_0:&Vec = signals.iter() [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 41 | | .filter(|f| f.len() == 6 && f.contains(&waist_and_left_arm[0]) != f.contains(&waist_and_left_arm[1])) [INFO] [stdout] 42 | | .next().unwrap(); [INFO] [stdout] | |___________________^ help: try: `signals.iter().find(|f| f.len() == 6 && f.contains(&waist_and_left_arm[0]) != f.contains(&waist_and_left_arm[1]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2021/day8.rs:41:52 [INFO] [stdout] | [INFO] [stdout] 41 | .filter(|f| f.len() == 6 && f.contains(&waist_and_left_arm[0]) != f.contains(&waist_and_left_arm[1])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `waist_and_left_arm[0]` [INFO] [stdout] | [INFO] [stdout] = 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/year2021/day8.rs:41:90 [INFO] [stdout] | [INFO] [stdout] 41 | .filter(|f| f.len() == 6 && f.contains(&waist_and_left_arm[0]) != f.contains(&waist_and_left_arm[1])) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `waist_and_left_arm[1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2021/day8.rs:46:45 [INFO] [stdout] | [INFO] [stdout] 46 | let left_arm = if signal_0.contains(&waist_and_left_arm[0]) { waist_and_left_arm[0] } else { waist_and_left_arm[1] }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `waist_and_left_arm[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:48:35 [INFO] [stdout] | [INFO] [stdout] 48 | let signal_5:&Vec = signals.iter().filter(|f| f.len() == 5 && f.contains(&left_arm)).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 5 && f.contains(&left_arm))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/year2021/day8.rs:48:88 [INFO] [stdout] | [INFO] [stdout] 48 | let signal_5:&Vec = signals.iter().filter(|f| f.len() == 5 && f.contains(&left_arm)).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `left_arm` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:51:35 [INFO] [stdout] | [INFO] [stdout] 51 | ...ec = signals.iter().filter(|f| f.len() == 5 && f.contains(&signal_1[0]) && f.contains(&signal_1[1])).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 5 && f.contains(&signal_1[0]) && f.contains(&signal_1[1]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:54:35 [INFO] [stdout] | [INFO] [stdout] 54 | let signal_2:&Vec = signals.iter().filter(|f| f.len() == 5 && f != &signal_5 && f != &signal_3).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 5 && f != &signal_5 && f != &signal_3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:57:35 [INFO] [stdout] | [INFO] [stdout] 57 | ... = signals.iter().filter(|f| f.len() == 6 && f != &signal_0 && f.contains(&signal_1[0]) && f.contains(&signal_1[1])).next().unwra... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 6 && f != &signal_0 && f.contains(&signal_1[0]) && f.contains(&signal_1[1]))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `filter(..).next()` on an `Iterator`. This is more succinctly expressed by calling `.find(..)` instead [INFO] [stdout] --> src/year2021/day8.rs:60:35 [INFO] [stdout] | [INFO] [stdout] 60 | let signal_6:&Vec = signals.iter().filter(|f| f.len() == 6 && f != &signal_0 && f != &signal_9).next().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `signals.iter().find(|f| f.len() == 6 && f != &signal_0 && f != &signal_9)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_next [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/year2021/day8.rs:81:32 [INFO] [stdout] | [INFO] [stdout] 81 | fn are_equal(a: &Vec, b: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 81 - fn are_equal(a: &Vec, b: &Vec) -> bool { [INFO] [stdout] 81 + fn are_equal(a: &Vec, b: &[char]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s [INFO] running `Command { std: "docker" "inspect" "2229a44061649f03e0f2eca51d02cf30bd147938a596663054a888ca1eafebfd", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2229a44061649f03e0f2eca51d02cf30bd147938a596663054a888ca1eafebfd", kill_on_drop: false }` [INFO] [stdout] 2229a44061649f03e0f2eca51d02cf30bd147938a596663054a888ca1eafebfd