[INFO] cloning repository https://github.com/majcherpiotrek/aoc2023 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/majcherpiotrek/aoc2023" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmajcherpiotrek%2Faoc2023", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmajcherpiotrek%2Faoc2023'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 98998ac9b4dea7a43b80877fe3dd08f71297ed2f [INFO] linting majcherpiotrek/aoc2023 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmajcherpiotrek%2Faoc2023" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/majcherpiotrek/aoc2023 [INFO] finished tweaking git repo https://github.com/majcherpiotrek/aoc2023 [INFO] tweaked toml for git repo https://github.com/majcherpiotrek/aoc2023 written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/majcherpiotrek/aoc2023 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/majcherpiotrek/aoc2023 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-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 324c32b7d750efd16fec7294670831f0f99b0c1dc7a5b3db69c0d1b50d3d827e [INFO] running `Command { std: "docker" "start" "-a" "324c32b7d750efd16fec7294670831f0f99b0c1dc7a5b3db69c0d1b50d3d827e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "324c32b7d750efd16fec7294670831f0f99b0c1dc7a5b3db69c0d1b50d3d827e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "324c32b7d750efd16fec7294670831f0f99b0c1dc7a5b3db69c0d1b50d3d827e", kill_on_drop: false }` [INFO] [stdout] 324c32b7d750efd16fec7294670831f0f99b0c1dc7a5b3db69c0d1b50d3d827e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 3c6fc0edbd5e62b08133f31e4135f935ef5a4e4b9eea4d339a18980abf1575fb [INFO] running `Command { std: "docker" "start" "-a" "3c6fc0edbd5e62b08133f31e4135f935ef5a4e4b9eea4d339a18980abf1575fb", kill_on_drop: false }` [INFO] [stderr] Checking memchr v2.6.4 [INFO] [stderr] Checking regex-syntax v0.8.2 [INFO] [stderr] Checking aho-corasick v1.1.2 [INFO] [stderr] Checking regex-automata v0.4.3 [INFO] [stderr] Checking regex v1.10.2 [INFO] [stderr] Checking aoc2023 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: function `arrived_from` is never used [INFO] [stdout] --> src/clumsy_crucible.rs:381:4 [INFO] [stdout] | [INFO] [stdout] 381 | fn arrived_from(current_node: &NodeAddress, prev_node: &NodeAddress) -> Direction { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `calculate_all_rating_combinations` is never used [INFO] [stdout] --> src/aplenty.rs:54:8 [INFO] [stdout] | [INFO] [stdout] 54 | pub fn calculate_all_rating_combinations(file: &str) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_condition_pass_posibilities` and `get_condition_fail_posibilities` are never used [INFO] [stdout] --> src/aplenty.rs:175:12 [INFO] [stdout] | [INFO] [stdout] 135 | impl Condition { [INFO] [stdout] | -------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 175 | pub fn get_condition_pass_posibilities(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 182 | pub fn get_condition_fail_posibilities(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/puzzle_reader.rs:27:18 [INFO] [stdout] | [INFO] [stdout] 27 | read_arg(&program_args, DAY_ARG_PREFIX), [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `program_args` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/puzzle_reader.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | read_arg(&program_args, PART_ARG_PREFIX), [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `program_args` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/puzzle_reader.rs:40:19 [INFO] [stdout] | [INFO] [stdout] 40 | fn read_arg(args: &Vec, arg_name: &str) -> Result { [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] 40 - fn read_arg(args: &Vec, arg_name: &str) -> Result { [INFO] [stdout] 40 + fn read_arg(args: &[String], arg_name: &str) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/trebuchet.rs:3:54 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn calibrate_using_digits_only(calibration_file: &String) -> usize { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn calibrate_using_digits_only(calibration_file: &String) -> usize { [INFO] [stdout] 3 + pub fn calibrate_using_digits_only(calibration_file: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/trebuchet.rs:18:10 [INFO] [stdout] | [INFO] [stdout] 18 | .fold(0, |acc, elem| acc + elem) [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_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/trebuchet.rs:10:18 [INFO] [stdout] | [INFO] [stdout] 10 | .filter_map(|x| x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/trebuchet.rs:21:57 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn calibrate_using_spelled_digits(calibration_file: &String) -> usize { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 21 - pub fn calibrate_using_spelled_digits(calibration_file: &String) -> usize { [INFO] [stdout] 21 + pub fn calibrate_using_spelled_digits(calibration_file: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/trebuchet.rs:36:10 [INFO] [stdout] | [INFO] [stdout] 36 | .fold(0, |acc, elem| acc + elem) [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_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/trebuchet.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | .filter_map(|x| x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/trebuchet.rs:25:52 [INFO] [stdout] | [INFO] [stdout] 25 | let nums: Vec = find_candidates(&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] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/trebuchet.rs:47:32 [INFO] [stdout] | [INFO] [stdout] 47 | .map(|p| Regex::new(p).expect(format!("Failed to build regex for pattern {p}").as_str())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to build regex for pattern {p}"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/cube_conundrum.rs:107:10 [INFO] [stdout] | [INFO] [stdout] 107 | .fold(0, |acc, elem| acc + elem) [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_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/cube_conundrum.rs:111:5 [INFO] [stdout] | [INFO] [stdout] 111 | / game.cube_sets [INFO] [stdout] 112 | | .iter() [INFO] [stdout] 113 | | .flat_map(|cube_set| cube_set.cubes.get(&color)) [INFO] [stdout] 114 | | .max() [INFO] [stdout] 115 | | .map(|&n| n) [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 111 ~ game.cube_sets [INFO] [stdout] 112 + .iter() [INFO] [stdout] 113 + .flat_map(|cube_set| cube_set.cubes.get(&color)) [INFO] [stdout] 114 + .max().copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/gear_ratios.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | / engine_schematic [INFO] [stdout] 93 | | .split("\n") [INFO] [stdout] 94 | | .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] 92 ~ engine_schematic [INFO] [stdout] 93 + .split("\n") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/scratchcards.rs:115:10 [INFO] [stdout] | [INFO] [stdout] 115 | .fold(0, |sum, line_points| sum + line_points) [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_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/scratchcards.rs:133:63 [INFO] [stdout] | [INFO] [stdout] 133 | cards.iter().map(|card| count_card_tree_size(&cards, card)).fold(0, |acc, elem| acc + elem) [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_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Range` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:172:37 [INFO] [stdout] | [INFO] [stdout] 172 | let mut range_to_map = Some(range.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*range` [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: accessing first element with `mapping_result.get(0)` [INFO] [stdout] --> src/garden.rs:179:44 [INFO] [stdout] | [INFO] [stdout] 179 | let mapped_range = mapping_result.get(0).expect("Unexpected error"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping_result.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: using `clone` on type `Range` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:180:38 [INFO] [stdout] | [INFO] [stdout] 180 | results.push(mapped_range.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*mapped_range` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `mapping_result.get(0)` [INFO] [stdout] --> src/garden.rs:184:44 [INFO] [stdout] | [INFO] [stdout] 184 | let mapped_range = mapping_result.get(0).expect("Unexpected error"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping_result.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: using `clone` on type `Range` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:185:38 [INFO] [stdout] | [INFO] [stdout] 185 | results.push(mapped_range.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*mapped_range` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/garden.rs:193:9 [INFO] [stdout] | [INFO] [stdout] 193 | / match range_to_map { [INFO] [stdout] 194 | | Some(r) => results.push(r.clone()), [INFO] [stdout] 195 | | None => (), [INFO] [stdout] 196 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(r) = range_to_map { results.push(r.clone()) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Range` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:194:37 [INFO] [stdout] | [INFO] [stdout] 194 | Some(r) => results.push(r.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `r` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/garden.rs:201:38 [INFO] [stdout] | [INFO] [stdout] 201 | pub fn map_ranges(&self, ranges: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 201 - pub fn map_ranges(&self, ranges: &Vec) -> Vec { [INFO] [stdout] 201 + pub fn map_ranges(&self, ranges: &[Range]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:292:26 [INFO] [stdout] | [INFO] [stdout] 292 | source = destination.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `destination` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/boat_races.rs:40:14 [INFO] [stdout] | [INFO] [stdout] 40 | .zip(record_distances.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 40 - .zip(record_distances.into_iter()) [INFO] [stdout] 40 + .zip(record_distances) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/boat_races.rs:75:55 [INFO] [stdout] | [INFO] [stdout] 75 | let distance_covered = calculate_distance(&race_time, &candidate); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `race_time` [INFO] [stdout] | [INFO] [stdout] = 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/camel_cards.rs:21:47 [INFO] [stdout] | [INFO] [stdout] 21 | card_ord = card_b.partial_cmp(&card_a).unwrap_or(Ordering::Equal); [INFO] [stdout] | ^^^^^^^ help: change this to: `card_a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/camel_cards.rs:64:45 [INFO] [stdout] | [INFO] [stdout] 64 | _ => card_b.partial_cmp(&card_a).unwrap_or(Ordering::Equal) [INFO] [stdout] | ^^^^^^^ help: change this to: `card_a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/camel_cards.rs:196:47 [INFO] [stdout] | [INFO] [stdout] 196 | let grouped_cards = Hand::group_cards(&cards); [INFO] [stdout] | ^^^^^^ help: change this to: `cards` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `cards.get(0)` [INFO] [stdout] --> src/camel_cards.rs:197:26 [INFO] [stdout] | [INFO] [stdout] 197 | let first_card = cards.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `cards.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/camel_cards.rs:245:47 [INFO] [stdout] | [INFO] [stdout] 245 | let grouped_cards = Hand::group_cards(&cards); [INFO] [stdout] | ^^^^^^ help: change this to: `cards` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `cards.get(0)` [INFO] [stdout] --> src/camel_cards.rs:246:26 [INFO] [stdout] | [INFO] [stdout] 246 | let first_card = cards.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `cards.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/camel_cards.rs:334:27 [INFO] [stdout] | [INFO] [stdout] 334 | fn group_cards(cards: &Vec) -> HashMap { [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] 334 - fn group_cards(cards: &Vec) -> HashMap { [INFO] [stdout] 334 + fn group_cards(cards: &[Card]) -> HashMap { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Card` which implements the `Copy` trait [INFO] [stdout] --> src/camel_cards.rs:340:42 [INFO] [stdout] | [INFO] [stdout] 340 | grouped_cards.insert(card.clone(), cards_already_added + 1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*card` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Card` which implements the `Copy` trait [INFO] [stdout] --> src/camel_cards.rs:343:42 [INFO] [stdout] | [INFO] [stdout] 343 | grouped_cards.insert(card.clone(), 1 as usize); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*card` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/camel_cards.rs:343:56 [INFO] [stdout] | [INFO] [stdout] 343 | grouped_cards.insert(card.clone(), 1 as usize); [INFO] [stdout] | ^^^^^^^^^^ help: try: `1_usize` [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: use of `unwrap_or` to construct default value [INFO] [stdout] --> src/haunted_wasteland.rs:30:10 [INFO] [stdout] | [INFO] [stdout] 30 | .unwrap_or(Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/haunted_wasteland.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | / match file_split.next() { [INFO] [stdout] 34 | | Some(map_block) => { [INFO] [stdout] 35 | | for line in map_block.split("\n") { [INFO] [stdout] 36 | | let mut line_split = line.split(" = "); [INFO] [stdout] ... | [INFO] [stdout] 48 | | None => (), [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 33 ~ if let Some(map_block) = file_split.next() { [INFO] [stdout] 34 + for line in map_block.split("\n") { [INFO] [stdout] 35 + let mut line_split = line.split(" = "); [INFO] [stdout] 36 + let maybe_node = line_split.next(); [INFO] [stdout] 37 + let maybe_node_pair = line_split.next().and_then(NodePair::parse); [INFO] [stdout] 38 + [INFO] [stdout] 39 + match (maybe_node, maybe_node_pair) { [INFO] [stdout] 40 + (Some(node), Some(node_pair)) => { [INFO] [stdout] 41 + nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] 42 + } [INFO] [stdout] 43 + _ => (), [INFO] [stdout] 44 + } [INFO] [stdout] 45 + } [INFO] [stdout] 46 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/haunted_wasteland.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | / match (maybe_node, maybe_node_pair) { [INFO] [stdout] 41 | | (Some(node), Some(node_pair)) => { [INFO] [stdout] 42 | | nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 40 ~ if let (Some(node), Some(node_pair)) = (maybe_node, maybe_node_pair) { [INFO] [stdout] 41 + nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] 42 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/haunted_wasteland.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | steps = steps + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `steps += 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] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `unwrap_or` to construct default value [INFO] [stdout] --> src/haunted_wasteland.rs:93:10 [INFO] [stdout] | [INFO] [stdout] 93 | .unwrap_or(Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/haunted_wasteland.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | / match file_split.next() { [INFO] [stdout] 97 | | Some(map_block) => { [INFO] [stdout] 98 | | for line in map_block.split("\n") { [INFO] [stdout] 99 | | let mut line_split = line.split(" = "); [INFO] [stdout] ... | [INFO] [stdout] 111 | | None => (), [INFO] [stdout] 112 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 96 ~ if let Some(map_block) = file_split.next() { [INFO] [stdout] 97 + for line in map_block.split("\n") { [INFO] [stdout] 98 + let mut line_split = line.split(" = "); [INFO] [stdout] 99 + let maybe_node = line_split.next(); [INFO] [stdout] 100 + let maybe_node_pair = line_split.next().and_then(NodePair::parse); [INFO] [stdout] 101 + [INFO] [stdout] 102 + match (maybe_node, maybe_node_pair) { [INFO] [stdout] 103 + (Some(node), Some(node_pair)) => { [INFO] [stdout] 104 + nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] 105 + } [INFO] [stdout] 106 + _ => (), [INFO] [stdout] 107 + } [INFO] [stdout] 108 + } [INFO] [stdout] 109 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/haunted_wasteland.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | / match (maybe_node, maybe_node_pair) { [INFO] [stdout] 104 | | (Some(node), Some(node_pair)) => { [INFO] [stdout] 105 | | nodes_map.insert(node.to_string(), node_pair); [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#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 103 ~ if let (Some(node), Some(node_pair)) = (maybe_node, maybe_node_pair) { [INFO] [stdout] 104 + nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] 105 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/haunted_wasteland.rs:122:38 [INFO] [stdout] | [INFO] [stdout] 122 | let mut current_node: &str = &start_node; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `start_node` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/haunted_wasteland.rs:127:13 [INFO] [stdout] | [INFO] [stdout] 127 | steps = steps + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `steps += 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::ops::RangeInclusive` [INFO] [stdout] --> src/mirage_maintenance.rs:78:22 [INFO] [stdout] | [INFO] [stdout] 78 | for row_index in (0..=values_matrix.len() - 1).into_iter().rev() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..=values_matrix.len() - 1)` [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: manual implementation of an assign operation [INFO] [stdout] --> src/mirage_maintenance.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | next_row_last_element = last_element_from_current_row + next_row_last_element; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next_row_last_element += last_element_from_current_row` [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: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/mirage_maintenance.rs:103:31 [INFO] [stdout] | [INFO] [stdout] 103 | next_row.push(-1 * diff); [INFO] [stdout] | ^^^^^^^^^ help: consider using: `-diff` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::RangeInclusive` [INFO] [stdout] --> src/mirage_maintenance.rs:122:22 [INFO] [stdout] | [INFO] [stdout] 122 | for row_index in (0..=values_matrix.len() - 1).into_iter().rev() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..=values_matrix.len() - 1)` [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: using `clone` on type `MazeElement` which implements the `Copy` trait [INFO] [stdout] --> src/pipe_maze.rs:121:54 [INFO] [stdout] | [INFO] [stdout] 121 | points_inside.push((point_to_verify, element_to_verify.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*element_to_verify` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/pipe_maze.rs:146:6 [INFO] [stdout] | [INFO] [stdout] 146 | .filter_map(|elem| elem) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Position` which implements the `Copy` trait [INFO] [stdout] --> src/pipe_maze.rs:182:36 [INFO] [stdout] | [INFO] [stdout] 182 | let mut current_position = start.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*start` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Position` which implements the `Copy` trait [INFO] [stdout] --> src/pipe_maze.rs:184:29 [INFO] [stdout] | [INFO] [stdout] 184 | let mut path = vec![start.clone()]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*start` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `MazeElement` which implements the `Copy` trait [INFO] [stdout] --> src/pipe_maze.rs:232:54 [INFO] [stdout] | [INFO] [stdout] 232 | .map(|element| (target_position, element.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*element` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pipe_maze.rs:286:17 [INFO] [stdout] | [INFO] [stdout] 286 | / *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 | | || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 288 | | || *end_a == Direction::South && *end_b == Direction::East [INFO] [stdout] 289 | | || *end_a == Direction::South && *end_b == Direction::West [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] 286 - *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 - || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 288 - || *end_a == Direction::South && *end_b == Direction::East [INFO] [stdout] 289 - || *end_a == Direction::South && *end_b == Direction::West [INFO] [stdout] 286 + !(*end_b != Direction::East && *end_b != Direction::West || *end_a != Direction::North && *end_a != Direction::South) [INFO] [stdout] | [INFO] [stdout] 286 - *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 - || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 288 - || *end_a == Direction::South && *end_b == Direction::East [INFO] [stdout] 289 - || *end_a == Direction::South && *end_b == Direction::West [INFO] [stdout] 286 + (*end_a == Direction::South || *end_a == Direction::North) && (*end_b == Direction::West || *end_b == Direction::East) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pipe_maze.rs:286:17 [INFO] [stdout] | [INFO] [stdout] 286 | / *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 | | || *end_a == Direction::North && *end_b == Direction::West [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] 286 - *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 - || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 286 + !(*end_a != Direction::North || *end_b != Direction::East && *end_b != Direction::West) [INFO] [stdout] | [INFO] [stdout] 286 - *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 - || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 286 + (*end_b == Direction::West || *end_b == Direction::East) && *end_a == Direction::North [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual absolute difference pattern without using `abs_diff` [INFO] [stdout] --> src/cosmic_expansion.rs:35:32 [INFO] [stdout] | [INFO] [stdout] 35 | let row_distance = if galaxy_a_row > galaxy_b_row { galaxy_a_row - galaxy_b_row } else { galaxy_b_row - galaxy_a_row }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `abs_diff`: `galaxy_a_row.abs_diff(*galaxy_b_row)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff [INFO] [stdout] = note: `#[warn(clippy::manual_abs_diff)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual absolute difference pattern without using `abs_diff` [INFO] [stdout] --> src/cosmic_expansion.rs:36:35 [INFO] [stdout] | [INFO] [stdout] 36 | ...ce = if galaxy_a_column > galaxy_b_column { galaxy_a_column - galaxy_b_column } else { galaxy_b_column - galaxy_a_column }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `abs_diff`: `galaxy_a_column.abs_diff(*galaxy_b_column)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/hot_springs.rs:74:30 [INFO] [stdout] | [INFO] [stdout] 74 | if groups.is_empty() { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 75 | | cache.insert(cache_key, 1); [INFO] [stdout] 76 | | return 1; [INFO] [stdout] 77 | | } else if groups.len() == 1 && group_counter == groups[0] { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/hot_springs.rs:77:67 [INFO] [stdout] | [INFO] [stdout] 77 | } else if groups.len() == 1 && group_counter == groups[0] { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 78 | | cache.insert(cache_key, 1); [INFO] [stdout] 79 | | return 1; [INFO] [stdout] 80 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/hot_springs.rs:121:61 [INFO] [stdout] | [INFO] [stdout] 121 | let with_operational_spring = ".".to_string() + &springs[1..].to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&springs[1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/hot_springs.rs:123:56 [INFO] [stdout] | [INFO] [stdout] 123 | let with_broken_spring = "#".to_string() + &springs[1..].to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&springs[1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u16` is unnecessary [INFO] [stdout] --> src/lens_library.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | ascii_codes.iter().fold(0 as u16, |acc, code| { [INFO] [stdout] | ^^^^^^^^ help: try: `0_u16` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/lens_library.rs:22:26 [INFO] [stdout] | [INFO] [stdout] 22 | sequence.iter().fold(0 as usize, |acc, elem| { [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: unneeded unit return type [INFO] [stdout] --> src/lens_library.rs:84:44 [INFO] [stdout] | [INFO] [stdout] 84 | pub fn add_lens(&mut self, lens: &Lens) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/lens_library.rs:98:50 [INFO] [stdout] | [INFO] [stdout] 98 | pub fn remove_lens(&mut self, label: &String) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/point_of_incidence.rs:4:14 [INFO] [stdout] | [INFO] [stdout] 4 | .map(|block| parse_pattern(block)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_pattern` [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: manual implementation of an assign operation [INFO] [stdout] --> src/point_of_incidence.rs:41:20 [INFO] [stdout] | [INFO] [stdout] 41 | '.' => result = result << 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `result <<= 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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/point_of_incidence.rs:50:36 [INFO] [stdout] | [INFO] [stdout] 50 | fn find_point_of_reflection(lines: &Vec) -> Option { [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] 50 - fn find_point_of_reflection(lines: &Vec) -> Option { [INFO] [stdout] 50 + fn find_point_of_reflection(lines: &[u32]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u8` is unnecessary [INFO] [stdout] --> src/floor_will_be_lava.rs:7:42 [INFO] [stdout] | [INFO] [stdout] 7 | let mut energization_map = vec![vec![0 as u8; width]; lines.len()]; [INFO] [stdout] | ^^^^^^^ help: try: `0_u8` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u8` is unnecessary [INFO] [stdout] --> src/floor_will_be_lava.rs:55:46 [INFO] [stdout] | [INFO] [stdout] 55 | let mut energization_map = vec![vec![0 as u8; width]; lines.len()]; [INFO] [stdout] | ^^^^^^^ help: try: `0_u8` [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: called `unwrap` on `next_tile_index` after checking its variant with `is_none` [INFO] [stdout] --> src/floor_will_be_lava.rs:224:34 [INFO] [stdout] | [INFO] [stdout] 219 | if next_tile_index.is_none() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = next_tile_index` [INFO] [stdout] ... [INFO] [stdout] 224 | current_tile_index = next_tile_index.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: unneeded unit return type [INFO] [stdout] --> src/floor_will_be_lava.rs:90:2 [INFO] [stdout] | [INFO] [stdout] 90 | ) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/floor_will_be_lava.rs:227:13 [INFO] [stdout] | [INFO] [stdout] 227 | 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: usage of a legacy numeric constant [INFO] [stdout] --> src/clumsy_crucible.rs:413:69 [INFO] [stdout] | [INFO] [stdout] 413 | shortest_distance: if i == 0 && j == 0 { 0 } else { std::usize::MAX }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [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] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 413 - shortest_distance: if i == 0 && j == 0 { 0 } else { std::usize::MAX }, [INFO] [stdout] 413 + shortest_distance: if i == 0 && j == 0 { 0 } else { usize::MAX }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i64` is unnecessary [INFO] [stdout] --> src/lavaduct_lagoon.rs:8:52 [INFO] [stdout] | [INFO] [stdout] 8 | let contour_length: i64 = dig_plan.iter().fold(0 as i64, |acc, entry| [INFO] [stdout] | ^^^^^^^^ help: try: `0_i64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i64` is unnecessary [INFO] [stdout] --> src/lavaduct_lagoon.rs:26:52 [INFO] [stdout] | [INFO] [stdout] 26 | let contour_length: i64 = dig_plan.iter().fold(0 as i64, |acc, entry| [INFO] [stdout] | ^^^^^^^^ help: try: `0_i64` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/lavaduct_lagoon.rs:38:31 [INFO] [stdout] | [INFO] [stdout] 38 | fn calculate_surface(corners: &Vec<(i64, i64)>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn calculate_surface(corners: &Vec<(i64, i64)>) -> i64 { [INFO] [stdout] 38 + fn calculate_surface(corners: &[(i64, i64)]) -> i64 { [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/lavaduct_lagoon.rs:58:30 [INFO] [stdout] | [INFO] [stdout] 58 | fn get_all_corners(dig_plan: &Vec) -> Vec<(i64, i64)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 58 - fn get_all_corners(dig_plan: &Vec) -> Vec<(i64, i64)> { [INFO] [stdout] 58 + fn get_all_corners(dig_plan: &[DigPlanEntry]) -> Vec<(i64, i64)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i64, i64)` which implements the `Copy` trait [INFO] [stdout] --> src/lavaduct_lagoon.rs:66:26 [INFO] [stdout] | [INFO] [stdout] 66 | corners.push(current_position.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `current_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/lavaduct_lagoon.rs:106:34 [INFO] [stdout] | [INFO] [stdout] 106 | let pow: usize = (16 as usize).pow(i as u32); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `16_usize` [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: immediately dereferencing a reference [INFO] [stdout] --> src/aplenty.rs:144:40 [INFO] [stdout] | [INFO] [stdout] 144 | let value_to_compare = *(&cond[2..].parse::().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cond[2..].parse::().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof [INFO] [stdout] = note: `#[warn(clippy::deref_addrof)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/gear_ratios.rs:88:39 [INFO] [stdout] | [INFO] [stdout] 88 | fn get_engine_parts(engine_schematic: &str) -> Vec<(Vec, Vec)> { [INFO] [stdout] | ^^^^ ^^^^^ ^^^^^ the same lifetime is hidden here [INFO] [stdout] | | | [INFO] [stdout] | | the same lifetime is hidden here [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 88 | fn get_engine_parts(engine_schematic: &str) -> Vec<(Vec>, Vec>)> { [INFO] [stdout] | ++++ ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `arrived_from` is never used [INFO] [stdout] --> src/clumsy_crucible.rs:381:4 [INFO] [stdout] | [INFO] [stdout] 381 | fn arrived_from(current_node: &NodeAddress, prev_node: &NodeAddress) -> Direction { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `calculate_all_rating_combinations` is never used [INFO] [stdout] --> src/aplenty.rs:54:8 [INFO] [stdout] | [INFO] [stdout] 54 | pub fn calculate_all_rating_combinations(file: &str) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_condition_pass_posibilities` and `get_condition_fail_posibilities` are never used [INFO] [stdout] --> src/aplenty.rs:175:12 [INFO] [stdout] | [INFO] [stdout] 135 | impl Condition { [INFO] [stdout] | -------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 175 | pub fn get_condition_pass_posibilities(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 182 | pub fn get_condition_fail_posibilities(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/puzzle_reader.rs:27:18 [INFO] [stdout] | [INFO] [stdout] 27 | read_arg(&program_args, DAY_ARG_PREFIX), [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `program_args` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/puzzle_reader.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | read_arg(&program_args, PART_ARG_PREFIX), [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `program_args` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/puzzle_reader.rs:40:19 [INFO] [stdout] | [INFO] [stdout] 40 | fn read_arg(args: &Vec, arg_name: &str) -> Result { [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] 40 - fn read_arg(args: &Vec, arg_name: &str) -> Result { [INFO] [stdout] 40 + fn read_arg(args: &[String], arg_name: &str) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/trebuchet.rs:3:54 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn calibrate_using_digits_only(calibration_file: &String) -> usize { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn calibrate_using_digits_only(calibration_file: &String) -> usize { [INFO] [stdout] 3 + pub fn calibrate_using_digits_only(calibration_file: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/trebuchet.rs:18:10 [INFO] [stdout] | [INFO] [stdout] 18 | .fold(0, |acc, elem| acc + elem) [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_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/trebuchet.rs:10:18 [INFO] [stdout] | [INFO] [stdout] 10 | .filter_map(|x| x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] = note: `#[warn(clippy::filter_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/trebuchet.rs:21:57 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn calibrate_using_spelled_digits(calibration_file: &String) -> usize { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 21 - pub fn calibrate_using_spelled_digits(calibration_file: &String) -> usize { [INFO] [stdout] 21 + pub fn calibrate_using_spelled_digits(calibration_file: &str) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/trebuchet.rs:36:10 [INFO] [stdout] | [INFO] [stdout] 36 | .fold(0, |acc, elem| acc + elem) [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_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/trebuchet.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | .filter_map(|x| x) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/trebuchet.rs:25:52 [INFO] [stdout] | [INFO] [stdout] 25 | let nums: Vec = find_candidates(&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] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/trebuchet.rs:47:32 [INFO] [stdout] | [INFO] [stdout] 47 | .map(|p| Regex::new(p).expect(format!("Failed to build regex for pattern {p}").as_str())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("Failed to build regex for pattern {p}"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/cube_conundrum.rs:107:10 [INFO] [stdout] | [INFO] [stdout] 107 | .fold(0, |acc, elem| acc + elem) [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_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/cube_conundrum.rs:111:5 [INFO] [stdout] | [INFO] [stdout] 111 | / game.cube_sets [INFO] [stdout] 112 | | .iter() [INFO] [stdout] 113 | | .flat_map(|cube_set| cube_set.cubes.get(&color)) [INFO] [stdout] 114 | | .max() [INFO] [stdout] 115 | | .map(|&n| n) [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 111 ~ game.cube_sets [INFO] [stdout] 112 + .iter() [INFO] [stdout] 113 + .flat_map(|cube_set| cube_set.cubes.get(&color)) [INFO] [stdout] 114 + .max().copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/gear_ratios.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | / engine_schematic [INFO] [stdout] 93 | | .split("\n") [INFO] [stdout] 94 | | .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] 92 ~ engine_schematic [INFO] [stdout] 93 + .split("\n") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/scratchcards.rs:115:10 [INFO] [stdout] | [INFO] [stdout] 115 | .fold(0, |sum, line_points| sum + line_points) [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_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/scratchcards.rs:133:63 [INFO] [stdout] | [INFO] [stdout] 133 | cards.iter().map(|card| count_card_tree_size(&cards, card)).fold(0, |acc, elem| acc + elem) [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_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Range` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:172:37 [INFO] [stdout] | [INFO] [stdout] 172 | let mut range_to_map = Some(range.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*range` [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: accessing first element with `mapping_result.get(0)` [INFO] [stdout] --> src/garden.rs:179:44 [INFO] [stdout] | [INFO] [stdout] 179 | let mapped_range = mapping_result.get(0).expect("Unexpected error"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping_result.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: using `clone` on type `Range` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:180:38 [INFO] [stdout] | [INFO] [stdout] 180 | results.push(mapped_range.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*mapped_range` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `mapping_result.get(0)` [INFO] [stdout] --> src/garden.rs:184:44 [INFO] [stdout] | [INFO] [stdout] 184 | let mapped_range = mapping_result.get(0).expect("Unexpected error"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `mapping_result.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: using `clone` on type `Range` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:185:38 [INFO] [stdout] | [INFO] [stdout] 185 | results.push(mapped_range.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*mapped_range` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/garden.rs:193:9 [INFO] [stdout] | [INFO] [stdout] 193 | / match range_to_map { [INFO] [stdout] 194 | | Some(r) => results.push(r.clone()), [INFO] [stdout] 195 | | None => (), [INFO] [stdout] 196 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(r) = range_to_map { results.push(r.clone()) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Range` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:194:37 [INFO] [stdout] | [INFO] [stdout] 194 | Some(r) => results.push(r.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `r` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/garden.rs:201:38 [INFO] [stdout] | [INFO] [stdout] 201 | pub fn map_ranges(&self, ranges: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 201 - pub fn map_ranges(&self, ranges: &Vec) -> Vec { [INFO] [stdout] 201 + pub fn map_ranges(&self, ranges: &[Range]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/garden.rs:292:26 [INFO] [stdout] | [INFO] [stdout] 292 | source = destination.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `destination` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/boat_races.rs:40:14 [INFO] [stdout] | [INFO] [stdout] 40 | .zip(record_distances.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 40 - .zip(record_distances.into_iter()) [INFO] [stdout] 40 + .zip(record_distances) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/boat_races.rs:75:55 [INFO] [stdout] | [INFO] [stdout] 75 | let distance_covered = calculate_distance(&race_time, &candidate); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `race_time` [INFO] [stdout] | [INFO] [stdout] = 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/camel_cards.rs:21:47 [INFO] [stdout] | [INFO] [stdout] 21 | card_ord = card_b.partial_cmp(&card_a).unwrap_or(Ordering::Equal); [INFO] [stdout] | ^^^^^^^ help: change this to: `card_a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/camel_cards.rs:64:45 [INFO] [stdout] | [INFO] [stdout] 64 | _ => card_b.partial_cmp(&card_a).unwrap_or(Ordering::Equal) [INFO] [stdout] | ^^^^^^^ help: change this to: `card_a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/camel_cards.rs:196:47 [INFO] [stdout] | [INFO] [stdout] 196 | let grouped_cards = Hand::group_cards(&cards); [INFO] [stdout] | ^^^^^^ help: change this to: `cards` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `cards.get(0)` [INFO] [stdout] --> src/camel_cards.rs:197:26 [INFO] [stdout] | [INFO] [stdout] 197 | let first_card = cards.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `cards.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/camel_cards.rs:245:47 [INFO] [stdout] | [INFO] [stdout] 245 | let grouped_cards = Hand::group_cards(&cards); [INFO] [stdout] | ^^^^^^ help: change this to: `cards` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `cards.get(0)` [INFO] [stdout] --> src/camel_cards.rs:246:26 [INFO] [stdout] | [INFO] [stdout] 246 | let first_card = cards.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `cards.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/camel_cards.rs:334:27 [INFO] [stdout] | [INFO] [stdout] 334 | fn group_cards(cards: &Vec) -> HashMap { [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] 334 - fn group_cards(cards: &Vec) -> HashMap { [INFO] [stdout] 334 + fn group_cards(cards: &[Card]) -> HashMap { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Card` which implements the `Copy` trait [INFO] [stdout] --> src/camel_cards.rs:340:42 [INFO] [stdout] | [INFO] [stdout] 340 | grouped_cards.insert(card.clone(), cards_already_added + 1); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*card` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Card` which implements the `Copy` trait [INFO] [stdout] --> src/camel_cards.rs:343:42 [INFO] [stdout] | [INFO] [stdout] 343 | grouped_cards.insert(card.clone(), 1 as usize); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*card` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/camel_cards.rs:343:56 [INFO] [stdout] | [INFO] [stdout] 343 | grouped_cards.insert(card.clone(), 1 as usize); [INFO] [stdout] | ^^^^^^^^^^ help: try: `1_usize` [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: use of `unwrap_or` to construct default value [INFO] [stdout] --> src/haunted_wasteland.rs:30:10 [INFO] [stdout] | [INFO] [stdout] 30 | .unwrap_or(Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/haunted_wasteland.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | / match file_split.next() { [INFO] [stdout] 34 | | Some(map_block) => { [INFO] [stdout] 35 | | for line in map_block.split("\n") { [INFO] [stdout] 36 | | let mut line_split = line.split(" = "); [INFO] [stdout] ... | [INFO] [stdout] 48 | | None => (), [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 33 ~ if let Some(map_block) = file_split.next() { [INFO] [stdout] 34 + for line in map_block.split("\n") { [INFO] [stdout] 35 + let mut line_split = line.split(" = "); [INFO] [stdout] 36 + let maybe_node = line_split.next(); [INFO] [stdout] 37 + let maybe_node_pair = line_split.next().and_then(NodePair::parse); [INFO] [stdout] 38 + [INFO] [stdout] 39 + match (maybe_node, maybe_node_pair) { [INFO] [stdout] 40 + (Some(node), Some(node_pair)) => { [INFO] [stdout] 41 + nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] 42 + } [INFO] [stdout] 43 + _ => (), [INFO] [stdout] 44 + } [INFO] [stdout] 45 + } [INFO] [stdout] 46 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/haunted_wasteland.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | / match (maybe_node, maybe_node_pair) { [INFO] [stdout] 41 | | (Some(node), Some(node_pair)) => { [INFO] [stdout] 42 | | nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 40 ~ if let (Some(node), Some(node_pair)) = (maybe_node, maybe_node_pair) { [INFO] [stdout] 41 + nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] 42 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/haunted_wasteland.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | steps = steps + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `steps += 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] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `unwrap_or` to construct default value [INFO] [stdout] --> src/haunted_wasteland.rs:93:10 [INFO] [stdout] | [INFO] [stdout] 93 | .unwrap_or(Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/haunted_wasteland.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | / match file_split.next() { [INFO] [stdout] 97 | | Some(map_block) => { [INFO] [stdout] 98 | | for line in map_block.split("\n") { [INFO] [stdout] 99 | | let mut line_split = line.split(" = "); [INFO] [stdout] ... | [INFO] [stdout] 111 | | None => (), [INFO] [stdout] 112 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 96 ~ if let Some(map_block) = file_split.next() { [INFO] [stdout] 97 + for line in map_block.split("\n") { [INFO] [stdout] 98 + let mut line_split = line.split(" = "); [INFO] [stdout] 99 + let maybe_node = line_split.next(); [INFO] [stdout] 100 + let maybe_node_pair = line_split.next().and_then(NodePair::parse); [INFO] [stdout] 101 + [INFO] [stdout] 102 + match (maybe_node, maybe_node_pair) { [INFO] [stdout] 103 + (Some(node), Some(node_pair)) => { [INFO] [stdout] 104 + nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] 105 + } [INFO] [stdout] 106 + _ => (), [INFO] [stdout] 107 + } [INFO] [stdout] 108 + } [INFO] [stdout] 109 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/haunted_wasteland.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | / match (maybe_node, maybe_node_pair) { [INFO] [stdout] 104 | | (Some(node), Some(node_pair)) => { [INFO] [stdout] 105 | | nodes_map.insert(node.to_string(), node_pair); [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#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 103 ~ if let (Some(node), Some(node_pair)) = (maybe_node, maybe_node_pair) { [INFO] [stdout] 104 + nodes_map.insert(node.to_string(), node_pair); [INFO] [stdout] 105 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/haunted_wasteland.rs:122:38 [INFO] [stdout] | [INFO] [stdout] 122 | let mut current_node: &str = &start_node; [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `start_node` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/haunted_wasteland.rs:127:13 [INFO] [stdout] | [INFO] [stdout] 127 | steps = steps + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `steps += 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::ops::RangeInclusive` [INFO] [stdout] --> src/mirage_maintenance.rs:78:22 [INFO] [stdout] | [INFO] [stdout] 78 | for row_index in (0..=values_matrix.len() - 1).into_iter().rev() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..=values_matrix.len() - 1)` [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: manual implementation of an assign operation [INFO] [stdout] --> src/mirage_maintenance.rs:86:9 [INFO] [stdout] | [INFO] [stdout] 86 | next_row_last_element = last_element_from_current_row + next_row_last_element; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `next_row_last_element += last_element_from_current_row` [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: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/mirage_maintenance.rs:103:31 [INFO] [stdout] | [INFO] [stdout] 103 | next_row.push(-1 * diff); [INFO] [stdout] | ^^^^^^^^^ help: consider using: `-diff` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::RangeInclusive` [INFO] [stdout] --> src/mirage_maintenance.rs:122:22 [INFO] [stdout] | [INFO] [stdout] 122 | for row_index in (0..=values_matrix.len() - 1).into_iter().rev() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..=values_matrix.len() - 1)` [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: using `clone` on type `MazeElement` which implements the `Copy` trait [INFO] [stdout] --> src/pipe_maze.rs:121:54 [INFO] [stdout] | [INFO] [stdout] 121 | points_inside.push((point_to_verify, element_to_verify.clone())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*element_to_verify` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `filter_map` with an identity function [INFO] [stdout] --> src/pipe_maze.rs:146:6 [INFO] [stdout] | [INFO] [stdout] 146 | .filter_map(|elem| elem) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Position` which implements the `Copy` trait [INFO] [stdout] --> src/pipe_maze.rs:182:36 [INFO] [stdout] | [INFO] [stdout] 182 | let mut current_position = start.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*start` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Position` which implements the `Copy` trait [INFO] [stdout] --> src/pipe_maze.rs:184:29 [INFO] [stdout] | [INFO] [stdout] 184 | let mut path = vec![start.clone()]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*start` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `MazeElement` which implements the `Copy` trait [INFO] [stdout] --> src/pipe_maze.rs:232:54 [INFO] [stdout] | [INFO] [stdout] 232 | .map(|element| (target_position, element.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*element` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pipe_maze.rs:286:17 [INFO] [stdout] | [INFO] [stdout] 286 | / *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 | | || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 288 | | || *end_a == Direction::South && *end_b == Direction::East [INFO] [stdout] 289 | | || *end_a == Direction::South && *end_b == Direction::West [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] 286 - *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 - || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 288 - || *end_a == Direction::South && *end_b == Direction::East [INFO] [stdout] 289 - || *end_a == Direction::South && *end_b == Direction::West [INFO] [stdout] 286 + !(*end_b != Direction::East && *end_b != Direction::West || *end_a != Direction::North && *end_a != Direction::South) [INFO] [stdout] | [INFO] [stdout] 286 - *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 - || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 288 - || *end_a == Direction::South && *end_b == Direction::East [INFO] [stdout] 289 - || *end_a == Direction::South && *end_b == Direction::West [INFO] [stdout] 286 + (*end_a == Direction::South || *end_a == Direction::North) && (*end_b == Direction::West || *end_b == Direction::East) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pipe_maze.rs:286:17 [INFO] [stdout] | [INFO] [stdout] 286 | / *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 | | || *end_a == Direction::North && *end_b == Direction::West [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] 286 - *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 - || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 286 + !(*end_a != Direction::North || *end_b != Direction::East && *end_b != Direction::West) [INFO] [stdout] | [INFO] [stdout] 286 - *end_a == Direction::North && *end_b == Direction::East [INFO] [stdout] 287 - || *end_a == Direction::North && *end_b == Direction::West [INFO] [stdout] 286 + (*end_b == Direction::West || *end_b == Direction::East) && *end_a == Direction::North [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual absolute difference pattern without using `abs_diff` [INFO] [stdout] --> src/cosmic_expansion.rs:35:32 [INFO] [stdout] | [INFO] [stdout] 35 | let row_distance = if galaxy_a_row > galaxy_b_row { galaxy_a_row - galaxy_b_row } else { galaxy_b_row - galaxy_a_row }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `abs_diff`: `galaxy_a_row.abs_diff(*galaxy_b_row)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff [INFO] [stdout] = note: `#[warn(clippy::manual_abs_diff)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual absolute difference pattern without using `abs_diff` [INFO] [stdout] --> src/cosmic_expansion.rs:36:35 [INFO] [stdout] | [INFO] [stdout] 36 | ...ce = if galaxy_a_column > galaxy_b_column { galaxy_a_column - galaxy_b_column } else { galaxy_b_column - galaxy_a_column }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with `abs_diff`: `galaxy_a_column.abs_diff(*galaxy_b_column)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/hot_springs.rs:74:30 [INFO] [stdout] | [INFO] [stdout] 74 | if groups.is_empty() { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 75 | | cache.insert(cache_key, 1); [INFO] [stdout] 76 | | return 1; [INFO] [stdout] 77 | | } else if groups.len() == 1 && group_counter == groups[0] { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/hot_springs.rs:77:67 [INFO] [stdout] | [INFO] [stdout] 77 | } else if groups.len() == 1 && group_counter == groups[0] { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 78 | | cache.insert(cache_key, 1); [INFO] [stdout] 79 | | return 1; [INFO] [stdout] 80 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/hot_springs.rs:121:61 [INFO] [stdout] | [INFO] [stdout] 121 | let with_operational_spring = ".".to_string() + &springs[1..].to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&springs[1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/hot_springs.rs:123:56 [INFO] [stdout] | [INFO] [stdout] 123 | let with_broken_spring = "#".to_string() + &springs[1..].to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&springs[1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u16` is unnecessary [INFO] [stdout] --> src/lens_library.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | ascii_codes.iter().fold(0 as u16, |acc, code| { [INFO] [stdout] | ^^^^^^^^ help: try: `0_u16` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/lens_library.rs:22:26 [INFO] [stdout] | [INFO] [stdout] 22 | sequence.iter().fold(0 as usize, |acc, elem| { [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: unneeded unit return type [INFO] [stdout] --> src/lens_library.rs:84:44 [INFO] [stdout] | [INFO] [stdout] 84 | pub fn add_lens(&mut self, lens: &Lens) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/lens_library.rs:98:50 [INFO] [stdout] | [INFO] [stdout] 98 | pub fn remove_lens(&mut self, label: &String) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/point_of_incidence.rs:4:14 [INFO] [stdout] | [INFO] [stdout] 4 | .map(|block| parse_pattern(block)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_pattern` [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: manual implementation of an assign operation [INFO] [stdout] --> src/point_of_incidence.rs:41:20 [INFO] [stdout] | [INFO] [stdout] 41 | '.' => result = result << 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `result <<= 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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/point_of_incidence.rs:50:36 [INFO] [stdout] | [INFO] [stdout] 50 | fn find_point_of_reflection(lines: &Vec) -> Option { [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] 50 - fn find_point_of_reflection(lines: &Vec) -> Option { [INFO] [stdout] 50 + fn find_point_of_reflection(lines: &[u32]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u8` is unnecessary [INFO] [stdout] --> src/floor_will_be_lava.rs:7:42 [INFO] [stdout] | [INFO] [stdout] 7 | let mut energization_map = vec![vec![0 as u8; width]; lines.len()]; [INFO] [stdout] | ^^^^^^^ help: try: `0_u8` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u8` is unnecessary [INFO] [stdout] --> src/floor_will_be_lava.rs:55:46 [INFO] [stdout] | [INFO] [stdout] 55 | let mut energization_map = vec![vec![0 as u8; width]; lines.len()]; [INFO] [stdout] | ^^^^^^^ help: try: `0_u8` [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: called `unwrap` on `next_tile_index` after checking its variant with `is_none` [INFO] [stdout] --> src/floor_will_be_lava.rs:224:34 [INFO] [stdout] | [INFO] [stdout] 219 | if next_tile_index.is_none() { [INFO] [stdout] | ---------------------------- help: try: `if let Some() = next_tile_index` [INFO] [stdout] ... [INFO] [stdout] 224 | current_tile_index = next_tile_index.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: unneeded unit return type [INFO] [stdout] --> src/floor_will_be_lava.rs:90:2 [INFO] [stdout] | [INFO] [stdout] 90 | ) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/floor_will_be_lava.rs:227:13 [INFO] [stdout] | [INFO] [stdout] 227 | 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: usage of a legacy numeric constant [INFO] [stdout] --> src/clumsy_crucible.rs:413:69 [INFO] [stdout] | [INFO] [stdout] 413 | shortest_distance: if i == 0 && j == 0 { 0 } else { std::usize::MAX }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [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] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 413 - shortest_distance: if i == 0 && j == 0 { 0 } else { std::usize::MAX }, [INFO] [stdout] 413 + shortest_distance: if i == 0 && j == 0 { 0 } else { usize::MAX }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i64` is unnecessary [INFO] [stdout] --> src/lavaduct_lagoon.rs:8:52 [INFO] [stdout] | [INFO] [stdout] 8 | let contour_length: i64 = dig_plan.iter().fold(0 as i64, |acc, entry| [INFO] [stdout] | ^^^^^^^^ help: try: `0_i64` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `i64` is unnecessary [INFO] [stdout] --> src/lavaduct_lagoon.rs:26:52 [INFO] [stdout] | [INFO] [stdout] 26 | let contour_length: i64 = dig_plan.iter().fold(0 as i64, |acc, entry| [INFO] [stdout] | ^^^^^^^^ help: try: `0_i64` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/lavaduct_lagoon.rs:38:31 [INFO] [stdout] | [INFO] [stdout] 38 | fn calculate_surface(corners: &Vec<(i64, i64)>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn calculate_surface(corners: &Vec<(i64, i64)>) -> i64 { [INFO] [stdout] 38 + fn calculate_surface(corners: &[(i64, i64)]) -> i64 { [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/lavaduct_lagoon.rs:58:30 [INFO] [stdout] | [INFO] [stdout] 58 | fn get_all_corners(dig_plan: &Vec) -> Vec<(i64, i64)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 58 - fn get_all_corners(dig_plan: &Vec) -> Vec<(i64, i64)> { [INFO] [stdout] 58 + fn get_all_corners(dig_plan: &[DigPlanEntry]) -> Vec<(i64, i64)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i64, i64)` which implements the `Copy` trait [INFO] [stdout] --> src/lavaduct_lagoon.rs:66:26 [INFO] [stdout] | [INFO] [stdout] 66 | corners.push(current_position.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `current_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/lavaduct_lagoon.rs:106:34 [INFO] [stdout] | [INFO] [stdout] 106 | let pow: usize = (16 as usize).pow(i as u32); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `16_usize` [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: immediately dereferencing a reference [INFO] [stdout] --> src/aplenty.rs:144:40 [INFO] [stdout] | [INFO] [stdout] 144 | let value_to_compare = *(&cond[2..].parse::().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cond[2..].parse::().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof [INFO] [stdout] = note: `#[warn(clippy::deref_addrof)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/gear_ratios.rs:88:39 [INFO] [stdout] | [INFO] [stdout] 88 | fn get_engine_parts(engine_schematic: &str) -> Vec<(Vec, Vec)> { [INFO] [stdout] | ^^^^ ^^^^^ ^^^^^ the same lifetime is hidden here [INFO] [stdout] | | | [INFO] [stdout] | | the same lifetime is hidden here [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 88 | fn get_engine_parts(engine_schematic: &str) -> Vec<(Vec>, Vec>)> { [INFO] [stdout] | ++++ ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.16s [INFO] running `Command { std: "docker" "inspect" "3c6fc0edbd5e62b08133f31e4135f935ef5a4e4b9eea4d339a18980abf1575fb", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3c6fc0edbd5e62b08133f31e4135f935ef5a4e4b9eea4d339a18980abf1575fb", kill_on_drop: false }` [INFO] [stdout] 3c6fc0edbd5e62b08133f31e4135f935ef5a4e4b9eea4d339a18980abf1575fb