[INFO] cloning repository https://github.com/dkrzyzak/aoc-2023-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/dkrzyzak/aoc-2023-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdkrzyzak%2Faoc-2023-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdkrzyzak%2Faoc-2023-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] b7aa4693ad8a76e849831d10731e9fe8c6c4d7af [INFO] linting dkrzyzak/aoc-2023-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdkrzyzak%2Faoc-2023-rust" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-1-tc1/source/.cargo/config.toml [INFO] started tweaking git repo https://github.com/dkrzyzak/aoc-2023-rust [INFO] finished tweaking git repo https://github.com/dkrzyzak/aoc-2023-rust [INFO] tweaked toml for git repo https://github.com/dkrzyzak/aoc-2023-rust written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/dkrzyzak/aoc-2023-rust on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/dkrzyzak/aoc-2023-rust already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded serde v1.0.207 [INFO] [stderr] Downloaded serde_derive v1.0.207 [INFO] [stderr] Downloaded syn v2.0.74 [INFO] [stderr] Downloaded serde_json v1.0.124 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] a79acd45aead56bfd18630de3bd1ac226d7b068446f060e0018d31c4403e5ffb [INFO] running `Command { std: "docker" "start" "-a" "a79acd45aead56bfd18630de3bd1ac226d7b068446f060e0018d31c4403e5ffb", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "a79acd45aead56bfd18630de3bd1ac226d7b068446f060e0018d31c4403e5ffb", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a79acd45aead56bfd18630de3bd1ac226d7b068446f060e0018d31c4403e5ffb", kill_on_drop: false }` [INFO] [stdout] a79acd45aead56bfd18630de3bd1ac226d7b068446f060e0018d31c4403e5ffb [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] c0751fc73503fb3313ecfd50bb93f5d180c22071a21b3f9eff45fd87021abce3 [INFO] running `Command { std: "docker" "start" "-a" "c0751fc73503fb3313ecfd50bb93f5d180c22071a21b3f9eff45fd87021abce3", kill_on_drop: false }` [INFO] [stderr] Checking generic-array v0.14.7 [INFO] [stderr] Compiling serde v1.0.207 [INFO] [stderr] Compiling serde_json v1.0.124 [INFO] [stderr] Checking regex-automata v0.4.3 [INFO] [stderr] Checking crypto-common v0.1.6 [INFO] [stderr] Checking block-buffer v0.10.4 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking md-5 v0.10.6 [INFO] [stderr] Checking regex v1.10.2 [INFO] [stderr] Checking adventofcode v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/y2015/day22/game.rs:1:20 [INFO] [stdout] | [INFO] [stdout] 1 | pub const SPELLS: &'static [&str; 5] = &["missile", "drain", "shield", "poison", "recharge"]; [INFO] [stdout] | -^^^^^^^---------- help: consider removing `'static`: `&[&str; 5]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/y2023/day2/mod.rs:38:29 [INFO] [stdout] | [INFO] [stdout] 38 | .any(|game| (game.red > 12 || game.green > 13 || game.blue > 14)); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 38 - .any(|game| (game.red > 12 || game.green > 13 || game.blue > 14)); [INFO] [stdout] 38 + .any(|game| game.red > 12 || game.green > 13 || game.blue > 14); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `crate` references the macro call's crate [INFO] [stdout] --> src/common/read.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | crate::common::read::read_input_file(std::path::Path::new(file!()).parent().unwrap()) [INFO] [stdout] | ^^^^^ help: to reference the macro definition's crate, use: `$crate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def [INFO] [stdout] = note: `#[warn(clippy::crate_in_macro_def)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/y2015/day22/game.rs:1:20 [INFO] [stdout] | [INFO] [stdout] 1 | pub const SPELLS: &'static [&str; 5] = &["missile", "drain", "shield", "poison", "recharge"]; [INFO] [stdout] | -^^^^^^^---------- help: consider removing `'static`: `&[&str; 5]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around closure body [INFO] [stdout] --> src/y2023/day2/mod.rs:38:29 [INFO] [stdout] | [INFO] [stdout] 38 | .any(|game| (game.red > 12 || game.green > 13 || game.blue > 14)); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 38 - .any(|game| (game.red > 12 || game.green > 13 || game.blue > 14)); [INFO] [stdout] 38 + .any(|game| game.red > 12 || game.green > 13 || game.blue > 14); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `crate` references the macro call's crate [INFO] [stdout] --> src/common/read.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | crate::common::read::read_input_file(std::path::Path::new(file!()).parent().unwrap()) [INFO] [stdout] | ^^^^^ help: to reference the macro definition's crate, use: `$crate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def [INFO] [stdout] = note: `#[warn(clippy::crate_in_macro_def)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `char_index` is used as a loop counter [INFO] [stdout] --> src/y2015/day1/mod.rs:10:4 [INFO] [stdout] | [INFO] [stdout] 10 | for paren in parens.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (char_index, paren) in (1_u32..).zip(parens.chars())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day2/mod.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | return ribbon_length; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return ribbon_length; [INFO] [stdout] 30 + ribbon_length [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2015/day3/mod.rs:22:20 [INFO] [stdout] | [INFO] [stdout] 22 | visited.insert(current_santa.clone(), 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `current_santa` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2015/day3/mod.rs:23:20 [INFO] [stdout] | [INFO] [stdout] 23 | visited.insert(current_robo.clone(), 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `current_robo` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day5/mod.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | return vowels_count >= 3 && has_doubled_letter; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 39 - return vowels_count >= 3 && has_doubled_letter; [INFO] [stdout] 39 + vowels_count >= 3 && has_doubled_letter [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/y2015/day5/mod.rs:5:17 [INFO] [stdout] | [INFO] [stdout] 5 | fn is_nice_1(s: &String) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - fn is_nice_1(s: &String) -> bool { [INFO] [stdout] 5 + fn is_nice_1(s: &str) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day5/mod.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | return actual_pairs > 0 && has_mirrored_pair; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 110 - return actual_pairs > 0 && has_mirrored_pair; [INFO] [stdout] 110 + actual_pairs > 0 && has_mirrored_pair [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/y2015/day5/mod.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | fn is_nice_2(s: &String) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 42 - fn is_nice_2(s: &String) -> bool { [INFO] [stdout] 42 + fn is_nice_2(s: &str) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2015/day5/mod.rs:57:18 [INFO] [stdout] | [INFO] [stdout] 57 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y2015/day5/mod.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | / if i > 0 { [INFO] [stdout] 61 | | if !has_mirrored_pair && chars[i - 1] == chars[i + 1] { [INFO] [stdout] 62 | | has_mirrored_pair = true; [INFO] [stdout] 63 | | } [INFO] [stdout] 64 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 60 ~ if i > 0 [INFO] [stdout] 61 ~ && !has_mirrored_pair && chars[i - 1] == chars[i + 1] { [INFO] [stdout] 62 | has_mirrored_pair = true; [INFO] [stdout] 63 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/y2015/day5/mod.rs:73:8 [INFO] [stdout] | [INFO] [stdout] 73 | if potential_pairs.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `potential_pairs.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day6/mod.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | return (String::new(), (0, 0), (0, 0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 17 - return (String::new(), (0, 0), (0, 0)); [INFO] [stdout] 17 + (String::new(), (0, 0), (0, 0)) [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/y2015/day6/mod.rs:5:28 [INFO] [stdout] | [INFO] [stdout] 5 | fn extract_from_line(line: &String) -> (String, (usize, usize), (usize, usize)) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - fn extract_from_line(line: &String) -> (String, (usize, usize), (usize, usize)) { [INFO] [stdout] 5 + fn extract_from_line(line: &str) -> (String, (usize, usize), (usize, usize)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/y2015/day6/mod.rs:27:18 [INFO] [stdout] | [INFO] [stdout] 27 | for x in p1.0..=p2.0 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 27 - for x in p1.0..=p2.0 { [INFO] [stdout] 27 + for in grid.iter_mut().take(p2.0 + 1).skip(p1.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/y2015/day6/mod.rs:28:22 [INFO] [stdout] | [INFO] [stdout] 28 | for y in p1.1..=p2.1 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 28 - for y in p1.1..=p2.1 { [INFO] [stdout] 28 + for in grid.iter_mut().take(p2.1 + 1).skip(p1.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/y2015/day6/mod.rs:34:25 [INFO] [stdout] | [INFO] [stdout] 34 | / if grid[x][y] > 0 { [INFO] [stdout] 35 | | grid[x][y] -= 1; [INFO] [stdout] 36 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 33 ~ "turn off" [INFO] [stdout] 34 ~ if grid[x][y] > 0 => { [INFO] [stdout] 35 | grid[x][y] -= 1; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day7/detector.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | return instruction; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 88 - return instruction; [INFO] [stdout] 88 + instruction [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/y2015/day7/mod.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | let dep = known_deps.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 33 ~ while let Some(dep) = known_deps.pop() { [INFO] [stdout] 34 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `instructions` [INFO] [stdout] --> src/y2015/day7/mod.rs:37:18 [INFO] [stdout] | [INFO] [stdout] 37 | for i in 0..instructions.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 37 - for i in 0..instructions.len() { [INFO] [stdout] 37 + for (i, ) in instructions.iter_mut().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day8/mod.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | return (s.len(), parsed_length); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 49 - return (s.len(), parsed_length); [INFO] [stdout] 49 + (s.len(), parsed_length) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day8/mod.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | return (s.len(), encoded.len()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 74 - return (s.len(), encoded.len()); [INFO] [stdout] 74 + (s.len(), encoded.len()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y2015/day9/mod.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashMap, u32}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `u32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2015/day9/mod.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 23 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2015/day9/mod.rs:27:14 [INFO] [stdout] | [INFO] [stdout] 27 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day9/mod.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | return total_distance; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 44 - return total_distance; [INFO] [stdout] 44 + total_distance [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day10/mod.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 33 - return result; [INFO] [stdout] 33 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day10/mod.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | while let Some(next_digit) = digits_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for next_digit in digits_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day11/mod.rs:22:29 [INFO] [stdout] | [INFO] [stdout] 22 | fn increment_password(pass: &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 22 - fn increment_password(pass: &String) -> String { [INFO] [stdout] 22 + fn increment_password(pass: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day11/mod.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | return pairs.len() >= 2; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 85 - return pairs.len() >= 2; [INFO] [stdout] 85 + pairs.len() >= 2 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/y2015/day12/mod.rs:47:25 [INFO] [stdout] | [INFO] [stdout] 47 | / if s == "red" { [INFO] [stdout] 48 | | has_red = true; [INFO] [stdout] 49 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 46 ~ Value::String(s) [INFO] [stdout] 47 ~ if s == "red" => { [INFO] [stdout] 48 | has_red = true; [INFO] [stdout] 49 ~ } [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/y2015/day12/mod.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | / match item { [INFO] [stdout] 46 | | Value::String(s) => { [INFO] [stdout] 47 | | if s == "red" { [INFO] [stdout] 48 | | has_red = true; [INFO] [stdout] ... | [INFO] [stdout] 51 | | _ => {} [INFO] [stdout] 52 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 45 ~ if let Value::String(s) = item { [INFO] [stdout] 46 + if s == "red" { [INFO] [stdout] 47 + has_red = true; [INFO] [stdout] 48 + } [INFO] [stdout] 49 + } [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/y2015/day13/extract_matrix.rs:3:41 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn extract_matrix_from_input(input: &Vec, people_count: usize) -> (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] 3 - pub fn extract_matrix_from_input(input: &Vec, people_count: usize) -> (Vec>, Vec) { [INFO] [stdout] 3 + pub fn extract_matrix_from_input(input: &[String], people_count: usize) -> (Vec>, Vec) { [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/y2015/day13/printers.rs:2:39 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn print_happiness_matrix(matrix: &Vec>, names: &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] 2 - pub fn print_happiness_matrix(matrix: &Vec>, names: &Vec) { [INFO] [stdout] 2 + pub fn print_happiness_matrix(matrix: &[Vec], names: &Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/y2015/day13/printers.rs:11:28 [INFO] [stdout] | [INFO] [stdout] 11 | let first_letter = name.chars().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `name.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` 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/y2015/day13/mod.rs:19:66 [INFO] [stdout] | [INFO] [stdout] 19 | let max = permutations.iter().map(|perm| calculate_happiness(&perm, &matrix, &names)).max().unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `perm` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day13/mod.rs:24:31 [INFO] [stdout] | [INFO] [stdout] 24 | fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [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] 24 - fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [INFO] [stdout] 24 + fn calculate_happiness(table: &[&String], happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [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/y2015/day13/mod.rs:24:64 [INFO] [stdout] | [INFO] [stdout] 24 | fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [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] 24 - fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [INFO] [stdout] 24 + fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &[Vec], original_names: &Vec) -> i16 { [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/y2015/day13/mod.rs:24:96 [INFO] [stdout] | [INFO] [stdout] 24 | fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [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] 24 - fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [INFO] [stdout] 24 + fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &[String]) -> i16 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day14/mod.rs:66:20 [INFO] [stdout] | [INFO] [stdout] 66 | fn race(reindeers: &mut Vec, cutoff: &u32) { [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] 66 - fn race(reindeers: &mut Vec, cutoff: &u32) { [INFO] [stdout] 66 + fn race(reindeers: &mut [Reindeer], cutoff: &u32) { [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/y2015/day15/helpers.rs:13:28 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn parse_ingredient(s: &String) -> Ingredient { [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] 13 - pub fn parse_ingredient(s: &String) -> Ingredient { [INFO] [stdout] 13 + pub fn parse_ingredient(s: &str) -> Ingredient { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day15/helpers.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | return (final_score, total_calories); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 59 - return (final_score, total_calories); [INFO] [stdout] 59 + (final_score, total_calories) [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/y2015/day15/helpers.rs:34:38 [INFO] [stdout] | [INFO] [stdout] 34 | pub fn get_cookie_score(ingredients: &Vec, amounts: &Vec) -> (i64, i16) { [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] 34 - pub fn get_cookie_score(ingredients: &Vec, amounts: &Vec) -> (i64, i16) { [INFO] [stdout] 34 + pub fn get_cookie_score(ingredients: &[Ingredient], amounts: &Vec) -> (i64, i16) { [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/y2015/day15/helpers.rs:34:65 [INFO] [stdout] | [INFO] [stdout] 34 | pub fn get_cookie_score(ingredients: &Vec, amounts: &Vec) -> (i64, i16) { [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] 34 - pub fn get_cookie_score(ingredients: &Vec, amounts: &Vec) -> (i64, i16) { [INFO] [stdout] 34 + pub fn get_cookie_score(ingredients: &Vec, amounts: &[i16]) -> (i64, i16) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: immediately dereferencing a reference [INFO] [stdout] --> src/y2015/day15/helpers.rs:45:22 [INFO] [stdout] | [INFO] [stdout] 45 | let amount = *(&amounts[i]); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `amounts[i]` [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: redundant closure [INFO] [stdout] --> src/y2015/day15/mod.rs:10:14 [INFO] [stdout] | [INFO] [stdout] 10 | .map(|line| parse_ingredient(line)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_ingredient` [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: attempt to mutate range bound within loop [INFO] [stdout] --> src/y2015/day15/mod.rs:23:17 [INFO] [stdout] | [INFO] [stdout] 23 | remain = 100 - a - b - c; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the range of the loop is unchanged [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mut_range_bound [INFO] [stdout] = note: `#[warn(clippy::mut_range_bound)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/y2015/day16/helpers.rs:18:1 [INFO] [stdout] | [INFO] [stdout] 18 | / impl Default for Aunt { [INFO] [stdout] 19 | | fn default() -> Self { [INFO] [stdout] 20 | | Aunt { [INFO] [stdout] 21 | | id: 0, [INFO] [stdout] ... | [INFO] [stdout] 34 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 4 + #[derive(Default)] [INFO] [stdout] 5 | pub struct Aunt { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/y2015/day16/helpers.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | aunt.id = id; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `y2015::day16::helpers::Aunt { id: id, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/y2015/day16/helpers.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | let mut aunt = Aunt::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day16/mod.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 85 - return true; [INFO] [stdout] 85 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: immediately dereferencing a reference [INFO] [stdout] --> src/y2015/day17/mod.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | let container = *(&containers[i]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `containers[i]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day18/helpers.rs:1:25 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn print_grid(grid: &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] 1 - pub fn print_grid(grid: &Vec>) { [INFO] [stdout] 1 + pub fn print_grid(grid: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y2015/day18/helpers.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / (x == size - 1 && y == size - 1) [INFO] [stdout] 10 | | || (x == size - 1 && y == 0) [INFO] [stdout] 11 | | || (x == 0 && y == size - 1) [INFO] [stdout] 12 | | || (x == 0 && y == 0) [INFO] [stdout] | |_____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 9 - (x == size - 1 && y == size - 1) [INFO] [stdout] 10 - || (x == size - 1 && y == 0) [INFO] [stdout] 11 - || (x == 0 && y == size - 1) [INFO] [stdout] 12 - || (x == 0 && y == 0) [INFO] [stdout] 9 + !(y != size - 1 && y != 0 || x != size - 1 && x != 0) [INFO] [stdout] | [INFO] [stdout] 9 - (x == size - 1 && y == size - 1) [INFO] [stdout] 10 - || (x == size - 1 && y == 0) [INFO] [stdout] 11 - || (x == 0 && y == size - 1) [INFO] [stdout] 12 - || (x == 0 && y == 0) [INFO] [stdout] 9 + (x == 0 || x == size - 1) && (y == 0 || y == size - 1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y2015/day18/helpers.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / (x == size - 1 && y == size - 1) [INFO] [stdout] 10 | | || (x == size - 1 && y == 0) [INFO] [stdout] | |____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 9 - (x == size - 1 && y == size - 1) [INFO] [stdout] 10 - || (x == size - 1 && y == 0) [INFO] [stdout] 9 + !(x != size - 1 || y != size - 1 && y != 0) [INFO] [stdout] | [INFO] [stdout] 9 - (x == size - 1 && y == size - 1) [INFO] [stdout] 10 - || (x == size - 1 && y == 0) [INFO] [stdout] 9 + (y == 0 || y == size - 1) && x == size - 1 [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/y2015/day18/helpers.rs:15:51 [INFO] [stdout] | [INFO] [stdout] 15 | pub fn count_neighbours(x: usize, y: usize, grid: &Vec>, grid_size: &usize) -> (u8, u8) { [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] 15 - pub fn count_neighbours(x: usize, y: usize, grid: &Vec>, grid_size: &usize) -> (u8, u8) { [INFO] [stdout] 15 + pub fn count_neighbours(x: usize, y: usize, grid: &[Vec], grid_size: &usize) -> (u8, u8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/y2015/day18/mod.rs:31:29 [INFO] [stdout] | [INFO] [stdout] 31 | let is_on = if light == '#' { true } else { false }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `light == '#'` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day19/helpers.rs:4:33 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn parse_productions(lines: &Vec) -> (Vec<(String, String)>, String) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - pub fn parse_productions(lines: &Vec) -> (Vec<(String, String)>, String) { [INFO] [stdout] 4 + pub fn parse_productions(lines: &[String]) -> (Vec<(String, String)>, String) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day19/helpers.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2015/day19/helpers.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day19/helpers.rs:26:41 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn reverse_productions(productions: &Vec<(String, String)>) -> Vec<(String, String)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 26 - pub fn reverse_productions(productions: &Vec<(String, String)>) -> Vec<(String, String)> { [INFO] [stdout] 26 + pub fn reverse_productions(productions: &[(String, String)]) -> Vec<(String, String)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2015/day19/mod.rs:33:46 [INFO] [stdout] | [INFO] [stdout] 33 | let captured_iter = re.captures_iter(&starting); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `starting` [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/y2015/day19/mod.rs:40:33 [INFO] [stdout] | [INFO] [stdout] 40 | production.push_str(&replacement); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `replacement` [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 `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day19/mod.rs:51:14 [INFO] [stdout] | [INFO] [stdout] 51 | fn reduce(s: &String, productions: &Vec<(String, String)>) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - fn reduce(s: &String, productions: &Vec<(String, String)>) { [INFO] [stdout] 51 + fn reduce(s: &str, productions: &Vec<(String, String)>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `houses` [INFO] [stdout] --> src/y2015/day20/mod.rs:19:14 [INFO] [stdout] | [INFO] [stdout] 19 | for i in 1..input / 10 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 19 - for i in 1..input / 10 { [INFO] [stdout] 19 + for (i, ) in houses.iter().enumerate().take(input / 10).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day21/game.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | return boss.hit_points <= 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 42 - return boss.hit_points <= 0; [INFO] [stdout] 42 + boss.hit_points <= 0 [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/y2015/day21/shop.rs:11:34 [INFO] [stdout] | [INFO] [stdout] 11 | pub fn get_shop_inventory(lines: &Vec) -> (Vec, 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] 11 - pub fn get_shop_inventory(lines: &Vec) -> (Vec, Vec, Vec) { [INFO] [stdout] 11 + pub fn get_shop_inventory(lines: &[String]) -> (Vec, Vec, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day21/shop.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2015/day21/shop.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day21/shop.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2015/day21/shop.rs:39:12 [INFO] [stdout] | [INFO] [stdout] 39 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day21/shop.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2015/day21/shop.rs:62:12 [INFO] [stdout] | [INFO] [stdout] 62 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Player` which implements the `Copy` trait [INFO] [stdout] --> src/y2015/day22/game.rs:32:22 [INFO] [stdout] | [INFO] [stdout] 32 | let mut player = _player.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*_player` [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 `Boss` which implements the `Copy` trait [INFO] [stdout] --> src/y2015/day22/game.rs:33:20 [INFO] [stdout] | [INFO] [stdout] 33 | let mut boss = _boss.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*_boss` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day22/game.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | return has_shield; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 117 - return has_shield; [INFO] [stdout] 117 + has_shield [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/y2015/day23/instructions.rs:19:36 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn extract_instructions(lines: &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] 19 - pub fn extract_instructions(lines: &Vec) -> Vec { [INFO] [stdout] 19 + pub fn extract_instructions(lines: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y2015/day23/instructions.rs:22:14 [INFO] [stdout] | [INFO] [stdout] 22 | .map(|line| parse_line(line)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day23/instructions.rs:26:21 [INFO] [stdout] | [INFO] [stdout] 26 | fn parse_line(line: &String) -> Instruction { [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] 26 - fn parse_line(line: &String) -> Instruction { [INFO] [stdout] 26 + fn parse_line(line: &str) -> Instruction { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/y2015/day25/mod.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / let mut row = Vec::new(); [INFO] [stdout] 21 | | row.push(value); [INFO] [stdout] | |____________________________^ help: consider using the `vec![]` macro: `let row = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/y2015/day25/mod.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 55 - print!("\n"); [INFO] [stdout] 55 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2022/day1/mod.rs:7:12 [INFO] [stdout] | [INFO] [stdout] 7 | if item == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `item.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2022/day2/shapes.rs:77:30 [INFO] [stdout] | [INFO] [stdout] 77 | pub fn extract_shapes(lines: &Vec) -> Vec<(Shape, Shape)> { [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] 77 - pub fn extract_shapes(lines: &Vec) -> Vec<(Shape, Shape)> { [INFO] [stdout] 77 + pub fn extract_shapes(lines: &[String]) -> Vec<(Shape, Shape)> { [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/y2022/day2/shapes.rs:99:37 [INFO] [stdout] | [INFO] [stdout] 99 | pub fn extract_shapes_part_2(lines: &Vec) -> Vec<(Shape, Outcome)> { [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] 99 - pub fn extract_shapes_part_2(lines: &Vec) -> Vec<(Shape, Outcome)> { [INFO] [stdout] 99 + pub fn extract_shapes_part_2(lines: &[String]) -> Vec<(Shape, Outcome)> { [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/y2022/day3/mod.rs:12:22 [INFO] [stdout] | [INFO] [stdout] 12 | pub fn part_1(lines: &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] 12 - pub fn part_1(lines: &Vec) { [INFO] [stdout] 12 + pub fn part_1(lines: &[String]) { [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/y2022/day3/mod.rs:30:22 [INFO] [stdout] | [INFO] [stdout] 30 | pub fn part_2(lines: &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] 30 - pub fn part_2(lines: &Vec) { [INFO] [stdout] 30 + pub fn part_2(lines: &[String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2022/day3/mod.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | return ascii_value - 96; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 54 - return ascii_value - 96; [INFO] [stdout] 54 + ascii_value - 96 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2022/day4/mod.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | return if no_overlap {0} else {1}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 25 - return if no_overlap {0} else {1}; [INFO] [stdout] 25 + if no_overlap {0} else {1} [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/y2022/day5/extract.rs:13:29 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn extract_input(lines: &Vec) -> (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] 13 - pub fn extract_input(lines: &Vec) -> (Vec>, Vec) { [INFO] [stdout] 13 + pub fn extract_input(lines: &[String]) -> (Vec>, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2022/day5/extract.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | while let Some(line) = lines_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in lines_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2022/day5/extract.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | while let Some(line) = lines_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in lines_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2022/day5/extract.rs:52:26 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn process_row(line: &String) -> 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] 52 - pub fn process_row(line: &String) -> Vec> { [INFO] [stdout] 52 + pub fn process_row(line: &str) -> Vec> { [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/y2022/day6/mod.rs:15:32 [INFO] [stdout] | [INFO] [stdout] 15 | pub fn get_start_index(stream: &Vec, marker_len: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 15 - pub fn get_start_index(stream: &Vec, marker_len: usize) -> usize { [INFO] [stdout] 15 + pub fn get_start_index(stream: &[char], marker_len: usize) -> usize { [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/y2022/day7/traverse.rs:13:31 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn traverse(instructions: &Vec) -> Entity { [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] 13 - pub fn traverse(instructions: &Vec) -> Entity { [INFO] [stdout] 13 + pub fn traverse(instructions: &[String]) -> Entity { [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/y2022/day7/traverse.rs:59:52 [INFO] [stdout] | [INFO] [stdout] 59 | fn get_dir_by_path<'a>(root: &'a mut Entity, path: &Vec) -> &'a mut Entity { [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] 59 - fn get_dir_by_path<'a>(root: &'a mut Entity, path: &Vec) -> &'a mut Entity { [INFO] [stdout] 59 + fn get_dir_by_path<'a>(root: &'a mut Entity, path: &[String]) -> &'a mut Entity { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/y2022/day7/mod.rs:34:29 [INFO] [stdout] | [INFO] [stdout] 34 | let mut suitable_dirs = cache [INFO] [stdout] | _____________________________^ [INFO] [stdout] 35 | | .values() [INFO] [stdout] 36 | | .filter(|val| **val >= missing_space) [INFO] [stdout] 37 | | .map(|val| *val) [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] 34 ~ let mut suitable_dirs = cache [INFO] [stdout] 35 + .values() [INFO] [stdout] 36 + .filter(|val| **val >= missing_space).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2022/day7/mod.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | return dir_size; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 61 - return dir_size; [INFO] [stdout] 61 + dir_size [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day1/mod.rs:54:37 [INFO] [stdout] | [INFO] [stdout] 54 | .map(|line| extract_numbers(&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: redundant closure [INFO] [stdout] --> src/y2023/day2/mod.rs:29:22 [INFO] [stdout] | [INFO] [stdout] 29 | .map(|game| parse_game_colors(game)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_game_colors` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y2023/day2/mod.rs:60:22 [INFO] [stdout] | [INFO] [stdout] 60 | .map(|game| parse_game_colors(game)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_game_colors` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/y2023/day2/mod.rs:98:18 [INFO] [stdout] | [INFO] [stdout] 98 | let number = re [INFO] [stdout] | __________________^ [INFO] [stdout] 99 | | .captures(input) [INFO] [stdout] 100 | | .and_then(|captures| captures.get(1)) [INFO] [stdout] 101 | | .and_then(|number_str| number_str.as_str().parse::().ok()) [INFO] [stdout] 102 | | .unwrap_or_else(|| 0); [INFO] [stdout] | |_____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 102 - .unwrap_or_else(|| 0); [INFO] [stdout] 102 + .unwrap_or(0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/y2023/day2/mod.rs:122:21 [INFO] [stdout] | [INFO] [stdout] 122 | let value = regex [INFO] [stdout] | _____________________^ [INFO] [stdout] 123 | | .captures(input) [INFO] [stdout] 124 | | .and_then(|captures| captures.get(1)) [INFO] [stdout] 125 | | .and_then(|number_str| number_str.as_str().parse::().ok()) [INFO] [stdout] 126 | | .unwrap_or_else(|| 0); [INFO] [stdout] | |_________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 126 - .unwrap_or_else(|| 0); [INFO] [stdout] 126 + .unwrap_or(0); [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/y2023/day3/mod.rs:24:20 [INFO] [stdout] | [INFO] [stdout] 24 | fn get_value(v: &Vec>, row: isize, col: isize) -> Option<&T> { [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] 24 - fn get_value(v: &Vec>, row: isize, col: isize) -> Option<&T> { [INFO] [stdout] 24 + fn get_value(v: &[Vec], row: isize, col: isize) -> Option<&T> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `char_index` is used as a loop counter [INFO] [stdout] --> src/y2015/day1/mod.rs:10:4 [INFO] [stdout] | [INFO] [stdout] 10 | for paren in parens.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (char_index, paren) in (1_u32..).zip(parens.chars())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/y2023/day3/mod.rs:143:14 [INFO] [stdout] | [INFO] [stdout] 143 | .or_insert(Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day2/mod.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | return ribbon_length; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return ribbon_length; [INFO] [stdout] 30 + ribbon_length [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/y2023/day4/mod.rs:40:10 [INFO] [stdout] | [INFO] [stdout] 40 | .fold(0u32, |sum, curr| sum + curr); [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day4/mod.rs:22:47 [INFO] [stdout] | [INFO] [stdout] 22 | let winning_numbers = get_num_vec(&str11); [INFO] [stdout] | ^^^^^^ help: change this to: `str11` [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/y2023/day4/mod.rs:23:42 [INFO] [stdout] | [INFO] [stdout] 23 | let my_numbers = get_num_vec(&str2); [INFO] [stdout] | ^^^^^ help: change this to: `str2` [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/y2023/day4/mod.rs:55:47 [INFO] [stdout] | [INFO] [stdout] 55 | let winning_numbers = get_num_vec(&str11); [INFO] [stdout] | ^^^^^^ help: change this to: `str11` [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/y2023/day4/mod.rs:56:42 [INFO] [stdout] | [INFO] [stdout] 56 | let my_numbers = get_num_vec(&str2); [INFO] [stdout] | ^^^^^ help: change this to: `str2` [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: unneeded `return` statement [INFO] [stdout] --> src/y2023/day5/mappings.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | return value; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 39 - return value; [INFO] [stdout] 39 + value [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day5/helpers.rs:7:46 [INFO] [stdout] | [INFO] [stdout] 7 | let mut cap_iter = num_reg.captures_iter(&first_line); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `first_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: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day5/helpers.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | while let Some(value) = cap_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for value in cap_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day5/helpers.rs:29:13 [INFO] [stdout] | [INFO] [stdout] 29 | while let Some(next_line) = lines_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for next_line in lines_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2023/day5/helpers.rs:30:20 [INFO] [stdout] | [INFO] [stdout] 30 | if next_line == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `next_line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day5/helpers.rs:34:52 [INFO] [stdout] | [INFO] [stdout] 34 | let captured = ranges_reg.captures(&next_line).unwrap(); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `next_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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day5/helpers.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | pub fn find_location_for_seed(seed: u64, mappings: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - pub fn find_location_for_seed(seed: u64, mappings: &Vec) -> u64 { [INFO] [stdout] 51 + pub fn find_location_for_seed(seed: u64, mappings: &[Mapping]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2015/day3/mod.rs:22:20 [INFO] [stdout] | [INFO] [stdout] 22 | visited.insert(current_santa.clone(), 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `current_santa` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2015/day3/mod.rs:23:20 [INFO] [stdout] | [INFO] [stdout] 23 | visited.insert(current_robo.clone(), 1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `current_robo` [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: the loop variable `i` is only used to index `parsed` [INFO] [stdout] --> src/y2023/day6/mod.rs:16:13 [INFO] [stdout] | [INFO] [stdout] 16 | for i in 0..parsed[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 16 - for i in 0..parsed[0].len() { [INFO] [stdout] 16 + for in parsed.iter().take(parsed[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/y2023/day6/mod.rs:39:7 [INFO] [stdout] | [INFO] [stdout] 39 | }).fold(1, |sum, current| sum * current); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` [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: unneeded `return` statement [INFO] [stdout] --> src/y2015/day5/mod.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | return vowels_count >= 3 && has_doubled_letter; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 39 - return vowels_count >= 3 && has_doubled_letter; [INFO] [stdout] 39 + vowels_count >= 3 && has_doubled_letter [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/y2015/day5/mod.rs:5:17 [INFO] [stdout] | [INFO] [stdout] 5 | fn is_nice_1(s: &String) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - fn is_nice_1(s: &String) -> bool { [INFO] [stdout] 5 + fn is_nice_1(s: &str) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u32` which implements the `Copy` trait [INFO] [stdout] --> src/y2023/day7/mod.rs:100:25 [INFO] [stdout] | [INFO] [stdout] 100 | let joker_count = symbols.get(&'J').unwrap_or(&0).clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*symbols.get(&'J').unwrap_or(&0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day5/mod.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | return actual_pairs > 0 && has_mirrored_pair; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 110 - return actual_pairs > 0 && has_mirrored_pair; [INFO] [stdout] 110 + actual_pairs > 0 && has_mirrored_pair [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/y2015/day5/mod.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | fn is_nice_2(s: &String) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 42 - fn is_nice_2(s: &String) -> bool { [INFO] [stdout] 42 + fn is_nice_2(s: &str) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2015/day5/mod.rs:57:18 [INFO] [stdout] | [INFO] [stdout] 57 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y2015/day5/mod.rs:60:13 [INFO] [stdout] | [INFO] [stdout] 60 | / if i > 0 { [INFO] [stdout] 61 | | if !has_mirrored_pair && chars[i - 1] == chars[i + 1] { [INFO] [stdout] 62 | | has_mirrored_pair = true; [INFO] [stdout] 63 | | } [INFO] [stdout] 64 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 60 ~ if i > 0 [INFO] [stdout] 61 ~ && !has_mirrored_pair && chars[i - 1] == chars[i + 1] { [INFO] [stdout] 62 | has_mirrored_pair = true; [INFO] [stdout] 63 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lines.get(0)` [INFO] [stdout] --> src/y2023/day8/mod.rs:11:24 [INFO] [stdout] | [INFO] [stdout] 11 | let instructions = lines.get(0).unwrap().chars().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `lines.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: length comparison to one [INFO] [stdout] --> src/y2015/day5/mod.rs:73:8 [INFO] [stdout] | [INFO] [stdout] 73 | if potential_pairs.len() < 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `potential_pairs.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day6/mod.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | return (String::new(), (0, 0), (0, 0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 17 - return (String::new(), (0, 0), (0, 0)); [INFO] [stdout] 17 + (String::new(), (0, 0), (0, 0)) [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/y2015/day6/mod.rs:5:28 [INFO] [stdout] | [INFO] [stdout] 5 | fn extract_from_line(line: &String) -> (String, (usize, usize), (usize, usize)) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - fn extract_from_line(line: &String) -> (String, (usize, usize), (usize, usize)) { [INFO] [stdout] 5 + fn extract_from_line(line: &str) -> (String, (usize, usize), (usize, usize)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/y2023/day8/mod.rs:69:30 [INFO] [stdout] | [INFO] [stdout] 69 | let nodes: Vec = network [INFO] [stdout] | ______________________________^ [INFO] [stdout] 70 | | .keys() [INFO] [stdout] 71 | | .filter(|key| key.ends_with("A")) [INFO] [stdout] 72 | | .map(|key| key.clone()) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 69 ~ let nodes: Vec = network [INFO] [stdout] 70 + .keys() [INFO] [stdout] 71 + .filter(|key| key.ends_with("A")).cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `grid` [INFO] [stdout] --> src/y2015/day6/mod.rs:27:18 [INFO] [stdout] | [INFO] [stdout] 27 | for x in p1.0..=p2.0 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 27 - for x in p1.0..=p2.0 { [INFO] [stdout] 27 + for in grid.iter_mut().take(p2.0 + 1).skip(p1.0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `grid` [INFO] [stdout] --> src/y2015/day6/mod.rs:28:22 [INFO] [stdout] | [INFO] [stdout] 28 | for y in p1.1..=p2.1 { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 28 - for y in p1.1..=p2.1 { [INFO] [stdout] 28 + for in grid.iter_mut().take(p2.1 + 1).skip(p1.1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/y2015/day6/mod.rs:34:25 [INFO] [stdout] | [INFO] [stdout] 34 | / if grid[x][y] > 0 { [INFO] [stdout] 35 | | grid[x][y] -= 1; [INFO] [stdout] 36 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 33 ~ "turn off" [INFO] [stdout] 34 ~ if grid[x][y] > 0 => { [INFO] [stdout] 35 | grid[x][y] -= 1; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day7/detector.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | return instruction; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 88 - return instruction; [INFO] [stdout] 88 + instruction [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/y2023/day10/helpers.rs:10:25 [INFO] [stdout] | [INFO] [stdout] 10 | pub fn find_start(grid: &Vec>) -> Point { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 10 - pub fn find_start(grid: &Vec>) -> Point { [INFO] [stdout] 10 + pub fn find_start(grid: &[Vec]) -> Point { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day10/helpers.rs:69:28 [INFO] [stdout] | [INFO] [stdout] 69 | let start = find_start(&grid); [INFO] [stdout] | ^^^^^ help: change this to: `grid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to pop elements from a `Vec` in a loop [INFO] [stdout] --> src/y2015/day7/mod.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | let dep = known_deps.pop().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some [INFO] [stdout] = note: `#[warn(clippy::manual_while_let_some)]` on by default [INFO] [stdout] help: consider using a `while..let` loop [INFO] [stdout] | [INFO] [stdout] 33 ~ while let Some(dep) = known_deps.pop() { [INFO] [stdout] 34 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `instructions` [INFO] [stdout] --> src/y2015/day7/mod.rs:37:18 [INFO] [stdout] | [INFO] [stdout] 37 | for i in 0..instructions.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 37 - for i in 0..instructions.len() { [INFO] [stdout] 37 + for (i, ) in instructions.iter_mut().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `grid` [INFO] [stdout] --> src/y2023/day10/mod.rs:18:16 [INFO] [stdout] | [INFO] [stdout] 18 | for row in 0..board_rows { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 18 - for row in 0..board_rows { [INFO] [stdout] 18 + for (row, ) in grid.iter().enumerate().take(board_rows) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `grid` [INFO] [stdout] --> src/y2023/day10/mod.rs:22:20 [INFO] [stdout] | [INFO] [stdout] 22 | for col in 0..board_cols { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 22 - for col in 0..board_cols { [INFO] [stdout] 22 + for (col, ) in grid.iter().enumerate().take(board_cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day8/mod.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | return (s.len(), parsed_length); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 49 - return (s.len(), parsed_length); [INFO] [stdout] 49 + (s.len(), parsed_length) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day8/mod.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | return (s.len(), encoded.len()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 74 - return (s.len(), encoded.len()); [INFO] [stdout] 74 + (s.len(), encoded.len()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day11/mod.rs:98:34 [INFO] [stdout] | [INFO] [stdout] 98 | fn locate_empty_spaces(universe: &mut Vec>) -> (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] 98 - fn locate_empty_spaces(universe: &mut Vec>) -> (Vec, Vec) { [INFO] [stdout] 98 + fn locate_empty_spaces(universe: &mut [Vec]) -> (Vec, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `universe` [INFO] [stdout] --> src/y2023/day11/mod.rs:102:16 [INFO] [stdout] | [INFO] [stdout] 102 | for row in 0..universe.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 102 - for row in 0..universe.len() { [INFO] [stdout] 102 + for (row, ) in universe.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y2015/day9/mod.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashMap, u32}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `u32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2015/day9/mod.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 23 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2015/day9/mod.rs:27:14 [INFO] [stdout] | [INFO] [stdout] 27 | .or_insert_with(Vec::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day12/helpers.rs:9:29 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn extract_input(lines: &Vec) -> Vec<(String, 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] 9 - pub fn extract_input(lines: &Vec) -> Vec<(String, Vec)> { [INFO] [stdout] 9 + pub fn extract_input(lines: &[String]) -> Vec<(String, Vec)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day9/mod.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | return total_distance; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 44 - return total_distance; [INFO] [stdout] 44 + total_distance [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/y2023/day12/helpers.rs:22:32 [INFO] [stdout] | [INFO] [stdout] 22 | let springs_unfolded = repeat(springs.clone()).take(5).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(springs.clone(), 5)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y2023/day12/helpers.rs:25:33 [INFO] [stdout] | [INFO] [stdout] 25 | let contiguous_groups = captured[2] [INFO] [stdout] | _________________________________^ [INFO] [stdout] 26 | | .parse::() [INFO] [stdout] 27 | | .unwrap() [INFO] [stdout] 28 | | .split(",") [INFO] [stdout] 29 | | .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] 25 ~ let contiguous_groups = captured[2] [INFO] [stdout] 26 + .parse::() [INFO] [stdout] 27 + .unwrap() [INFO] [stdout] 28 + .split(",") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/y2023/day12/helpers.rs:33:73 [INFO] [stdout] | [INFO] [stdout] 33 | let unfolded_groups = repeat(contiguous_groups.clone()).take(5).flat_map(|v| v).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [INFO] [stdout] = note: `#[warn(clippy::flat_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/y2023/day12/helpers.rs:33:31 [INFO] [stdout] | [INFO] [stdout] 33 | let unfolded_groups = repeat(contiguous_groups.clone()).take(5).flat_map(|v| v).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(contiguous_groups.clone(), 5)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day12/helpers.rs:42:45 [INFO] [stdout] | [INFO] [stdout] 42 | pub fn get_correct_regex(contiguous_groups: &Vec) -> Regex { [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] 42 - pub fn get_correct_regex(contiguous_groups: &Vec) -> Regex { [INFO] [stdout] 42 + pub fn get_correct_regex(contiguous_groups: &[u8]) -> Regex { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/y2023/day12/helpers.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 51 | let reg = Regex::new(®ex_str).unwrap(); [INFO] [stdout] | ------------------------------------------ unnecessary `let` binding [INFO] [stdout] 52 | [INFO] [stdout] 53 | reg [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 51 ~ [INFO] [stdout] 52 | [INFO] [stdout] 53 ~ Regex::new(®ex_str).unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day10/mod.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | return result; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 33 - return result; [INFO] [stdout] 33 + result [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/y2023/day12/helpers.rs:56:48 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn get_acceptable_regex(contiguous_groups: &Vec) -> Regex { [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] 56 - pub fn get_acceptable_regex(contiguous_groups: &Vec) -> Regex { [INFO] [stdout] 56 + pub fn get_acceptable_regex(contiguous_groups: &[u8]) -> Regex { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day10/mod.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | while let Some(next_digit) = digits_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for next_digit in digits_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/y2023/day12/helpers.rs:66:5 [INFO] [stdout] | [INFO] [stdout] 64 | let reg = Regex::new(®ex_str).unwrap(); [INFO] [stdout] | ------------------------------------------ unnecessary `let` binding [INFO] [stdout] 65 | [INFO] [stdout] 66 | reg [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 64 ~ [INFO] [stdout] 65 | [INFO] [stdout] 66 ~ Regex::new(®ex_str).unwrap() [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/y2023/day12/helpers.rs:69:37 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn extract_subproblems(springs: &String, good_groups: &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] 69 - pub fn extract_subproblems(springs: &String, good_groups: &Vec) { [INFO] [stdout] 69 + pub fn extract_subproblems(springs: &str, good_groups: &Vec) { [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/y2023/day12/helpers.rs:69:59 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn extract_subproblems(springs: &String, good_groups: &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] 69 - pub fn extract_subproblems(springs: &String, good_groups: &Vec) { [INFO] [stdout] 69 + pub fn extract_subproblems(springs: &String, good_groups: &[u8]) { [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/y2015/day11/mod.rs:22:29 [INFO] [stdout] | [INFO] [stdout] 22 | fn increment_password(pass: &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 22 - fn increment_password(pass: &String) -> String { [INFO] [stdout] 22 + fn increment_password(pass: &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `iteration_count` is used as a loop counter [INFO] [stdout] --> src/y2023/day12/mod.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | for springs in springs_data.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (iteration_count, springs) in springs_data.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day11/mod.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 85 | return pairs.len() >= 2; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 85 - return pairs.len() >= 2; [INFO] [stdout] 85 + pairs.len() >= 2 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day12/mod.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / return get_correct_combinations(replaced_with_0, spring_groups.clone(), splitter, cache) [INFO] [stdout] 61 | | + get_correct_combinations(replaced_with_1, spring_groups.clone(), splitter, cache); [INFO] [stdout] | |___________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 60 ~ get_correct_combinations(replaced_with_0, spring_groups.clone(), splitter, cache) [INFO] [stdout] 61 ~ + get_correct_combinations(replaced_with_1, spring_groups.clone(), splitter, cache) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/y2023/day12/mod.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | splitter: &Regex, [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_splitter` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/y2023/day12/mod.rs:60:77 [INFO] [stdout] | [INFO] [stdout] 60 | return get_correct_combinations(replaced_with_0, spring_groups.clone(), splitter, cache) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 61 | + get_correct_combinations(replaced_with_1, spring_groups.clone(), splitter, cache); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/y2023/day12/mod.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | cache: &mut HashMap<(String, Vec), u128>, [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_cache` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/y2023/day12/mod.rs:60:87 [INFO] [stdout] | [INFO] [stdout] 60 | return get_correct_combinations(replaced_with_0, spring_groups.clone(), splitter, cache) [INFO] [stdout] | ^^^^^ [INFO] [stdout] 61 | + get_correct_combinations(replaced_with_1, spring_groups.clone(), splitter, cache); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day13/helpers.rs:1:31 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn extract_mirrors(lines: &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] 1 - pub fn extract_mirrors(lines: &Vec) -> Vec>> { [INFO] [stdout] 1 + pub fn extract_mirrors(lines: &[String]) -> Vec>> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day13/helpers.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2023/day13/helpers.rs:9:12 [INFO] [stdout] | [INFO] [stdout] 9 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day13/helpers.rs:22:29 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn print_mirror(mirror: &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] 22 - pub fn print_mirror(mirror: &Vec>) { [INFO] [stdout] 22 + pub fn print_mirror(mirror: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/y2015/day12/mod.rs:47:25 [INFO] [stdout] | [INFO] [stdout] 47 | / if s == "red" { [INFO] [stdout] 48 | | has_red = true; [INFO] [stdout] 49 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 46 ~ Value::String(s) [INFO] [stdout] 47 ~ if s == "red" => { [INFO] [stdout] 48 | has_red = true; [INFO] [stdout] 49 ~ } [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/y2015/day12/mod.rs:45:17 [INFO] [stdout] | [INFO] [stdout] 45 | / match item { [INFO] [stdout] 46 | | Value::String(s) => { [INFO] [stdout] 47 | | if s == "red" { [INFO] [stdout] 48 | | has_red = true; [INFO] [stdout] ... | [INFO] [stdout] 51 | | _ => {} [INFO] [stdout] 52 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 45 ~ if let Value::String(s) = item { [INFO] [stdout] 46 + if s == "red" { [INFO] [stdout] 47 + has_red = true; [INFO] [stdout] 48 + } [INFO] [stdout] 49 + } [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/y2015/day13/extract_matrix.rs:3:41 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn extract_matrix_from_input(input: &Vec, people_count: usize) -> (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] 3 - pub fn extract_matrix_from_input(input: &Vec, people_count: usize) -> (Vec>, Vec) { [INFO] [stdout] 3 + pub fn extract_matrix_from_input(input: &[String], people_count: usize) -> (Vec>, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/y2023/day13/helpers.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | 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: unneeded `return` statement [INFO] [stdout] --> src/y2023/day13/helpers.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | return diffs == 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 36 - return diffs == 1; [INFO] [stdout] 36 + diffs == 1 [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/y2023/day13/helpers.rs:29:41 [INFO] [stdout] | [INFO] [stdout] 29 | pub fn possible_horizontal_smudge(row1: &Vec, row2: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - pub fn possible_horizontal_smudge(row1: &Vec, row2: &Vec) -> bool { [INFO] [stdout] 29 + pub fn possible_horizontal_smudge(row1: &[char], row2: &Vec) -> bool { [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/y2023/day13/helpers.rs:39:33 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn horizontal_index(mirror: &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] 39 - pub fn horizontal_index(mirror: &Vec>) -> Option { [INFO] [stdout] 39 + pub fn horizontal_index(mirror: &[Vec]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/y2023/day13/helpers.rs:58:16 [INFO] [stdout] | [INFO] [stdout] 58 | if &mirror[search_back as usize] != &mirror[search_forward] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 58 - if &mirror[search_back as usize] != &mirror[search_forward] { [INFO] [stdout] 58 + if mirror[search_back as usize] != mirror[search_forward] { [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/y2015/day13/printers.rs:2:39 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn print_happiness_matrix(matrix: &Vec>, names: &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] 2 - pub fn print_happiness_matrix(matrix: &Vec>, names: &Vec) { [INFO] [stdout] 2 + pub fn print_happiness_matrix(matrix: &[Vec], names: &Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/y2015/day13/printers.rs:11:28 [INFO] [stdout] | [INFO] [stdout] 11 | let first_letter = name.chars().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `name.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` 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/y2023/day13/mod.rs:13:58 [INFO] [stdout] | [INFO] [stdout] 13 | if let Some(horizontal_index) = horizontal_index(&mirror) { [INFO] [stdout] | ^^^^^^^ help: change this to: `mirror` [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/y2023/day13/mod.rs:17:54 [INFO] [stdout] | [INFO] [stdout] 17 | if let Some(vertical_index) = vertical_index(&mirror) { [INFO] [stdout] | ^^^^^^^ help: change this to: `mirror` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/tilt.rs:1:27 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn tilt_north(mirror: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1 - pub fn tilt_north(mirror: &mut Vec>) { [INFO] [stdout] 1 + pub fn tilt_north(mirror: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is only used to index `mirror` [INFO] [stdout] --> src/y2023/day14/tilt.rs:5:16 [INFO] [stdout] | [INFO] [stdout] 5 | for col in 0..cols { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 5 - for col in 0..cols { [INFO] [stdout] 5 + for in mirror.iter_mut().take(cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2015/day13/mod.rs:19:66 [INFO] [stdout] | [INFO] [stdout] 19 | let max = permutations.iter().map(|perm| calculate_happiness(&perm, &matrix, &names)).max().unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `perm` [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/tilt.rs:31:27 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn tilt_south(mirror: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 31 - pub fn tilt_south(mirror: &mut Vec>) { [INFO] [stdout] 31 + pub fn tilt_south(mirror: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is only used to index `mirror` [INFO] [stdout] --> src/y2023/day14/tilt.rs:35:16 [INFO] [stdout] | [INFO] [stdout] 35 | for col in 0..cols { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 35 - for col in 0..cols { [INFO] [stdout] 35 + for in mirror.iter_mut().take(cols) { [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/y2015/day13/mod.rs:24:31 [INFO] [stdout] | [INFO] [stdout] 24 | fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [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] 24 - fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [INFO] [stdout] 24 + fn calculate_happiness(table: &[&String], happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [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/y2015/day13/mod.rs:24:64 [INFO] [stdout] | [INFO] [stdout] 24 | fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [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] 24 - fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [INFO] [stdout] 24 + fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &[Vec], original_names: &Vec) -> i16 { [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/y2015/day13/mod.rs:24:96 [INFO] [stdout] | [INFO] [stdout] 24 | fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [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] 24 - fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &Vec) -> i16 { [INFO] [stdout] 24 + fn calculate_happiness(table: &Vec<&String>, happiness_matrix: &Vec>, original_names: &[String]) -> i16 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/y2023/day14/tilt.rs:43:21 [INFO] [stdout] | [INFO] [stdout] 43 | / if row > 0 { [INFO] [stdout] 44 | | last_free_space = row - 1; [INFO] [stdout] 45 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 42 ~ '#' [INFO] [stdout] 43 ~ if row > 0 => { [INFO] [stdout] 44 | last_free_space = row - 1; [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/y2023/day14/tilt.rs:55:21 [INFO] [stdout] | [INFO] [stdout] 55 | / if last_free_space > 0 { [INFO] [stdout] 56 | | last_free_space -= 1; [INFO] [stdout] 57 | | } [INFO] [stdout] | |_____________________^ help: try: `last_free_space = last_free_space.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/tilt.rs:65:26 [INFO] [stdout] | [INFO] [stdout] 65 | pub fn tilt_east(mirror: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 65 - pub fn tilt_east(mirror: &mut Vec>) { [INFO] [stdout] 65 + pub fn tilt_east(mirror: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is only used to index `mirror` [INFO] [stdout] --> src/y2023/day14/tilt.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | for row in 0..rows { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 69 - for row in 0..rows { [INFO] [stdout] 69 + for in mirror.iter_mut().take(rows) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/y2023/day14/tilt.rs:77:21 [INFO] [stdout] | [INFO] [stdout] 77 | / if col > 0 { [INFO] [stdout] 78 | | last_free_space = col - 1; [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 76 ~ '#' [INFO] [stdout] 77 ~ if col > 0 => { [INFO] [stdout] 78 | last_free_space = col - 1; [INFO] [stdout] 79 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/y2023/day14/tilt.rs:90:21 [INFO] [stdout] | [INFO] [stdout] 90 | / if last_free_space > 0 { [INFO] [stdout] 91 | | last_free_space -= 1; [INFO] [stdout] 92 | | } [INFO] [stdout] | |_____________________^ help: try: `last_free_space = last_free_space.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/tilt.rs:100:26 [INFO] [stdout] | [INFO] [stdout] 100 | pub fn tilt_west(mirror: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - pub fn tilt_west(mirror: &mut Vec>) { [INFO] [stdout] 100 + pub fn tilt_west(mirror: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is only used to index `mirror` [INFO] [stdout] --> src/y2023/day14/tilt.rs:104:16 [INFO] [stdout] | [INFO] [stdout] 104 | for row in 0..rows { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 104 - for row in 0..rows { [INFO] [stdout] 104 + for in mirror.iter_mut().take(rows) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day14/mod.rs:66:20 [INFO] [stdout] | [INFO] [stdout] 66 | fn race(reindeers: &mut Vec, cutoff: &u32) { [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] 66 - fn race(reindeers: &mut Vec, cutoff: &u32) { [INFO] [stdout] 66 + fn race(reindeers: &mut [Reindeer], cutoff: &u32) { [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/y2023/day14/cycle.rs:2:26 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn find_cycle(loads: &Vec) -> Option<(&[usize], usize)> { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 2 - pub fn find_cycle(loads: &Vec) -> Option<(&[usize], usize)> { [INFO] [stdout] 2 + pub fn find_cycle(loads: &[usize]) -> Option<(&[usize], usize)> { [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/y2015/day15/helpers.rs:13:28 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn parse_ingredient(s: &String) -> Ingredient { [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] 13 - pub fn parse_ingredient(s: &String) -> Ingredient { [INFO] [stdout] 13 + pub fn parse_ingredient(s: &str) -> Ingredient { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day15/helpers.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | return (final_score, total_calories); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 59 - return (final_score, total_calories); [INFO] [stdout] 59 + (final_score, total_calories) [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/y2015/day15/helpers.rs:34:38 [INFO] [stdout] | [INFO] [stdout] 34 | pub fn get_cookie_score(ingredients: &Vec, amounts: &Vec) -> (i64, i16) { [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] 34 - pub fn get_cookie_score(ingredients: &Vec, amounts: &Vec) -> (i64, i16) { [INFO] [stdout] 34 + pub fn get_cookie_score(ingredients: &[Ingredient], amounts: &Vec) -> (i64, i16) { [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/y2015/day15/helpers.rs:34:65 [INFO] [stdout] | [INFO] [stdout] 34 | pub fn get_cookie_score(ingredients: &Vec, amounts: &Vec) -> (i64, i16) { [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] 34 - pub fn get_cookie_score(ingredients: &Vec, amounts: &Vec) -> (i64, i16) { [INFO] [stdout] 34 + pub fn get_cookie_score(ingredients: &Vec, amounts: &[i16]) -> (i64, i16) { [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/y2023/day14/mod.rs:45:29 [INFO] [stdout] | [INFO] [stdout] 45 | pub fn print_mirror(mirror: &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] 45 - pub fn print_mirror(mirror: &Vec>) { [INFO] [stdout] 45 + pub fn print_mirror(mirror: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: immediately dereferencing a reference [INFO] [stdout] --> src/y2015/day15/helpers.rs:45:22 [INFO] [stdout] | [INFO] [stdout] 45 | let amount = *(&amounts[i]); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `amounts[i]` [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: empty string literal in `println!` [INFO] [stdout] --> src/y2023/day14/mod.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/mod.rs:52:37 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn calculate_total_load(mirror: &Vec>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 52 - pub fn calculate_total_load(mirror: &Vec>) -> usize { [INFO] [stdout] 52 + pub fn calculate_total_load(mirror: &[Vec]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y2015/day15/mod.rs:10:14 [INFO] [stdout] | [INFO] [stdout] 10 | .map(|line| parse_ingredient(line)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_ingredient` [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: attempt to mutate range bound within loop [INFO] [stdout] --> src/y2015/day15/mod.rs:23:17 [INFO] [stdout] | [INFO] [stdout] 23 | remain = 100 - a - b - c; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: the range of the loop is unchanged [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mut_range_bound [INFO] [stdout] = note: `#[warn(clippy::mut_range_bound)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day15/hash.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 37 | return Operation::Insert(label, fl); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 37 - return Operation::Insert(label, fl); [INFO] [stdout] 37 + Operation::Insert(label, fl) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lines.get(0)` [INFO] [stdout] --> src/y2023/day15/mod.rs:10:21 [INFO] [stdout] | [INFO] [stdout] 10 | let sequences = lines.get(0).unwrap().split(",").collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `lines.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 `impl` can be derived [INFO] [stdout] --> src/y2015/day16/helpers.rs:18:1 [INFO] [stdout] | [INFO] [stdout] 18 | / impl Default for Aunt { [INFO] [stdout] 19 | | fn default() -> Self { [INFO] [stdout] 20 | | Aunt { [INFO] [stdout] 21 | | id: 0, [INFO] [stdout] ... | [INFO] [stdout] 34 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 4 + #[derive(Default)] [INFO] [stdout] 5 | pub struct Aunt { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day15/mod.rs:25:43 [INFO] [stdout] | [INFO] [stdout] 25 | let hash = calculate_hash(&label); [INFO] [stdout] | ^^^^^^ help: change this to: `label` [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: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/y2015/day16/helpers.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | aunt.id = id; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `y2015::day16::helpers::Aunt { id: id, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/y2015/day16/helpers.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | let mut aunt = Aunt::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2023/day15/mod.rs:27:50 [INFO] [stdout] | [INFO] [stdout] 27 | let entry = hash_map.entry(hash).or_insert_with(Vec::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day15/mod.rs:35:43 [INFO] [stdout] | [INFO] [stdout] 35 | let hash = calculate_hash(&label); [INFO] [stdout] | ^^^^^^ help: change this to: `label` [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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2023/day15/mod.rs:36:50 [INFO] [stdout] | [INFO] [stdout] 36 | let entry = hash_map.entry(hash).or_insert_with(Vec::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day16/mod.rs:85:9 [INFO] [stdout] | [INFO] [stdout] 85 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 85 - return true; [INFO] [stdout] 85 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | / return tile_value [INFO] [stdout] 90 | | + traverse_cave(next_point, dir, cave, visited_tiles, visited_splitters); [INFO] [stdout] | |________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 89 ~ tile_value [INFO] [stdout] 90 ~ + traverse_cave(next_point, dir, cave, visited_tiles, visited_splitters) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | / return tile_value [INFO] [stdout] 104 | | + traverse_cave(point1, direction1, cave, visited_tiles, visited_splitters) [INFO] [stdout] 105 | | + traverse_cave(point2, direction2, cave, visited_tiles, visited_splitters); [INFO] [stdout] | |_______________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 103 ~ tile_value [INFO] [stdout] 104 + + traverse_cave(point1, direction1, cave, visited_tiles, visited_splitters) [INFO] [stdout] 105 ~ + traverse_cave(point2, direction2, cave, visited_tiles, visited_splitters) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:108:17 [INFO] [stdout] | [INFO] [stdout] 108 | / return tile_value [INFO] [stdout] 109 | | + traverse_cave(next_point, dir, cave, visited_tiles, visited_splitters); [INFO] [stdout] | |____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 108 ~ tile_value [INFO] [stdout] 109 ~ + traverse_cave(next_point, dir, cave, visited_tiles, visited_splitters) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:115:13 [INFO] [stdout] | [INFO] [stdout] 115 | / return tile_value [INFO] [stdout] 116 | | + traverse_cave(next_point, next_dir, cave, visited_tiles, visited_splitters); [INFO] [stdout] | |_____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 115 ~ tile_value [INFO] [stdout] 116 ~ + traverse_cave(next_point, next_dir, cave, visited_tiles, visited_splitters) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:119:13 [INFO] [stdout] | [INFO] [stdout] 119 | return 0; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 119 - return 0; [INFO] [stdout] 119 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2023/day16/mod.rs:81:40 [INFO] [stdout] | [INFO] [stdout] 81 | let was_new = visited_tiles.insert(point.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `point` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/y2023/day16/mod.rs:87:41 [INFO] [stdout] | [INFO] [stdout] 87 | let next_point = point.next(&dir); [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: immediately dereferencing a reference [INFO] [stdout] --> src/y2015/day17/mod.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | let container = *(&containers[i]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `containers[i]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2023/day16/mod.rs:98:38 [INFO] [stdout] | [INFO] [stdout] 98 | visited_splitters.insert(point.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `point` [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/y2015/day18/helpers.rs:1:25 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn print_grid(grid: &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] 1 - pub fn print_grid(grid: &Vec>) { [INFO] [stdout] 1 + pub fn print_grid(grid: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/y2023/day16/mod.rs:107:45 [INFO] [stdout] | [INFO] [stdout] 107 | let next_point = point.next(&dir); [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y2015/day18/helpers.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / (x == size - 1 && y == size - 1) [INFO] [stdout] 10 | | || (x == size - 1 && y == 0) [INFO] [stdout] 11 | | || (x == 0 && y == size - 1) [INFO] [stdout] 12 | | || (x == 0 && y == 0) [INFO] [stdout] | |_____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 9 - (x == size - 1 && y == size - 1) [INFO] [stdout] 10 - || (x == size - 1 && y == 0) [INFO] [stdout] 11 - || (x == 0 && y == size - 1) [INFO] [stdout] 12 - || (x == 0 && y == 0) [INFO] [stdout] 9 + !(y != size - 1 && y != 0 || x != size - 1 && x != 0) [INFO] [stdout] | [INFO] [stdout] 9 - (x == size - 1 && y == size - 1) [INFO] [stdout] 10 - || (x == size - 1 && y == 0) [INFO] [stdout] 11 - || (x == 0 && y == size - 1) [INFO] [stdout] 12 - || (x == 0 && y == 0) [INFO] [stdout] 9 + (x == 0 || x == size - 1) && (y == 0 || y == size - 1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y2015/day18/helpers.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / (x == size - 1 && y == size - 1) [INFO] [stdout] 10 | | || (x == size - 1 && y == 0) [INFO] [stdout] | |____________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 9 - (x == size - 1 && y == size - 1) [INFO] [stdout] 10 - || (x == size - 1 && y == 0) [INFO] [stdout] 9 + !(x != size - 1 || y != size - 1 && y != 0) [INFO] [stdout] | [INFO] [stdout] 9 - (x == size - 1 && y == size - 1) [INFO] [stdout] 10 - || (x == size - 1 && y == 0) [INFO] [stdout] 9 + (y == 0 || y == size - 1) && x == size - 1 [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/y2015/day18/helpers.rs:15:51 [INFO] [stdout] | [INFO] [stdout] 15 | pub fn count_neighbours(x: usize, y: usize, grid: &Vec>, grid_size: &usize) -> (u8, u8) { [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] 15 - pub fn count_neighbours(x: usize, y: usize, grid: &Vec>, grid_size: &usize) -> (u8, u8) { [INFO] [stdout] 15 + pub fn count_neighbours(x: usize, y: usize, grid: &[Vec], grid_size: &usize) -> (u8, u8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/y2023/day17/dijkstra.rs:33:49 [INFO] [stdout] | [INFO] [stdout] 33 | let next_point = current_point.next(&last_dir); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `last_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/y2015/day18/mod.rs:31:29 [INFO] [stdout] | [INFO] [stdout] 31 | let is_on = if light == '#' { true } else { false }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `light == '#'` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day18/helpers.rs:9:26 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn min_x(points: &Vec) -> isize { [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] 9 - pub fn min_x(points: &Vec) -> isize { [INFO] [stdout] 9 + pub fn min_x(points: &[Point]) -> isize { [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/y2023/day18/helpers.rs:13:26 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn min_y(points: &Vec) -> isize { [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] 13 - pub fn min_y(points: &Vec) -> isize { [INFO] [stdout] 13 + pub fn min_y(points: &[Point]) -> isize { [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/y2015/day19/helpers.rs:4:33 [INFO] [stdout] | [INFO] [stdout] 4 | pub fn parse_productions(lines: &Vec) -> (Vec<(String, String)>, String) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - pub fn parse_productions(lines: &Vec) -> (Vec<(String, String)>, String) { [INFO] [stdout] 4 + pub fn parse_productions(lines: &[String]) -> (Vec<(String, String)>, String) { [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/y2023/day18/helpers.rs:17:26 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn max_x(points: &Vec) -> isize { [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] 17 - pub fn max_x(points: &Vec) -> isize { [INFO] [stdout] 17 + pub fn max_x(points: &[Point]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day19/helpers.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day18/helpers.rs:21:26 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn max_y(points: &Vec) -> isize { [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 max_y(points: &Vec) -> isize { [INFO] [stdout] 21 + pub fn max_y(points: &[Point]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2015/day19/helpers.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day18/helpers.rs:35:34 [INFO] [stdout] | [INFO] [stdout] 35 | pub fn extract_dig_plan_1(lines: &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] 35 - pub fn extract_dig_plan_1(lines: &Vec) -> Vec { [INFO] [stdout] 35 + pub fn extract_dig_plan_1(lines: &[String]) -> Vec { [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/y2015/day19/helpers.rs:26:41 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn reverse_productions(productions: &Vec<(String, String)>) -> Vec<(String, String)> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 26 - pub fn reverse_productions(productions: &Vec<(String, String)>) -> Vec<(String, String)> { [INFO] [stdout] 26 + pub fn reverse_productions(productions: &[(String, String)]) -> Vec<(String, String)> { [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/y2023/day18/helpers.rs:53:34 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn extract_dig_plan_2(lines: &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] 53 - pub fn extract_dig_plan_2(lines: &Vec) -> Vec { [INFO] [stdout] 53 + pub fn extract_dig_plan_2(lines: &[String]) -> Vec { [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/y2023/day18/helpers.rs:76:33 [INFO] [stdout] | [INFO] [stdout] 76 | pub fn shoelace_formula(points: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 76 - pub fn shoelace_formula(points: &Vec) -> isize { [INFO] [stdout] 76 + pub fn shoelace_formula(points: &[Point]) -> isize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2015/day19/mod.rs:33:46 [INFO] [stdout] | [INFO] [stdout] 33 | let captured_iter = re.captures_iter(&starting); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `starting` [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/y2015/day19/mod.rs:40:33 [INFO] [stdout] | [INFO] [stdout] 40 | production.push_str(&replacement); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `replacement` [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 `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day19/mod.rs:51:14 [INFO] [stdout] | [INFO] [stdout] 51 | fn reduce(s: &String, productions: &Vec<(String, String)>) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - fn reduce(s: &String, productions: &Vec<(String, String)>) { [INFO] [stdout] 51 + fn reduce(s: &str, productions: &Vec<(String, String)>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `houses` [INFO] [stdout] --> src/y2015/day20/mod.rs:19:14 [INFO] [stdout] | [INFO] [stdout] 19 | for i in 1..input / 10 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 19 - for i in 1..input / 10 { [INFO] [stdout] 19 + for (i, ) in houses.iter().enumerate().take(input / 10).skip(1) { [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/y2023/day18/mod.rs:17:30 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn dig_corners(dig_plan: &Vec, field: &mut Vec, starting_point: Point) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 17 - pub fn dig_corners(dig_plan: &Vec, field: &mut Vec, starting_point: Point) { [INFO] [stdout] 17 + pub fn dig_corners(dig_plan: &[DigInstr], field: &mut Vec, starting_point: Point) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day18/mod.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | while let Some(instr) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for instr in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day21/game.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | return boss.hit_points <= 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 42 - return boss.hit_points <= 0; [INFO] [stdout] 42 + boss.hit_points <= 0 [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/y2023/day18/mod.rs:51:26 [INFO] [stdout] | [INFO] [stdout] 51 | pub fn dig_all(dig_plan: &Vec, field: &mut Vec, starting_point: Point) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - pub fn dig_all(dig_plan: &Vec, field: &mut Vec, starting_point: Point) { [INFO] [stdout] 51 + pub fn dig_all(dig_plan: &[DigInstr], field: &mut Vec, starting_point: Point) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day18/mod.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | while let Some(instr) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for instr in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day21/shop.rs:11:34 [INFO] [stdout] | [INFO] [stdout] 11 | pub fn get_shop_inventory(lines: &Vec) -> (Vec, 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] 11 - pub fn get_shop_inventory(lines: &Vec) -> (Vec, Vec, Vec) { [INFO] [stdout] 11 + pub fn get_shop_inventory(lines: &[String]) -> (Vec, Vec, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day21/shop.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2015/day21/shop.rs:18:12 [INFO] [stdout] | [INFO] [stdout] 18 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day19/part.rs:22:24 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn parse(from: &String) -> Part { [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] 22 - pub fn parse(from: &String) -> Part { [INFO] [stdout] 22 + pub fn parse(from: &str) -> Part { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day21/shop.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2015/day21/shop.rs:39:12 [INFO] [stdout] | [INFO] [stdout] 39 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2015/day21/shop.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2015/day21/shop.rs:62:12 [INFO] [stdout] | [INFO] [stdout] 62 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day19/range.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | return (Range::new(at + 1, self.upper), Range::new(self.lower, at)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 80 - return (Range::new(at + 1, self.upper), Range::new(self.lower, at)); [INFO] [stdout] 80 + (Range::new(at + 1, self.upper), Range::new(self.lower, at)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day19/range.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | return (Range::new(self.lower, at - 1), Range::new(at, self.upper)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 82 - return (Range::new(self.lower, at - 1), Range::new(at, self.upper)); [INFO] [stdout] 82 + (Range::new(self.lower, at - 1), Range::new(at, self.upper)) [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/y2023/day19/workflow.rs:25:24 [INFO] [stdout] | [INFO] [stdout] 25 | pub fn parse(from: &String) -> Workflow { [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] 25 - pub fn parse(from: &String) -> Workflow { [INFO] [stdout] 25 + pub fn parse(from: &str) -> Workflow { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y2023/day19/workflow.rs:27:46 [INFO] [stdout] | [INFO] [stdout] 27 | let rules = rules_all.split(",").map(|s| parse_rule(s)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_rule` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Player` which implements the `Copy` trait [INFO] [stdout] --> src/y2015/day22/game.rs:32:22 [INFO] [stdout] | [INFO] [stdout] 32 | let mut player = _player.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*_player` [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 `Boss` which implements the `Copy` trait [INFO] [stdout] --> src/y2015/day22/game.rs:33:20 [INFO] [stdout] | [INFO] [stdout] 33 | let mut boss = _boss.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*_boss` [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/y2023/day19/mod.rs:72:29 [INFO] [stdout] | [INFO] [stdout] 72 | pub fn extract_input(lines: &Vec) -> (HashMap, 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] 72 - pub fn extract_input(lines: &Vec) -> (HashMap, Vec) { [INFO] [stdout] 72 + pub fn extract_input(lines: &[String]) -> (HashMap, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day19/mod.rs:78:5 [INFO] [stdout] | [INFO] [stdout] 78 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2023/day19/mod.rs:79:12 [INFO] [stdout] | [INFO] [stdout] 79 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2015/day22/game.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | return has_shield; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 117 - return has_shield; [INFO] [stdout] 117 + has_shield [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day19/mod.rs:89:5 [INFO] [stdout] | [INFO] [stdout] 89 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day19/mod.rs:120:42 [INFO] [stdout] | [INFO] [stdout] 120 | let value = part.get_key(&field_name); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `field_name` [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/y2015/day23/instructions.rs:19:36 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn extract_instructions(lines: &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] 19 - pub fn extract_instructions(lines: &Vec) -> Vec { [INFO] [stdout] 19 + pub fn extract_instructions(lines: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y2015/day23/instructions.rs:22:14 [INFO] [stdout] | [INFO] [stdout] 22 | .map(|line| parse_line(line)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2015/day23/instructions.rs:26:21 [INFO] [stdout] | [INFO] [stdout] 26 | fn parse_line(line: &String) -> Instruction { [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] 26 - fn parse_line(line: &String) -> Instruction { [INFO] [stdout] 26 + fn parse_line(line: &str) -> Instruction { [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/y2023/day20/extract.rs:11:29 [INFO] [stdout] | [INFO] [stdout] 11 | pub fn extract_input(lines: &Vec) -> (Circuit, FinalCircle) { [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] 11 - pub fn extract_input(lines: &Vec) -> (Circuit, FinalCircle) { [INFO] [stdout] 11 + pub fn extract_input(lines: &[String]) -> (Circuit, FinalCircle) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/y2023/day20/extract.rs:39:16 [INFO] [stdout] | [INFO] [stdout] 39 | if *output == String::from("df") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/y2023/day20/modules.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | if all_highs { false } else { true } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!all_highs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day21/extract.rs:3:28 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn extract_grid(lines: &Vec) -> (Grid, Point) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn extract_grid(lines: &Vec) -> (Grid, Point) { [INFO] [stdout] 3 + pub fn extract_grid(lines: &[String]) -> (Grid, Point) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `symbols` [INFO] [stdout] --> src/y2023/day21/extract.rs:11:20 [INFO] [stdout] | [INFO] [stdout] 11 | for col in 0..lines[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 11 - for col in 0..lines[0].len() { [INFO] [stdout] 11 + for (col, ) in symbols.iter().enumerate().take(lines[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/y2015/day25/mod.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / let mut row = Vec::new(); [INFO] [stdout] 21 | | row.push(value); [INFO] [stdout] | |____________________________^ help: consider using the `vec![]` macro: `let row = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2023/day21/mod.rs:14:15 [INFO] [stdout] | [INFO] [stdout] 14 | bfs_tiles(start.clone(), &grid, &mut shortest_distances, 64); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `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: iterating on a map's values [INFO] [stdout] --> src/y2023/day21/mod.rs:16:23 [INFO] [stdout] | [INFO] [stdout] 16 | let equal_tiles = shortest_distances [INFO] [stdout] | _______________________^ [INFO] [stdout] 17 | | .iter() [INFO] [stdout] 18 | | .filter_map(|(_, distance)| { [INFO] [stdout] 19 | | if distance % 2 == 0 { [INFO] [stdout] ... | [INFO] [stdout] 24 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 16 ~ let equal_tiles = shortest_distances.values().filter_map(|distance| { [INFO] [stdout] 17 + if distance % 2 == 0 { [INFO] [stdout] 18 + Some(*distance) [INFO] [stdout] 19 + } else { [INFO] [stdout] 20 + None [INFO] [stdout] 21 + } [INFO] [stdout] 22 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/y2015/day25/mod.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 55 - print!("\n"); [INFO] [stdout] 55 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2022/day1/mod.rs:7:12 [INFO] [stdout] | [INFO] [stdout] 7 | if item == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `item.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/y2023/day21/mod.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 46 | if grid.get_point(&point).unwrap() == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!grid.get_point(&point).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day22/extract.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | pub fn extract_input(lines: &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] 12 - pub fn extract_input(lines: &Vec) -> Vec { [INFO] [stdout] 12 + pub fn extract_input(lines: &[String]) -> Vec { [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/y2022/day2/shapes.rs:77:30 [INFO] [stdout] | [INFO] [stdout] 77 | pub fn extract_shapes(lines: &Vec) -> Vec<(Shape, Shape)> { [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] 77 - pub fn extract_shapes(lines: &Vec) -> Vec<(Shape, Shape)> { [INFO] [stdout] 77 + pub fn extract_shapes(lines: &[String]) -> Vec<(Shape, Shape)> { [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/y2022/day2/shapes.rs:99:37 [INFO] [stdout] | [INFO] [stdout] 99 | pub fn extract_shapes_part_2(lines: &Vec) -> Vec<(Shape, Outcome)> { [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] 99 - pub fn extract_shapes_part_2(lines: &Vec) -> Vec<(Shape, Outcome)> { [INFO] [stdout] 99 + pub fn extract_shapes_part_2(lines: &[String]) -> Vec<(Shape, Outcome)> { [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/y2022/day3/mod.rs:12:22 [INFO] [stdout] | [INFO] [stdout] 12 | pub fn part_1(lines: &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] 12 - pub fn part_1(lines: &Vec) { [INFO] [stdout] 12 + pub fn part_1(lines: &[String]) { [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/y2022/day3/mod.rs:30:22 [INFO] [stdout] | [INFO] [stdout] 30 | pub fn part_2(lines: &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] 30 - pub fn part_2(lines: &Vec) { [INFO] [stdout] 30 + pub fn part_2(lines: &[String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day2/mod.rs:31:17 [INFO] [stdout] | [INFO] [stdout] 31 | return if result { 1 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 31 - return if result { 1 } else { 0 }; [INFO] [stdout] 31 + if result { 1 } else { 0 } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day2/mod.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | return 1; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 33 - return 1; [INFO] [stdout] 33 + 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2022/day3/mod.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | return ascii_value - 96; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 54 - return ascii_value - 96; [INFO] [stdout] 54 + ascii_value - 96 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day2/mod.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 70 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 70 - return None; [INFO] [stdout] 70 + None [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/y2024/day2/mod.rs:42:28 [INFO] [stdout] | [INFO] [stdout] 42 | fn get_unsafe_index(level: &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] 42 - fn get_unsafe_index(level: &Vec) -> Option { [INFO] [stdout] 42 + fn get_unsafe_index(level: &[u32]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `index` is used to index `level` [INFO] [stdout] --> src/y2024/day2/mod.rs:47:18 [INFO] [stdout] | [INFO] [stdout] 47 | for index in 1..len { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 47 - for index in 1..len { [INFO] [stdout] 47 + for (index, ) in level.iter().enumerate().take(len).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/y2024/day2/mod.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 52 | if diff < 1 || diff > 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=3).contains(&diff)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2022/day4/mod.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | return if no_overlap {0} else {1}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 25 - return if no_overlap {0} else {1}; [INFO] [stdout] 25 + if no_overlap {0} else {1} [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/y2022/day5/extract.rs:13:29 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn extract_input(lines: &Vec) -> (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] 13 - pub fn extract_input(lines: &Vec) -> (Vec>, Vec) { [INFO] [stdout] 13 + pub fn extract_input(lines: &[String]) -> (Vec>, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2022/day5/extract.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | while let Some(line) = lines_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in lines_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2022/day5/extract.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | while let Some(line) = lines_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in lines_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2022/day5/extract.rs:52:26 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn process_row(line: &String) -> 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] 52 - pub fn process_row(line: &String) -> Vec> { [INFO] [stdout] 52 + pub fn process_row(line: &str) -> Vec> { [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/y2022/day6/mod.rs:15:32 [INFO] [stdout] | [INFO] [stdout] 15 | pub fn get_start_index(stream: &Vec, marker_len: usize) -> usize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 15 - pub fn get_start_index(stream: &Vec, marker_len: usize) -> usize { [INFO] [stdout] 15 + pub fn get_start_index(stream: &[char], marker_len: usize) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day5/extract.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | return position_first < position_second; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 12 - return position_first < position_second; [INFO] [stdout] 12 + position_first < position_second [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day5/extract.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 14 - return true; [INFO] [stdout] 14 + true [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/y2024/day5/extract.rs:5:43 [INFO] [stdout] | [INFO] [stdout] 5 | pub fn is_valid_update(&self, update: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - pub fn is_valid_update(&self, update: &Vec) -> bool { [INFO] [stdout] 5 + pub fn is_valid_update(&self, update: &[u32]) -> bool { [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/y2024/day5/extract.rs:19:29 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn extract_input(lines: &Vec) -> (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] 19 - pub fn extract_input(lines: &Vec) -> (Vec, Vec>) { [INFO] [stdout] 19 + pub fn extract_input(lines: &[String]) -> (Vec, Vec>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2024/day5/extract.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2024/day5/extract.rs:25:12 [INFO] [stdout] | [INFO] [stdout] 25 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2024/day5/extract.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2024/day5/mod.rs:17:42 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn part1(rules: &Vec, updates: &Vec>) -> u32 { [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] 17 - pub fn part1(rules: &Vec, updates: &Vec>) -> u32 { [INFO] [stdout] 17 + pub fn part1(rules: &Vec, updates: &[Vec]) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/y2024/day5/mod.rs:21:16 [INFO] [stdout] | [INFO] [stdout] 21 | if let Some(_) = get_first_broken_rule(rules, update) { [INFO] [stdout] | -------^^^^^^^--------------------------------------- help: try: `if get_first_broken_rule(rules, update).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2024/day5/mod.rs:31:42 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn part2(rules: &Vec, updates: &mut Vec>) -> u32 { [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] 31 - pub fn part2(rules: &Vec, updates: &mut Vec>) -> u32 { [INFO] [stdout] 31 + pub fn part2(rules: &Vec, updates: &mut [Vec]) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day5/mod.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 54 - return None; [INFO] [stdout] 54 + None [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/y2024/day5/mod.rs:47:41 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn get_first_broken_rule<'a>(rules: &'a Vec, update: &Vec) -> Option<&'a Rule> { [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] 47 - pub fn get_first_broken_rule<'a>(rules: &'a Vec, update: &Vec) -> Option<&'a Rule> { [INFO] [stdout] 47 + pub fn get_first_broken_rule<'a>(rules: &'a [Rule], update: &Vec) -> Option<&'a Rule> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/y2024/day5/mod.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | / for rule in rules.iter() { [INFO] [stdout] 49 | | if !rule.is_valid_update(update) { [INFO] [stdout] 50 | | return Some(rule); [INFO] [stdout] ... | [INFO] [stdout] 54 | | return None; [INFO] [stdout] | |________________^ help: replace with an iterator: `rules.iter().find(|&rule| !rule.is_valid_update(update)).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2022/day7/traverse.rs:13:31 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn traverse(instructions: &Vec) -> Entity { [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] 13 - pub fn traverse(instructions: &Vec) -> Entity { [INFO] [stdout] 13 + pub fn traverse(instructions: &[String]) -> Entity { [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/y2024/day5/mod.rs:72:32 [INFO] [stdout] | [INFO] [stdout] 72 | pub fn get_middle_element(vec: &Vec) -> u32 { [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] 72 - pub fn get_middle_element(vec: &Vec) -> u32 { [INFO] [stdout] 72 + pub fn get_middle_element(vec: &[u32]) -> u32 { [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/y2022/day7/traverse.rs:59:52 [INFO] [stdout] | [INFO] [stdout] 59 | fn get_dir_by_path<'a>(root: &'a mut Entity, path: &Vec) -> &'a mut Entity { [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] 59 - fn get_dir_by_path<'a>(root: &'a mut Entity, path: &Vec) -> &'a mut Entity { [INFO] [stdout] 59 + fn get_dir_by_path<'a>(root: &'a mut Entity, path: &[String]) -> &'a mut Entity { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/y2022/day7/mod.rs:34:29 [INFO] [stdout] | [INFO] [stdout] 34 | let mut suitable_dirs = cache [INFO] [stdout] | _____________________________^ [INFO] [stdout] 35 | | .values() [INFO] [stdout] 36 | | .filter(|val| **val >= missing_space) [INFO] [stdout] 37 | | .map(|val| *val) [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] 34 ~ let mut suitable_dirs = cache [INFO] [stdout] 35 + .values() [INFO] [stdout] 36 + .filter(|val| **val >= missing_space).copied() [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/y2024/day7/mod.rs:20:29 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn extract_input(lines: &Vec) -> Vec<(u64, VecDeque)> { [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] 20 - pub fn extract_input(lines: &Vec) -> Vec<(u64, VecDeque)> { [INFO] [stdout] 20 + pub fn extract_input(lines: &[String]) -> Vec<(u64, VecDeque)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2022/day7/mod.rs:61:13 [INFO] [stdout] | [INFO] [stdout] 61 | return dir_size; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 61 - return dir_size; [INFO] [stdout] 61 + dir_size [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day7/mod.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | return (numbers[0] == result) as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 65 - return (numbers[0] == result) as u64; [INFO] [stdout] 65 + (numbers[0] == result) as u64 [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/y2024/day8/mod.rs:19:32 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn extract_antennas(lines: &Vec) -> (Grid, Antennas) { [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] 19 - pub fn extract_antennas(lines: &Vec) -> (Grid, Antennas) { [INFO] [stdout] 19 + pub fn extract_antennas(lines: &[String]) -> (Grid, Antennas) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day1/mod.rs:54:37 [INFO] [stdout] | [INFO] [stdout] 54 | .map(|line| extract_numbers(&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: the loop variable `row` is used to index `lines` [INFO] [stdout] --> src/y2024/day8/mod.rs:25:16 [INFO] [stdout] | [INFO] [stdout] 25 | for row in 0..rows { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 25 - for row in 0..rows { [INFO] [stdout] 25 + for (row, ) in lines.iter().enumerate().take(rows) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `symbols` [INFO] [stdout] --> src/y2024/day8/mod.rs:29:20 [INFO] [stdout] | [INFO] [stdout] 29 | for col in 0..cols { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 29 - for col in 0..cols { [INFO] [stdout] 29 + for (col, ) in symbols.iter().enumerate().take(cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2024/day8/mod.rs:34:38 [INFO] [stdout] | [INFO] [stdout] 34 | antennas.entry(item).or_insert_with(Vec::new).push(point); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y2023/day2/mod.rs:29:22 [INFO] [stdout] | [INFO] [stdout] 29 | .map(|game| parse_game_colors(game)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_game_colors` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y2023/day2/mod.rs:60:22 [INFO] [stdout] | [INFO] [stdout] 60 | .map(|game| parse_game_colors(game)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_game_colors` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2024/day9/disk.rs:3:38 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn restore_disk_blocks(disk_map: &Vec) -> Disk { [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 restore_disk_blocks(disk_map: &Vec) -> Disk { [INFO] [stdout] 3 + pub fn restore_disk_blocks(disk_map: &[u8]) -> Disk { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/y2024/day9/disk.rs:10:25 [INFO] [stdout] | [INFO] [stdout] 10 | disk.extend(std::iter::repeat(Some(current_id)).take(*item as usize)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(Some(current_id), *item as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/y2023/day2/mod.rs:98:18 [INFO] [stdout] | [INFO] [stdout] 98 | let number = re [INFO] [stdout] | __________________^ [INFO] [stdout] 99 | | .captures(input) [INFO] [stdout] 100 | | .and_then(|captures| captures.get(1)) [INFO] [stdout] 101 | | .and_then(|number_str| number_str.as_str().parse::().ok()) [INFO] [stdout] 102 | | .unwrap_or_else(|| 0); [INFO] [stdout] | |_____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 102 - .unwrap_or_else(|| 0); [INFO] [stdout] 102 + .unwrap_or(0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/y2024/day9/disk.rs:13:25 [INFO] [stdout] | [INFO] [stdout] 13 | disk.extend(std::iter::repeat(None).take(*item as usize)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(None, *item as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `position` is used as a loop counter [INFO] [stdout] --> src/y2024/day9/disk.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | for item in disk.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (position, item) in disk.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/y2023/day2/mod.rs:122:21 [INFO] [stdout] | [INFO] [stdout] 122 | let value = regex [INFO] [stdout] | _____________________^ [INFO] [stdout] 123 | | .captures(input) [INFO] [stdout] 124 | | .and_then(|captures| captures.get(1)) [INFO] [stdout] 125 | | .and_then(|number_str| number_str.as_str().parse::().ok()) [INFO] [stdout] 126 | | .unwrap_or_else(|| 0); [INFO] [stdout] | |_________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 126 - .unwrap_or_else(|| 0); [INFO] [stdout] 126 + .unwrap_or(0); [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/y2023/day3/mod.rs:24:20 [INFO] [stdout] | [INFO] [stdout] 24 | fn get_value(v: &Vec>, row: isize, col: isize) -> Option<&T> { [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] 24 - fn get_value(v: &Vec>, row: isize, col: isize) -> Option<&T> { [INFO] [stdout] 24 + fn get_value(v: &[Vec], row: isize, col: isize) -> Option<&T> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2024/day10/mod.rs:18:34 [INFO] [stdout] | [INFO] [stdout] 18 | let current_trail = 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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2024/day10/mod.rs:50:26 [INFO] [stdout] | [INFO] [stdout] 50 | .or_insert_with(HashSet::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/y2024/day11/mod.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | number.to_string().len() % 2 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `number.to_string().len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/y2023/day3/mod.rs:143:14 [INFO] [stdout] | [INFO] [stdout] 143 | .or_insert(Vec::new()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/y2023/day4/mod.rs:40:10 [INFO] [stdout] | [INFO] [stdout] 40 | .fold(0u32, |sum, curr| sum + curr); [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day4/mod.rs:22:47 [INFO] [stdout] | [INFO] [stdout] 22 | let winning_numbers = get_num_vec(&str11); [INFO] [stdout] | ^^^^^^ help: change this to: `str11` [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/y2023/day4/mod.rs:23:42 [INFO] [stdout] | [INFO] [stdout] 23 | let my_numbers = get_num_vec(&str2); [INFO] [stdout] | ^^^^^ help: change this to: `str2` [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/y2023/day4/mod.rs:55:47 [INFO] [stdout] | [INFO] [stdout] 55 | let winning_numbers = get_num_vec(&str11); [INFO] [stdout] | ^^^^^^ help: change this to: `str11` [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/y2023/day4/mod.rs:56:42 [INFO] [stdout] | [INFO] [stdout] 56 | let my_numbers = get_num_vec(&str2); [INFO] [stdout] | ^^^^^ help: change this to: `str2` [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/y2024/day13/arcade.rs:28:32 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn extract_machines(lines: &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] 28 - pub fn extract_machines(lines: &Vec) -> Vec { [INFO] [stdout] 28 + pub fn extract_machines(lines: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day5/mappings.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | return value; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 39 - return value; [INFO] [stdout] 39 + value [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day5/helpers.rs:7:46 [INFO] [stdout] | [INFO] [stdout] 7 | let mut cap_iter = num_reg.captures_iter(&first_line); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `first_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: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day5/helpers.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | while let Some(value) = cap_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for value in cap_iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day5/helpers.rs:29:13 [INFO] [stdout] | [INFO] [stdout] 29 | while let Some(next_line) = lines_iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for next_line in lines_iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2023/day5/helpers.rs:30:20 [INFO] [stdout] | [INFO] [stdout] 30 | if next_line == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `next_line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day5/helpers.rs:34:52 [INFO] [stdout] | [INFO] [stdout] 34 | let captured = ranges_reg.captures(&next_line).unwrap(); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `next_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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day5/helpers.rs:51:52 [INFO] [stdout] | [INFO] [stdout] 51 | pub fn find_location_for_seed(seed: u64, mappings: &Vec) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - pub fn find_location_for_seed(seed: u64, mappings: &Vec) -> u64 { [INFO] [stdout] 51 + pub fn find_location_for_seed(seed: u64, mappings: &[Mapping]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day13/mod.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | return Some(cost); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 82 - return Some(cost); [INFO] [stdout] 82 + Some(cost) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/new_day.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 - return None; [INFO] [stdout] 27 + None [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/common/new_day.rs:3:27 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn resolve_args(args: &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] 3 - pub fn resolve_args(args: &Vec) -> Option { [INFO] [stdout] 3 + pub fn resolve_args(args: &[String]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `parsed` [INFO] [stdout] --> src/y2023/day6/mod.rs:16:13 [INFO] [stdout] | [INFO] [stdout] 16 | for i in 0..parsed[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 16 - for i in 0..parsed[0].len() { [INFO] [stdout] 16 + for in parsed.iter().take(parsed[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/y2023/day6/mod.rs:39:7 [INFO] [stdout] | [INFO] [stdout] 39 | }).fold(1, |sum, current| sum * current); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `product::()` [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: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/common/point.rs:91:6 [INFO] [stdout] | [INFO] [stdout] 91 | impl<'a, 'b> Sub<&'b Point> for &'a Point { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 91 - impl<'a, 'b> Sub<&'b Point> for &'a Point { [INFO] [stdout] 91 + impl<'b> Sub<&'b Point> for &Point { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | return row < self.rows && col < self.cols; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return row < self.rows && col < self.cols; [INFO] [stdout] 30 + row < self.rows && col < self.cols [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | return row >= 0 && (row as usize) < self.rows && col >= 0 && (col as usize) < self.cols; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 34 - return row >= 0 && (row as usize) < self.rows && col >= 0 && (col as usize) < self.cols; [INFO] [stdout] 34 + row >= 0 && (row as usize) < self.rows && col >= 0 && (col as usize) < self.cols [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | / return point.0 >= 0 [INFO] [stdout] 39 | | && (point.0 as usize) < self.rows [INFO] [stdout] 40 | | && point.1 >= 0 [INFO] [stdout] 41 | | && (point.1 as usize) < self.cols; [INFO] [stdout] | |_____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 38 ~ point.0 >= 0 [INFO] [stdout] 39 + && (point.0 as usize) < self.rows [INFO] [stdout] 40 + && point.1 >= 0 [INFO] [stdout] 41 ~ && (point.1 as usize) < self.cols [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | return Some(self.data[point.0 as usize][point.1 as usize]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 61 - return Some(self.data[point.0 as usize][point.1 as usize]); [INFO] [stdout] 61 + Some(self.data[point.0 as usize][point.1 as usize]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 73 - return None; [INFO] [stdout] 73 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u32` which implements the `Copy` trait [INFO] [stdout] --> src/y2023/day7/mod.rs:100:25 [INFO] [stdout] | [INFO] [stdout] 100 | let joker_count = symbols.get(&'J').unwrap_or(&0).clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*symbols.get(&'J').unwrap_or(&0)` [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/common/grid.rs:102:28 [INFO] [stdout] | [INFO] [stdout] 102 | pub fn from_vec(input: &Vec) -> Grid { [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] 102 - pub fn from_vec(input: &Vec) -> Grid { [INFO] [stdout] 102 + pub fn from_vec(input: &[String]) -> Grid { [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/common/grid.rs:113:34 [INFO] [stdout] | [INFO] [stdout] 113 | pub fn usize_from_vec(input: &Vec) -> Grid { [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] 113 - pub fn usize_from_vec(input: &Vec) -> Grid { [INFO] [stdout] 113 + pub fn usize_from_vec(input: &[String]) -> Grid { [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/common/grid.rs:129:31 [INFO] [stdout] | [INFO] [stdout] 129 | pub fn u8_from_vec(input: &Vec) -> Grid { [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] 129 - pub fn u8_from_vec(input: &Vec) -> Grid { [INFO] [stdout] 129 + pub fn u8_from_vec(input: &[String]) -> Grid { [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/common/grid.rs:144:45 [INFO] [stdout] | [INFO] [stdout] 144 | pub fn map_bool_from_vec(input: &Vec, mapper: Mapper) -> Grid [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] 144 - pub fn map_bool_from_vec(input: &Vec, mapper: Mapper) -> Grid [INFO] [stdout] 144 + pub fn map_bool_from_vec(input: &[String], mapper: Mapper) -> Grid [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/common/grid.rs:150:42 [INFO] [stdout] | [INFO] [stdout] 150 | .map(|line| line.chars().map(|ch| mapper(ch)).collect::>()) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mapper` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lines.get(0)` [INFO] [stdout] --> src/y2023/day8/mod.rs:11:24 [INFO] [stdout] | [INFO] [stdout] 11 | let instructions = lines.get(0).unwrap().chars().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `lines.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: empty string literal in `println!` [INFO] [stdout] --> src/common/print_by_line.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/y2023/day8/mod.rs:69:30 [INFO] [stdout] | [INFO] [stdout] 69 | let nodes: Vec = network [INFO] [stdout] | ______________________________^ [INFO] [stdout] 70 | | .keys() [INFO] [stdout] 71 | | .filter(|key| key.ends_with("A")) [INFO] [stdout] 72 | | .map(|key| key.clone()) [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 69 ~ let nodes: Vec = network [INFO] [stdout] 70 + .keys() [INFO] [stdout] 71 + .filter(|key| key.ends_with("A")).cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/common/print_by_line.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/common/algos.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | numbers.into_iter().fold(1, |a, b| lcm(a, *b)) [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/main.rs:101:12 [INFO] [stdout] | [INFO] [stdout] 101 | if let Some(_) = new_day::resolve_args(&args) { [INFO] [stdout] | -------^^^^^^^------------------------------- help: try: `if new_day::resolve_args(&args).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y2023/day2/mod.rs:114:5 [INFO] [stdout] | [INFO] [stdout] 114 | / vec![ [INFO] [stdout] 115 | | (r"(\d+) red", "red"), [INFO] [stdout] 116 | | (r"(\d+) green", "green"), [INFO] [stdout] 117 | | (r"(\d+) blue", "blue"), [INFO] [stdout] 118 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 114 ~ [(r"(\d+) red", "red"), [INFO] [stdout] 115 + (r"(\d+) green", "green"), [INFO] [stdout] 116 + (r"(\d+) blue", "blue")] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y2023/day23/mod.rs:43:17 [INFO] [stdout] | [INFO] [stdout] 43 | vec![point.east(), point.west(), point.north(), point.south()] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[point.east(), point.west(), point.north(), point.south()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day10/helpers.rs:10:25 [INFO] [stdout] | [INFO] [stdout] 10 | pub fn find_start(grid: &Vec>) -> Point { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 10 - pub fn find_start(grid: &Vec>) -> Point { [INFO] [stdout] 10 + pub fn find_start(grid: &[Vec]) -> Point { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day10/helpers.rs:69:28 [INFO] [stdout] | [INFO] [stdout] 69 | let start = find_start(&grid); [INFO] [stdout] | ^^^^^ help: change this to: `grid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `grid` [INFO] [stdout] --> src/y2023/day10/mod.rs:18:16 [INFO] [stdout] | [INFO] [stdout] 18 | for row in 0..board_rows { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 18 - for row in 0..board_rows { [INFO] [stdout] 18 + for (row, ) in grid.iter().enumerate().take(board_rows) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `grid` [INFO] [stdout] --> src/y2023/day10/mod.rs:22:20 [INFO] [stdout] | [INFO] [stdout] 22 | for col in 0..board_cols { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 22 - for col in 0..board_cols { [INFO] [stdout] 22 + for (col, ) in grid.iter().enumerate().take(board_cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day11/mod.rs:98:34 [INFO] [stdout] | [INFO] [stdout] 98 | fn locate_empty_spaces(universe: &mut Vec>) -> (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] 98 - fn locate_empty_spaces(universe: &mut Vec>) -> (Vec, Vec) { [INFO] [stdout] 98 + fn locate_empty_spaces(universe: &mut [Vec]) -> (Vec, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `universe` [INFO] [stdout] --> src/y2023/day11/mod.rs:102:16 [INFO] [stdout] | [INFO] [stdout] 102 | for row in 0..universe.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 102 - for row in 0..universe.len() { [INFO] [stdout] 102 + for (row, ) in universe.iter().enumerate() { [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/y2023/day12/helpers.rs:9:29 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn extract_input(lines: &Vec) -> Vec<(String, 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] 9 - pub fn extract_input(lines: &Vec) -> Vec<(String, Vec)> { [INFO] [stdout] 9 + pub fn extract_input(lines: &[String]) -> Vec<(String, Vec)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/y2023/day12/helpers.rs:22:32 [INFO] [stdout] | [INFO] [stdout] 22 | let springs_unfolded = repeat(springs.clone()).take(5).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(springs.clone(), 5)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y2023/day12/helpers.rs:25:33 [INFO] [stdout] | [INFO] [stdout] 25 | let contiguous_groups = captured[2] [INFO] [stdout] | _________________________________^ [INFO] [stdout] 26 | | .parse::() [INFO] [stdout] 27 | | .unwrap() [INFO] [stdout] 28 | | .split(",") [INFO] [stdout] 29 | | .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] 25 ~ let contiguous_groups = captured[2] [INFO] [stdout] 26 + .parse::() [INFO] [stdout] 27 + .unwrap() [INFO] [stdout] 28 + .split(",") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `flat_map` with an identity function [INFO] [stdout] --> src/y2023/day12/helpers.rs:33:73 [INFO] [stdout] | [INFO] [stdout] 33 | let unfolded_groups = repeat(contiguous_groups.clone()).take(5).flat_map(|v| v).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#flat_map_identity [INFO] [stdout] = note: `#[warn(clippy::flat_map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/y2023/day12/helpers.rs:33:31 [INFO] [stdout] | [INFO] [stdout] 33 | let unfolded_groups = repeat(contiguous_groups.clone()).take(5).flat_map(|v| v).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(contiguous_groups.clone(), 5)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day12/helpers.rs:42:45 [INFO] [stdout] | [INFO] [stdout] 42 | pub fn get_correct_regex(contiguous_groups: &Vec) -> Regex { [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] 42 - pub fn get_correct_regex(contiguous_groups: &Vec) -> Regex { [INFO] [stdout] 42 + pub fn get_correct_regex(contiguous_groups: &[u8]) -> Regex { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/y2023/day12/helpers.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 51 | let reg = Regex::new(®ex_str).unwrap(); [INFO] [stdout] | ------------------------------------------ unnecessary `let` binding [INFO] [stdout] 52 | [INFO] [stdout] 53 | reg [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 51 ~ [INFO] [stdout] 52 | [INFO] [stdout] 53 ~ Regex::new(®ex_str).unwrap() [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/y2023/day12/helpers.rs:56:48 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn get_acceptable_regex(contiguous_groups: &Vec) -> Regex { [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] 56 - pub fn get_acceptable_regex(contiguous_groups: &Vec) -> Regex { [INFO] [stdout] 56 + pub fn get_acceptable_regex(contiguous_groups: &[u8]) -> Regex { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/y2023/day12/helpers.rs:66:5 [INFO] [stdout] | [INFO] [stdout] 64 | let reg = Regex::new(®ex_str).unwrap(); [INFO] [stdout] | ------------------------------------------ unnecessary `let` binding [INFO] [stdout] 65 | [INFO] [stdout] 66 | reg [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 64 ~ [INFO] [stdout] 65 | [INFO] [stdout] 66 ~ Regex::new(®ex_str).unwrap() [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/y2023/day12/helpers.rs:69:37 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn extract_subproblems(springs: &String, good_groups: &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] 69 - pub fn extract_subproblems(springs: &String, good_groups: &Vec) { [INFO] [stdout] 69 + pub fn extract_subproblems(springs: &str, good_groups: &Vec) { [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/y2023/day12/helpers.rs:69:59 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn extract_subproblems(springs: &String, good_groups: &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] 69 - pub fn extract_subproblems(springs: &String, good_groups: &Vec) { [INFO] [stdout] 69 + pub fn extract_subproblems(springs: &String, good_groups: &[u8]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `iteration_count` is used as a loop counter [INFO] [stdout] --> src/y2023/day12/mod.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | for springs in springs_data.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (iteration_count, springs) in springs_data.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day12/mod.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / return get_correct_combinations(replaced_with_0, spring_groups.clone(), splitter, cache) [INFO] [stdout] 61 | | + get_correct_combinations(replaced_with_1, spring_groups.clone(), splitter, cache); [INFO] [stdout] | |___________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 60 ~ get_correct_combinations(replaced_with_0, spring_groups.clone(), splitter, cache) [INFO] [stdout] 61 ~ + get_correct_combinations(replaced_with_1, spring_groups.clone(), splitter, cache) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/y2023/day12/mod.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | splitter: &Regex, [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_splitter` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/y2023/day12/mod.rs:60:77 [INFO] [stdout] | [INFO] [stdout] 60 | return get_correct_combinations(replaced_with_0, spring_groups.clone(), splitter, cache) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 61 | + get_correct_combinations(replaced_with_1, spring_groups.clone(), splitter, cache); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> src/y2023/day12/mod.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | cache: &mut HashMap<(String, Vec), u128>, [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_cache` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> src/y2023/day12/mod.rs:60:87 [INFO] [stdout] | [INFO] [stdout] 60 | return get_correct_combinations(replaced_with_0, spring_groups.clone(), splitter, cache) [INFO] [stdout] | ^^^^^ [INFO] [stdout] 61 | + get_correct_combinations(replaced_with_1, spring_groups.clone(), splitter, cache); [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day13/helpers.rs:1:31 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn extract_mirrors(lines: &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] 1 - pub fn extract_mirrors(lines: &Vec) -> Vec>> { [INFO] [stdout] 1 + pub fn extract_mirrors(lines: &[String]) -> Vec>> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day13/helpers.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2023/day13/helpers.rs:9:12 [INFO] [stdout] | [INFO] [stdout] 9 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day13/helpers.rs:22:29 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn print_mirror(mirror: &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] 22 - pub fn print_mirror(mirror: &Vec>) { [INFO] [stdout] 22 + pub fn print_mirror(mirror: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/y2023/day13/helpers.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | 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: unneeded `return` statement [INFO] [stdout] --> src/y2023/day13/helpers.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | return diffs == 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 36 - return diffs == 1; [INFO] [stdout] 36 + diffs == 1 [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/y2023/day13/helpers.rs:29:41 [INFO] [stdout] | [INFO] [stdout] 29 | pub fn possible_horizontal_smudge(row1: &Vec, row2: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - pub fn possible_horizontal_smudge(row1: &Vec, row2: &Vec) -> bool { [INFO] [stdout] 29 + pub fn possible_horizontal_smudge(row1: &[char], row2: &Vec) -> bool { [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/y2023/day13/helpers.rs:39:33 [INFO] [stdout] | [INFO] [stdout] 39 | pub fn horizontal_index(mirror: &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] 39 - pub fn horizontal_index(mirror: &Vec>) -> Option { [INFO] [stdout] 39 + pub fn horizontal_index(mirror: &[Vec]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/y2023/day13/helpers.rs:58:16 [INFO] [stdout] | [INFO] [stdout] 58 | if &mirror[search_back as usize] != &mirror[search_forward] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 58 - if &mirror[search_back as usize] != &mirror[search_forward] { [INFO] [stdout] 58 + if mirror[search_back as usize] != mirror[search_forward] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day13/mod.rs:13:58 [INFO] [stdout] | [INFO] [stdout] 13 | if let Some(horizontal_index) = horizontal_index(&mirror) { [INFO] [stdout] | ^^^^^^^ help: change this to: `mirror` [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/y2023/day13/mod.rs:17:54 [INFO] [stdout] | [INFO] [stdout] 17 | if let Some(vertical_index) = vertical_index(&mirror) { [INFO] [stdout] | ^^^^^^^ help: change this to: `mirror` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/tilt.rs:1:27 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn tilt_north(mirror: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1 - pub fn tilt_north(mirror: &mut Vec>) { [INFO] [stdout] 1 + pub fn tilt_north(mirror: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is only used to index `mirror` [INFO] [stdout] --> src/y2023/day14/tilt.rs:5:16 [INFO] [stdout] | [INFO] [stdout] 5 | for col in 0..cols { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 5 - for col in 0..cols { [INFO] [stdout] 5 + for in mirror.iter_mut().take(cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/tilt.rs:31:27 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn tilt_south(mirror: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 31 - pub fn tilt_south(mirror: &mut Vec>) { [INFO] [stdout] 31 + pub fn tilt_south(mirror: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is only used to index `mirror` [INFO] [stdout] --> src/y2023/day14/tilt.rs:35:16 [INFO] [stdout] | [INFO] [stdout] 35 | for col in 0..cols { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 35 - for col in 0..cols { [INFO] [stdout] 35 + for in mirror.iter_mut().take(cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/y2023/day14/tilt.rs:43:21 [INFO] [stdout] | [INFO] [stdout] 43 | / if row > 0 { [INFO] [stdout] 44 | | last_free_space = row - 1; [INFO] [stdout] 45 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 42 ~ '#' [INFO] [stdout] 43 ~ if row > 0 => { [INFO] [stdout] 44 | last_free_space = row - 1; [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/y2023/day14/tilt.rs:55:21 [INFO] [stdout] | [INFO] [stdout] 55 | / if last_free_space > 0 { [INFO] [stdout] 56 | | last_free_space -= 1; [INFO] [stdout] 57 | | } [INFO] [stdout] | |_____________________^ help: try: `last_free_space = last_free_space.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/tilt.rs:65:26 [INFO] [stdout] | [INFO] [stdout] 65 | pub fn tilt_east(mirror: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 65 - pub fn tilt_east(mirror: &mut Vec>) { [INFO] [stdout] 65 + pub fn tilt_east(mirror: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is only used to index `mirror` [INFO] [stdout] --> src/y2023/day14/tilt.rs:69:16 [INFO] [stdout] | [INFO] [stdout] 69 | for row in 0..rows { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 69 - for row in 0..rows { [INFO] [stdout] 69 + for in mirror.iter_mut().take(rows) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/y2023/day14/tilt.rs:77:21 [INFO] [stdout] | [INFO] [stdout] 77 | / if col > 0 { [INFO] [stdout] 78 | | last_free_space = col - 1; [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 76 ~ '#' [INFO] [stdout] 77 ~ if col > 0 => { [INFO] [stdout] 78 | last_free_space = col - 1; [INFO] [stdout] 79 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/y2023/day14/tilt.rs:90:21 [INFO] [stdout] | [INFO] [stdout] 90 | / if last_free_space > 0 { [INFO] [stdout] 91 | | last_free_space -= 1; [INFO] [stdout] 92 | | } [INFO] [stdout] | |_____________________^ help: try: `last_free_space = last_free_space.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/tilt.rs:100:26 [INFO] [stdout] | [INFO] [stdout] 100 | pub fn tilt_west(mirror: &mut Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - pub fn tilt_west(mirror: &mut Vec>) { [INFO] [stdout] 100 + pub fn tilt_west(mirror: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is only used to index `mirror` [INFO] [stdout] --> src/y2023/day14/tilt.rs:104:16 [INFO] [stdout] | [INFO] [stdout] 104 | for row in 0..rows { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 104 - for row in 0..rows { [INFO] [stdout] 104 + for in mirror.iter_mut().take(rows) { [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/y2023/day14/cycle.rs:2:26 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn find_cycle(loads: &Vec) -> Option<(&[usize], usize)> { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 2 - pub fn find_cycle(loads: &Vec) -> Option<(&[usize], usize)> { [INFO] [stdout] 2 + pub fn find_cycle(loads: &[usize]) -> Option<(&[usize], usize)> { [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/y2023/day14/mod.rs:45:29 [INFO] [stdout] | [INFO] [stdout] 45 | pub fn print_mirror(mirror: &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] 45 - pub fn print_mirror(mirror: &Vec>) { [INFO] [stdout] 45 + pub fn print_mirror(mirror: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/y2023/day14/mod.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day14/mod.rs:52:37 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn calculate_total_load(mirror: &Vec>) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 52 - pub fn calculate_total_load(mirror: &Vec>) -> usize { [INFO] [stdout] 52 + pub fn calculate_total_load(mirror: &[Vec]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day15/hash.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 37 | return Operation::Insert(label, fl); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 37 - return Operation::Insert(label, fl); [INFO] [stdout] 37 + Operation::Insert(label, fl) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `lines.get(0)` [INFO] [stdout] --> src/y2023/day15/mod.rs:10:21 [INFO] [stdout] | [INFO] [stdout] 10 | let sequences = lines.get(0).unwrap().split(",").collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `lines.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/y2023/day15/mod.rs:25:43 [INFO] [stdout] | [INFO] [stdout] 25 | let hash = calculate_hash(&label); [INFO] [stdout] | ^^^^^^ help: change this to: `label` [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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2023/day15/mod.rs:27:50 [INFO] [stdout] | [INFO] [stdout] 27 | let entry = hash_map.entry(hash).or_insert_with(Vec::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day15/mod.rs:35:43 [INFO] [stdout] | [INFO] [stdout] 35 | let hash = calculate_hash(&label); [INFO] [stdout] | ^^^^^^ help: change this to: `label` [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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2023/day15/mod.rs:36:50 [INFO] [stdout] | [INFO] [stdout] 36 | let entry = hash_map.entry(hash).or_insert_with(Vec::new); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | / return tile_value [INFO] [stdout] 90 | | + traverse_cave(next_point, dir, cave, visited_tiles, visited_splitters); [INFO] [stdout] | |________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 89 ~ tile_value [INFO] [stdout] 90 ~ + traverse_cave(next_point, dir, cave, visited_tiles, visited_splitters) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | / return tile_value [INFO] [stdout] 104 | | + traverse_cave(point1, direction1, cave, visited_tiles, visited_splitters) [INFO] [stdout] 105 | | + traverse_cave(point2, direction2, cave, visited_tiles, visited_splitters); [INFO] [stdout] | |_______________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 103 ~ tile_value [INFO] [stdout] 104 + + traverse_cave(point1, direction1, cave, visited_tiles, visited_splitters) [INFO] [stdout] 105 ~ + traverse_cave(point2, direction2, cave, visited_tiles, visited_splitters) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:108:17 [INFO] [stdout] | [INFO] [stdout] 108 | / return tile_value [INFO] [stdout] 109 | | + traverse_cave(next_point, dir, cave, visited_tiles, visited_splitters); [INFO] [stdout] | |____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 108 ~ tile_value [INFO] [stdout] 109 ~ + traverse_cave(next_point, dir, cave, visited_tiles, visited_splitters) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:115:13 [INFO] [stdout] | [INFO] [stdout] 115 | / return tile_value [INFO] [stdout] 116 | | + traverse_cave(next_point, next_dir, cave, visited_tiles, visited_splitters); [INFO] [stdout] | |_____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 115 ~ tile_value [INFO] [stdout] 116 ~ + traverse_cave(next_point, next_dir, cave, visited_tiles, visited_splitters) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day16/mod.rs:119:13 [INFO] [stdout] | [INFO] [stdout] 119 | return 0; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 119 - return 0; [INFO] [stdout] 119 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2023/day16/mod.rs:81:40 [INFO] [stdout] | [INFO] [stdout] 81 | let was_new = visited_tiles.insert(point.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `point` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/y2023/day16/mod.rs:87:41 [INFO] [stdout] | [INFO] [stdout] 87 | let next_point = point.next(&dir); [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2023/day16/mod.rs:98:38 [INFO] [stdout] | [INFO] [stdout] 98 | visited_splitters.insert(point.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `point` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/y2023/day16/mod.rs:107:45 [INFO] [stdout] | [INFO] [stdout] 107 | let next_point = point.next(&dir); [INFO] [stdout] | ^^^^ help: change this to: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/y2023/day17/dijkstra.rs:33:49 [INFO] [stdout] | [INFO] [stdout] 33 | let next_point = current_point.next(&last_dir); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `last_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day18/helpers.rs:9:26 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn min_x(points: &Vec) -> isize { [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] 9 - pub fn min_x(points: &Vec) -> isize { [INFO] [stdout] 9 + pub fn min_x(points: &[Point]) -> isize { [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/y2023/day18/helpers.rs:13:26 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn min_y(points: &Vec) -> isize { [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] 13 - pub fn min_y(points: &Vec) -> isize { [INFO] [stdout] 13 + pub fn min_y(points: &[Point]) -> isize { [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/y2023/day18/helpers.rs:17:26 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn max_x(points: &Vec) -> isize { [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] 17 - pub fn max_x(points: &Vec) -> isize { [INFO] [stdout] 17 + pub fn max_x(points: &[Point]) -> isize { [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/y2023/day18/helpers.rs:21:26 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn max_y(points: &Vec) -> isize { [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 max_y(points: &Vec) -> isize { [INFO] [stdout] 21 + pub fn max_y(points: &[Point]) -> isize { [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/y2023/day18/helpers.rs:35:34 [INFO] [stdout] | [INFO] [stdout] 35 | pub fn extract_dig_plan_1(lines: &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] 35 - pub fn extract_dig_plan_1(lines: &Vec) -> Vec { [INFO] [stdout] 35 + pub fn extract_dig_plan_1(lines: &[String]) -> Vec { [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/y2023/day18/helpers.rs:53:34 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn extract_dig_plan_2(lines: &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] 53 - pub fn extract_dig_plan_2(lines: &Vec) -> Vec { [INFO] [stdout] 53 + pub fn extract_dig_plan_2(lines: &[String]) -> Vec { [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/y2023/day18/helpers.rs:76:33 [INFO] [stdout] | [INFO] [stdout] 76 | pub fn shoelace_formula(points: &Vec) -> isize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 76 - pub fn shoelace_formula(points: &Vec) -> isize { [INFO] [stdout] 76 + pub fn shoelace_formula(points: &[Point]) -> isize { [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/y2023/day18/mod.rs:17:30 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn dig_corners(dig_plan: &Vec, field: &mut Vec, starting_point: Point) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 17 - pub fn dig_corners(dig_plan: &Vec, field: &mut Vec, starting_point: Point) { [INFO] [stdout] 17 + pub fn dig_corners(dig_plan: &[DigInstr], field: &mut Vec, starting_point: Point) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day18/mod.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | while let Some(instr) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for instr in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day18/mod.rs:51:26 [INFO] [stdout] | [INFO] [stdout] 51 | pub fn dig_all(dig_plan: &Vec, field: &mut Vec, starting_point: Point) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 51 - pub fn dig_all(dig_plan: &Vec, field: &mut Vec, starting_point: Point) { [INFO] [stdout] 51 + pub fn dig_all(dig_plan: &[DigInstr], field: &mut Vec, starting_point: Point) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day18/mod.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | while let Some(instr) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for instr in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day19/part.rs:22:24 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn parse(from: &String) -> Part { [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] 22 - pub fn parse(from: &String) -> Part { [INFO] [stdout] 22 + pub fn parse(from: &str) -> Part { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day19/range.rs:80:13 [INFO] [stdout] | [INFO] [stdout] 80 | return (Range::new(at + 1, self.upper), Range::new(self.lower, at)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 80 - return (Range::new(at + 1, self.upper), Range::new(self.lower, at)); [INFO] [stdout] 80 + (Range::new(at + 1, self.upper), Range::new(self.lower, at)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2023/day19/range.rs:82:13 [INFO] [stdout] | [INFO] [stdout] 82 | return (Range::new(self.lower, at - 1), Range::new(at, self.upper)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 82 - return (Range::new(self.lower, at - 1), Range::new(at, self.upper)); [INFO] [stdout] 82 + (Range::new(self.lower, at - 1), Range::new(at, self.upper)) [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/y2023/day19/workflow.rs:25:24 [INFO] [stdout] | [INFO] [stdout] 25 | pub fn parse(from: &String) -> Workflow { [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] 25 - pub fn parse(from: &String) -> Workflow { [INFO] [stdout] 25 + pub fn parse(from: &str) -> Workflow { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y2023/day19/workflow.rs:27:46 [INFO] [stdout] | [INFO] [stdout] 27 | let rules = rules_all.split(",").map(|s| parse_rule(s)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `parse_rule` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day19/mod.rs:72:29 [INFO] [stdout] | [INFO] [stdout] 72 | pub fn extract_input(lines: &Vec) -> (HashMap, 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] 72 - pub fn extract_input(lines: &Vec) -> (HashMap, Vec) { [INFO] [stdout] 72 + pub fn extract_input(lines: &[String]) -> (HashMap, Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day19/mod.rs:78:5 [INFO] [stdout] | [INFO] [stdout] 78 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2023/day19/mod.rs:79:12 [INFO] [stdout] | [INFO] [stdout] 79 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2023/day19/mod.rs:89:5 [INFO] [stdout] | [INFO] [stdout] 89 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y2023/day19/mod.rs:120:42 [INFO] [stdout] | [INFO] [stdout] 120 | let value = part.get_key(&field_name); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `field_name` [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/y2023/day20/extract.rs:11:29 [INFO] [stdout] | [INFO] [stdout] 11 | pub fn extract_input(lines: &Vec) -> (Circuit, FinalCircle) { [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] 11 - pub fn extract_input(lines: &Vec) -> (Circuit, FinalCircle) { [INFO] [stdout] 11 + pub fn extract_input(lines: &[String]) -> (Circuit, FinalCircle) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/y2023/day20/extract.rs:39:16 [INFO] [stdout] | [INFO] [stdout] 39 | if *output == String::from("df") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/y2023/day20/modules.rs:42:17 [INFO] [stdout] | [INFO] [stdout] 42 | if all_highs { false } else { true } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `!all_highs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day21/extract.rs:3:28 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn extract_grid(lines: &Vec) -> (Grid, Point) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 3 - pub fn extract_grid(lines: &Vec) -> (Grid, Point) { [INFO] [stdout] 3 + pub fn extract_grid(lines: &[String]) -> (Grid, Point) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `symbols` [INFO] [stdout] --> src/y2023/day21/extract.rs:11:20 [INFO] [stdout] | [INFO] [stdout] 11 | for col in 0..lines[0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 11 - for col in 0..lines[0].len() { [INFO] [stdout] 11 + for (col, ) in symbols.iter().enumerate().take(lines[0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2023/day21/mod.rs:14:15 [INFO] [stdout] | [INFO] [stdout] 14 | bfs_tiles(start.clone(), &grid, &mut shortest_distances, 64); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `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: iterating on a map's values [INFO] [stdout] --> src/y2023/day21/mod.rs:16:23 [INFO] [stdout] | [INFO] [stdout] 16 | let equal_tiles = shortest_distances [INFO] [stdout] | _______________________^ [INFO] [stdout] 17 | | .iter() [INFO] [stdout] 18 | | .filter_map(|(_, distance)| { [INFO] [stdout] 19 | | if distance % 2 == 0 { [INFO] [stdout] ... | [INFO] [stdout] 24 | | }) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 16 ~ let equal_tiles = shortest_distances.values().filter_map(|distance| { [INFO] [stdout] 17 + if distance % 2 == 0 { [INFO] [stdout] 18 + Some(*distance) [INFO] [stdout] 19 + } else { [INFO] [stdout] 20 + None [INFO] [stdout] 21 + } [INFO] [stdout] 22 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/y2023/day21/mod.rs:46:12 [INFO] [stdout] | [INFO] [stdout] 46 | if grid.get_point(&point).unwrap() == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!grid.get_point(&point).unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2023/day22/extract.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | pub fn extract_input(lines: &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] 12 - pub fn extract_input(lines: &Vec) -> Vec { [INFO] [stdout] 12 + pub fn extract_input(lines: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day2/mod.rs:31:17 [INFO] [stdout] | [INFO] [stdout] 31 | return if result { 1 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 31 - return if result { 1 } else { 0 }; [INFO] [stdout] 31 + if result { 1 } else { 0 } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day2/mod.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | return 1; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 33 - return 1; [INFO] [stdout] 33 + 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day2/mod.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 70 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 70 - return None; [INFO] [stdout] 70 + None [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/y2024/day2/mod.rs:42:28 [INFO] [stdout] | [INFO] [stdout] 42 | fn get_unsafe_index(level: &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] 42 - fn get_unsafe_index(level: &Vec) -> Option { [INFO] [stdout] 42 + fn get_unsafe_index(level: &[u32]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `index` is used to index `level` [INFO] [stdout] --> src/y2024/day2/mod.rs:47:18 [INFO] [stdout] | [INFO] [stdout] 47 | for index in 1..len { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 47 - for index in 1..len { [INFO] [stdout] 47 + for (index, ) in level.iter().enumerate().take(len).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/y2024/day2/mod.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 52 | if diff < 1 || diff > 3 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=3).contains(&diff)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day5/extract.rs:12:13 [INFO] [stdout] | [INFO] [stdout] 12 | return position_first < position_second; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 12 - return position_first < position_second; [INFO] [stdout] 12 + position_first < position_second [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day5/extract.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 14 - return true; [INFO] [stdout] 14 + true [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/y2024/day5/extract.rs:5:43 [INFO] [stdout] | [INFO] [stdout] 5 | pub fn is_valid_update(&self, update: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 5 - pub fn is_valid_update(&self, update: &Vec) -> bool { [INFO] [stdout] 5 + pub fn is_valid_update(&self, update: &[u32]) -> bool { [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/y2024/day5/extract.rs:19:29 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn extract_input(lines: &Vec) -> (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] 19 - pub fn extract_input(lines: &Vec) -> (Vec, Vec>) { [INFO] [stdout] 19 + pub fn extract_input(lines: &[String]) -> (Vec, Vec>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2024/day5/extract.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/y2024/day5/extract.rs:25:12 [INFO] [stdout] | [INFO] [stdout] 25 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/y2024/day5/extract.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | while let Some(line) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for line in iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2024/day5/mod.rs:17:42 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn part1(rules: &Vec, updates: &Vec>) -> u32 { [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] 17 - pub fn part1(rules: &Vec, updates: &Vec>) -> u32 { [INFO] [stdout] 17 + pub fn part1(rules: &Vec, updates: &[Vec]) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/y2024/day5/mod.rs:21:16 [INFO] [stdout] | [INFO] [stdout] 21 | if let Some(_) = get_first_broken_rule(rules, update) { [INFO] [stdout] | -------^^^^^^^--------------------------------------- help: try: `if get_first_broken_rule(rules, update).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2024/day5/mod.rs:31:42 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn part2(rules: &Vec, updates: &mut Vec>) -> u32 { [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] 31 - pub fn part2(rules: &Vec, updates: &mut Vec>) -> u32 { [INFO] [stdout] 31 + pub fn part2(rules: &Vec, updates: &mut [Vec]) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day5/mod.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 54 - return None; [INFO] [stdout] 54 + None [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/y2024/day5/mod.rs:47:41 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn get_first_broken_rule<'a>(rules: &'a Vec, update: &Vec) -> Option<&'a Rule> { [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] 47 - pub fn get_first_broken_rule<'a>(rules: &'a Vec, update: &Vec) -> Option<&'a Rule> { [INFO] [stdout] 47 + pub fn get_first_broken_rule<'a>(rules: &'a [Rule], update: &Vec) -> Option<&'a Rule> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/y2024/day5/mod.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | / for rule in rules.iter() { [INFO] [stdout] 49 | | if !rule.is_valid_update(update) { [INFO] [stdout] 50 | | return Some(rule); [INFO] [stdout] ... | [INFO] [stdout] 54 | | return None; [INFO] [stdout] | |________________^ help: replace with an iterator: `rules.iter().find(|&rule| !rule.is_valid_update(update)).map(|v| v as _)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2024/day5/mod.rs:72:32 [INFO] [stdout] | [INFO] [stdout] 72 | pub fn get_middle_element(vec: &Vec) -> u32 { [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] 72 - pub fn get_middle_element(vec: &Vec) -> u32 { [INFO] [stdout] 72 + pub fn get_middle_element(vec: &[u32]) -> u32 { [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/y2024/day7/mod.rs:20:29 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn extract_input(lines: &Vec) -> Vec<(u64, VecDeque)> { [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] 20 - pub fn extract_input(lines: &Vec) -> Vec<(u64, VecDeque)> { [INFO] [stdout] 20 + pub fn extract_input(lines: &[String]) -> Vec<(u64, VecDeque)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day7/mod.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | return (numbers[0] == result) as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 65 - return (numbers[0] == result) as u64; [INFO] [stdout] 65 + (numbers[0] == result) as u64 [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/y2024/day8/mod.rs:19:32 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn extract_antennas(lines: &Vec) -> (Grid, Antennas) { [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] 19 - pub fn extract_antennas(lines: &Vec) -> (Grid, Antennas) { [INFO] [stdout] 19 + pub fn extract_antennas(lines: &[String]) -> (Grid, Antennas) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `lines` [INFO] [stdout] --> src/y2024/day8/mod.rs:25:16 [INFO] [stdout] | [INFO] [stdout] 25 | for row in 0..rows { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 25 - for row in 0..rows { [INFO] [stdout] 25 + for (row, ) in lines.iter().enumerate().take(rows) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `symbols` [INFO] [stdout] --> src/y2024/day8/mod.rs:29:20 [INFO] [stdout] | [INFO] [stdout] 29 | for col in 0..cols { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 29 - for col in 0..cols { [INFO] [stdout] 29 + for (col, ) in symbols.iter().enumerate().take(cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2024/day8/mod.rs:34:38 [INFO] [stdout] | [INFO] [stdout] 34 | antennas.entry(item).or_insert_with(Vec::new).push(point); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2024/day9/disk.rs:3:38 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn restore_disk_blocks(disk_map: &Vec) -> Disk { [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 restore_disk_blocks(disk_map: &Vec) -> Disk { [INFO] [stdout] 3 + pub fn restore_disk_blocks(disk_map: &[u8]) -> Disk { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/y2024/day9/disk.rs:10:25 [INFO] [stdout] | [INFO] [stdout] 10 | disk.extend(std::iter::repeat(Some(current_id)).take(*item as usize)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(Some(current_id), *item as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/y2024/day9/disk.rs:13:25 [INFO] [stdout] | [INFO] [stdout] 13 | disk.extend(std::iter::repeat(None).take(*item as usize)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(None, *item as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `position` is used as a loop counter [INFO] [stdout] --> src/y2024/day9/disk.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | for item in disk.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (position, item) in disk.iter().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Point` which implements the `Copy` trait [INFO] [stdout] --> src/y2024/day10/mod.rs:18:34 [INFO] [stdout] | [INFO] [stdout] 18 | let current_trail = 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: use of `or_insert_with` to construct default value [INFO] [stdout] --> src/y2024/day10/mod.rs:50:26 [INFO] [stdout] | [INFO] [stdout] 50 | .or_insert_with(HashSet::new) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/y2024/day11/mod.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | number.to_string().len() % 2 == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `number.to_string().len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/y2024/day13/arcade.rs:28:32 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn extract_machines(lines: &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] 28 - pub fn extract_machines(lines: &Vec) -> Vec { [INFO] [stdout] 28 + pub fn extract_machines(lines: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y2024/day13/mod.rs:82:5 [INFO] [stdout] | [INFO] [stdout] 82 | return Some(cost); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 82 - return Some(cost); [INFO] [stdout] 82 + Some(cost) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/new_day.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 - return None; [INFO] [stdout] 27 + None [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/common/new_day.rs:3:27 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn resolve_args(args: &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] 3 - pub fn resolve_args(args: &Vec) -> Option { [INFO] [stdout] 3 + pub fn resolve_args(args: &[String]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/common/point.rs:91:6 [INFO] [stdout] | [INFO] [stdout] 91 | impl<'a, 'b> Sub<&'b Point> for &'a Point { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 91 - impl<'a, 'b> Sub<&'b Point> for &'a Point { [INFO] [stdout] 91 + impl<'b> Sub<&'b Point> for &Point { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | return row < self.rows && col < self.cols; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return row < self.rows && col < self.cols; [INFO] [stdout] 30 + row < self.rows && col < self.cols [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | return row >= 0 && (row as usize) < self.rows && col >= 0 && (col as usize) < self.cols; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 34 - return row >= 0 && (row as usize) < self.rows && col >= 0 && (col as usize) < self.cols; [INFO] [stdout] 34 + row >= 0 && (row as usize) < self.rows && col >= 0 && (col as usize) < self.cols [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | / return point.0 >= 0 [INFO] [stdout] 39 | | && (point.0 as usize) < self.rows [INFO] [stdout] 40 | | && point.1 >= 0 [INFO] [stdout] 41 | | && (point.1 as usize) < self.cols; [INFO] [stdout] | |_____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 38 ~ point.0 >= 0 [INFO] [stdout] 39 + && (point.0 as usize) < self.rows [INFO] [stdout] 40 + && point.1 >= 0 [INFO] [stdout] 41 ~ && (point.1 as usize) < self.cols [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | return Some(self.data[point.0 as usize][point.1 as usize]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 61 - return Some(self.data[point.0 as usize][point.1 as usize]); [INFO] [stdout] 61 + Some(self.data[point.0 as usize][point.1 as usize]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/common/grid.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 73 - return None; [INFO] [stdout] 73 + None [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/common/grid.rs:102:28 [INFO] [stdout] | [INFO] [stdout] 102 | pub fn from_vec(input: &Vec) -> Grid { [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] 102 - pub fn from_vec(input: &Vec) -> Grid { [INFO] [stdout] 102 + pub fn from_vec(input: &[String]) -> Grid { [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/common/grid.rs:113:34 [INFO] [stdout] | [INFO] [stdout] 113 | pub fn usize_from_vec(input: &Vec) -> Grid { [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] 113 - pub fn usize_from_vec(input: &Vec) -> Grid { [INFO] [stdout] 113 + pub fn usize_from_vec(input: &[String]) -> Grid { [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/common/grid.rs:129:31 [INFO] [stdout] | [INFO] [stdout] 129 | pub fn u8_from_vec(input: &Vec) -> Grid { [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] 129 - pub fn u8_from_vec(input: &Vec) -> Grid { [INFO] [stdout] 129 + pub fn u8_from_vec(input: &[String]) -> Grid { [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/common/grid.rs:144:45 [INFO] [stdout] | [INFO] [stdout] 144 | pub fn map_bool_from_vec(input: &Vec, mapper: Mapper) -> Grid [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] 144 - pub fn map_bool_from_vec(input: &Vec, mapper: Mapper) -> Grid [INFO] [stdout] 144 + pub fn map_bool_from_vec(input: &[String], mapper: Mapper) -> Grid [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/common/grid.rs:150:42 [INFO] [stdout] | [INFO] [stdout] 150 | .map(|line| line.chars().map(|ch| mapper(ch)).collect::>()) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&mapper` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/common/print_by_line.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/common/print_by_line.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/common/algos.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | numbers.into_iter().fold(1, |a, b| lcm(a, *b)) [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/main.rs:101:12 [INFO] [stdout] | [INFO] [stdout] 101 | if let Some(_) = new_day::resolve_args(&args) { [INFO] [stdout] | -------^^^^^^^------------------------------- help: try: `if new_day::resolve_args(&args).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y2023/day2/mod.rs:114:5 [INFO] [stdout] | [INFO] [stdout] 114 | / vec![ [INFO] [stdout] 115 | | (r"(\d+) red", "red"), [INFO] [stdout] 116 | | (r"(\d+) green", "green"), [INFO] [stdout] 117 | | (r"(\d+) blue", "blue"), [INFO] [stdout] 118 | | ] [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 114 ~ [(r"(\d+) red", "red"), [INFO] [stdout] 115 + (r"(\d+) green", "green"), [INFO] [stdout] 116 + (r"(\d+) blue", "blue")] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y2023/day23/mod.rs:43:17 [INFO] [stdout] | [INFO] [stdout] 43 | vec![point.east(), point.west(), point.north(), point.south()] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[point.east(), point.west(), point.north(), point.south()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.79s [INFO] running `Command { std: "docker" "inspect" "c0751fc73503fb3313ecfd50bb93f5d180c22071a21b3f9eff45fd87021abce3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c0751fc73503fb3313ecfd50bb93f5d180c22071a21b3f9eff45fd87021abce3", kill_on_drop: false }` [INFO] [stdout] c0751fc73503fb3313ecfd50bb93f5d180c22071a21b3f9eff45fd87021abce3