[INFO] cloning repository https://github.com/lkbhargav/advent-of-code [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/lkbhargav/advent-of-code" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flkbhargav%2Fadvent-of-code", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flkbhargav%2Fadvent-of-code'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] d774d8561b9caedb454f07e5a0fc07431711b0d0 [INFO] linting lkbhargav/advent-of-code against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flkbhargav%2Fadvent-of-code" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/lkbhargav/advent-of-code [INFO] finished tweaking git repo https://github.com/lkbhargav/advent-of-code [INFO] tweaked toml for git repo https://github.com/lkbhargav/advent-of-code written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/lkbhargav/advent-of-code 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/lkbhargav/advent-of-code already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded priority-queue v2.1.0 [INFO] [stderr] Downloaded clap v4.5.17 [INFO] [stderr] Downloaded clap_derive v4.5.13 [INFO] [stderr] Downloaded help v0.0.0 [INFO] [stderr] Downloaded clap_builder v4.5.17 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] d95eaad0300be2fcecb24a7cdc32e7f694833ea430c84a3f12870912cea8caf0 [INFO] running `Command { std: "docker" "start" "-a" "d95eaad0300be2fcecb24a7cdc32e7f694833ea430c84a3f12870912cea8caf0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "d95eaad0300be2fcecb24a7cdc32e7f694833ea430c84a3f12870912cea8caf0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d95eaad0300be2fcecb24a7cdc32e7f694833ea430c84a3f12870912cea8caf0", kill_on_drop: false }` [INFO] [stdout] d95eaad0300be2fcecb24a7cdc32e7f694833ea430c84a3f12870912cea8caf0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] d67b9c82dfdfbd7cc021810956f7c5150e653ddc29f977e3d5915ffe176c3e02 [INFO] running `Command { std: "docker" "start" "-a" "d67b9c82dfdfbd7cc021810956f7c5150e653ddc29f977e3d5915ffe176c3e02", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.86 [INFO] [stderr] Compiling serde v1.0.210 [INFO] [stderr] Compiling libc v0.2.158 [INFO] [stderr] Compiling rustix v0.38.36 [INFO] [stderr] Compiling thiserror v1.0.63 [INFO] [stderr] Checking anstyle-query v1.1.1 [INFO] [stderr] Checking colorchoice v1.0.2 [INFO] [stderr] Checking anstyle v1.0.8 [INFO] [stderr] Checking anstyle-parse v0.2.5 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking clap_lex v0.7.2 [INFO] [stderr] Checking once_cell v1.19.0 [INFO] [stderr] Checking unicode-width v0.1.13 [INFO] [stderr] Checking regex-syntax v0.8.4 [INFO] [stderr] Checking fastrand v2.1.1 [INFO] [stderr] Compiling serde_json v1.0.128 [INFO] [stderr] Checking indexmap v2.5.0 [INFO] [stderr] Checking shell-words v1.1.0 [INFO] [stderr] Checking colored v2.1.0 [INFO] [stderr] Checking help v0.0.0 [INFO] [stderr] Checking anstream v0.6.15 [INFO] [stderr] Checking clap_builder v4.5.17 [INFO] [stderr] Compiling quote v1.0.37 [INFO] [stderr] Compiling syn v2.0.77 [INFO] [stderr] Checking console v0.15.8 [INFO] [stderr] Checking regex-automata v0.4.7 [INFO] [stderr] Checking tempfile v3.12.0 [INFO] [stderr] Compiling serde_derive v1.0.210 [INFO] [stderr] Compiling thiserror-impl v1.0.63 [INFO] [stderr] Compiling clap_derive v4.5.13 [INFO] [stderr] Checking regex v1.10.6 [INFO] [stderr] Checking dialoguer v0.11.0 [INFO] [stderr] Checking clap v4.5.17 [INFO] [stderr] Checking priority-queue v2.1.0 [INFO] [stderr] Checking advent_of_code v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/util.rs:6:41 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn prompt_select(q: &str, items: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 6 - pub fn prompt_select(q: &str, items: &Vec) -> usize [INFO] [stdout] 6 + pub fn prompt_select(q: &str, items: &[T]) -> usize [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / return Cow::Owned( [INFO] [stdout] 60 | | fs::read_to_string(path) [INFO] [stdout] 61 | | .expect("expected a valid file at the specified path but found none") [INFO] [stdout] 62 | | .trim() [INFO] [stdout] 63 | | .to_string(), [INFO] [stdout] 64 | | ); [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] 59 ~ Cow::Owned( [INFO] [stdout] 60 + fs::read_to_string(path) [INFO] [stdout] 61 + .expect("expected a valid file at the specified path but found none") [INFO] [stdout] 62 + .trim() [INFO] [stdout] 63 + .to_string(), [INFO] [stdout] 64 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/util.rs:102:43 [INFO] [stdout] | [INFO] [stdout] 102 | let pattern = Regex::new(pattern).expect( [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 103 | | format!("error initializing regex parser with the given pattern - {pattern}").as_str(), [INFO] [stdout] 104 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("error initializing regex parser with the given pattern - {pattern}"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/y_2015/d_1.rs:9:19 [INFO] [stdout] | [INFO] [stdout] 9 | let ans = (&self.inp.iter().sum::()).to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.inp.iter().sum::()` [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: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2015/d_1.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | / pub fn new() -> Day1 { [INFO] [stdout] 59 | | Day1 { inp: vec![] } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 57 + impl Default for Day1 { [INFO] [stdout] 58 + fn default() -> Self { [INFO] [stdout] 59 + Self::new() [INFO] [stdout] 60 + } [INFO] [stdout] 61 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_2.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | res = least_area + total + res; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `res += least_area + total` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_2.rs:64:13 [INFO] [stdout] | [INFO] [stdout] 64 | res = wrap + bow + res; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `res += wrap + bow` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2015/d_2.rs:76:5 [INFO] [stdout] | [INFO] [stdout] 76 | / pub fn new() -> Day2 { [INFO] [stdout] 77 | | Day2 { inp: vec![] } [INFO] [stdout] 78 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 75 + impl Default for Day2 { [INFO] [stdout] 76 + fn default() -> Self { [INFO] [stdout] 77 + Self::new() [INFO] [stdout] 78 + } [INFO] [stdout] 79 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_2.rs:99:13 [INFO] [stdout] | [INFO] [stdout] 99 | bow = bow * *a; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `bow *= *a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_2.rs:105:13 [INFO] [stdout] | [INFO] [stdout] 105 | wrap = wrap + (*v * 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `wrap += (*v * 2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Record` [INFO] [stdout] --> src/y_2015/d_3.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn new() -> Self { [INFO] [stdout] 37 | | Record { [INFO] [stdout] 38 | | x: 0, [INFO] [stdout] 39 | | y: 0, [INFO] [stdout] ... | [INFO] [stdout] 42 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 35 + impl Default for Record { [INFO] [stdout] 36 + fn default() -> Self { [INFO] [stdout] 37 + Self::new() [INFO] [stdout] 38 + } [INFO] [stdout] 39 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/y_2015/d_3.rs:47:21 [INFO] [stdout] | [INFO] [stdout] 47 | None => 0 as usize, [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Record` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/y_2015/d_3.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_3.rs:59:31 [INFO] [stdout] | [INFO] [stdout] 59 | Compass::North => self.y = self.y + 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.y += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_3.rs:60:30 [INFO] [stdout] | [INFO] [stdout] 60 | Compass::East => self.x = self.x + 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.x += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_3.rs:61:31 [INFO] [stdout] | [INFO] [stdout] 61 | Compass::South => self.y = self.y - 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.y -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_3.rs:62:30 [INFO] [stdout] | [INFO] [stdout] 62 | Compass::West => self.x = self.x - 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.x -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y_2015/d_3.rs:84:18 [INFO] [stdout] | [INFO] [stdout] 84 | .map(|v| Compass::parse(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Compass::parse` [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: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y_2015/d_3.rs:79:20 [INFO] [stdout] | [INFO] [stdout] 79 | self.inp = contents [INFO] [stdout] | ____________________^ [INFO] [stdout] 80 | | .trim() [INFO] [stdout] 81 | | .split("") [INFO] [stdout] 82 | | .into_iter() [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 79 ~ self.inp = contents [INFO] [stdout] 80 + .trim() [INFO] [stdout] 81 + .split("") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2015/d_3.rs:135:5 [INFO] [stdout] | [INFO] [stdout] 135 | / pub fn new() -> Day3 { [INFO] [stdout] 136 | | Day3 { inp: vec![] } [INFO] [stdout] 137 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 134 + impl Default for Day3 { [INFO] [stdout] 135 + fn default() -> Self { [INFO] [stdout] 136 + Self::new() [INFO] [stdout] 137 + } [INFO] [stdout] 138 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2015/d_4.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / pub fn new() -> Day4 { [INFO] [stdout] 61 | | Day4 { inp: String::new() } [INFO] [stdout] 62 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 59 + impl Default for Day4 { [INFO] [stdout] 60 + fn default() -> Self { [INFO] [stdout] 61 + Self::new() [INFO] [stdout] 62 + } [INFO] [stdout] 63 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2015/d_5.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / if self.rule_2 == State::Unknown && self.valid == State::Unknown { [INFO] [stdout] 53 | | if a == b { [INFO] [stdout] 54 | | self.rule_2 = State::Valid; [INFO] [stdout] 55 | | self.validate(); [INFO] [stdout] 56 | | } [INFO] [stdout] 57 | | } [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] 52 ~ if self.rule_2 == State::Unknown && self.valid == State::Unknown [INFO] [stdout] 53 ~ && a == b { [INFO] [stdout] 54 | self.rule_2 = State::Valid; [INFO] [stdout] 55 | self.validate(); [INFO] [stdout] 56 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2015/d_5.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | / if self.rule_3 == State::Unknown && self.valid == State::Unknown { [INFO] [stdout] 62 | | if a == b - 1 && vec![98, 100, 113, 121].contains(&(b as i32)) { [INFO] [stdout] 63 | | self.rule_3 = State::Invalid; [INFO] [stdout] 64 | | self.validate(); [INFO] [stdout] 65 | | } [INFO] [stdout] 66 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if self.rule_3 == State::Unknown && self.valid == State::Unknown [INFO] [stdout] 62 ~ && a == b - 1 && vec![98, 100, 113, 121].contains(&(b as i32)) { [INFO] [stdout] 63 | self.rule_3 = State::Invalid; [INFO] [stdout] 64 | self.validate(); [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/y_2015/d_5.rs:137:23 [INFO] [stdout] | [INFO] [stdout] 137 | for (_, v) in &self.rule_1_map { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 137 - for (_, v) in &self.rule_1_map { [INFO] [stdout] 137 + for v in self.rule_1_map.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day5` [INFO] [stdout] --> src/y_2015/d_5.rs:259:5 [INFO] [stdout] | [INFO] [stdout] 259 | / pub fn new() -> Day5 { [INFO] [stdout] 260 | | Day5 { [INFO] [stdout] 261 | | q1: vec![], [INFO] [stdout] 262 | | q2: vec![], [INFO] [stdout] 263 | | } [INFO] [stdout] 264 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 258 + impl Default for Day5 { [INFO] [stdout] 259 + fn default() -> Self { [INFO] [stdout] 260 + Self::new() [INFO] [stdout] 261 + } [INFO] [stdout] 262 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day6` [INFO] [stdout] --> src/y_2015/d_6.rs:120:5 [INFO] [stdout] | [INFO] [stdout] 120 | / pub fn new() -> Day6 { [INFO] [stdout] 121 | | Day6 { [INFO] [stdout] 122 | | inp: vec![], [INFO] [stdout] 123 | | lights: vec![vec![0; 1000]; 1000], [INFO] [stdout] 124 | | } [INFO] [stdout] 125 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 119 + impl Default for Day6 { [INFO] [stdout] 120 + fn default() -> Self { [INFO] [stdout] 121 + Self::new() [INFO] [stdout] 122 + } [INFO] [stdout] 123 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/y_2015/d_7.rs:103:39 [INFO] [stdout] | [INFO] [stdout] 103 | .filter(|v| !v.is_empty()) [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 104 | | .map(|v| v) [INFO] [stdout] | |_______________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `inp` after checking its variant with `is_ok` [INFO] [stdout] --> src/y_2015/d_7.rs:145:61 [INFO] [stdout] | [INFO] [stdout] 144 | if inp.is_ok() { [INFO] [stdout] | -------------- help: try: `if let Ok() = inp` [INFO] [stdout] 145 | self.map.insert(output.to_string(), inp.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day7` [INFO] [stdout] --> src/y_2015/d_7.rs:203:5 [INFO] [stdout] | [INFO] [stdout] 203 | / pub fn new() -> Day7 { [INFO] [stdout] 204 | | Day7 { [INFO] [stdout] 205 | | data: HashMap::new(), [INFO] [stdout] 206 | | map: HashMap::new(), [INFO] [stdout] 207 | | } [INFO] [stdout] 208 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 202 + impl Default for Day7 { [INFO] [stdout] 203 + fn default() -> Self { [INFO] [stdout] 204 + Self::new() [INFO] [stdout] 205 + } [INFO] [stdout] 206 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y_2015/d_7.rs:220:38 [INFO] [stdout] | [INFO] [stdout] 220 | let val = &self.value_of(&inp); [INFO] [stdout] | ^^^^ help: change this to: `inp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/y_2015/d_7.rs:223:40 [INFO] [stdout] | [INFO] [stdout] 223 | let res = (*v).op.operate(tmp).expect( [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 224 | | format!("2nd place expected a valid response for the operation but got this error") [INFO] [stdout] 225 | | .as_str(), [INFO] [stdout] 226 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("2nd place expected a valid response for the operation but got this error"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/y_2015/d_7.rs:223:19 [INFO] [stdout] | [INFO] [stdout] 223 | let res = (*v).op.operate(tmp).expect( [INFO] [stdout] | ^^^^ help: try: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/y_2015/d_7.rs:224:13 [INFO] [stdout] | [INFO] [stdout] 224 | format!("2nd place expected a valid response for the operation but got this error") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"2nd place expected a valid response for the operation but got this error".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/y_2015/d_7.rs:239:22 [INFO] [stdout] | [INFO] [stdout] 239 | .expect(format!("error trying to parse string to int {key}").as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("error trying to parse string to int {key}"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/y_2015/d_8.rs:37:44 [INFO] [stdout] | [INFO] [stdout] 37 | let v = pattern.replace_all(v, format!("x")); [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using `.to_string()`: `"x".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day8` [INFO] [stdout] --> src/y_2015/d_8.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | / pub fn new() -> Day8 { [INFO] [stdout] 75 | | Day8 { inp: vec![] } [INFO] [stdout] 76 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 73 + impl Default for Day8 { [INFO] [stdout] 74 + fn default() -> Self { [INFO] [stdout] 75 + Self::new() [INFO] [stdout] 76 + } [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2015/d_9.rs:58:28 [INFO] [stdout] | [INFO] [stdout] 58 | let distance = captures.get_name_usize("distance") as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `captures.get_name_usize("distance")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2015/d_9.rs:75:33 [INFO] [stdout] | [INFO] [stdout] 75 | self.number_of_cities = unique_cities.len() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unique_cities.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day9` [INFO] [stdout] --> src/y_2015/d_9.rs:136:5 [INFO] [stdout] | [INFO] [stdout] 136 | / pub fn new() -> Day9 { [INFO] [stdout] 137 | | Day9 { [INFO] [stdout] 138 | | data: HashMap::new(), [INFO] [stdout] 139 | | distances_reference: HashMap::new(), [INFO] [stdout] ... | [INFO] [stdout] 142 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 135 + impl Default for Day9 { [INFO] [stdout] 136 + fn default() -> Self { [INFO] [stdout] 137 + Self::new() [INFO] [stdout] 138 + } [INFO] [stdout] 139 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/y_2015/d_9.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 161 | / if !self.distances_reference.contains_key(&key) { [INFO] [stdout] 162 | | self.distances_reference.insert(key, distance); [INFO] [stdout] 163 | | } [INFO] [stdout] | |_________^ help: try: `self.distances_reference.entry(key).or_insert(distance);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2015/d_9.rs:186:20 [INFO] [stdout] | [INFO] [stdout] 186 | if locations.len() as usize == self.number_of_cities { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `locations.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/y_2015/d_9.rs:196:13 [INFO] [stdout] | [INFO] [stdout] 196 | / match self.data.get(&location) { [INFO] [stdout] 197 | | Some(d) => { [INFO] [stdout] 198 | | self.navigate(d.clone(), locations, results); [INFO] [stdout] ... | [INFO] [stdout] 201 | | }; [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] 196 ~ if let Some(d) = self.data.get(&location) { [INFO] [stdout] 197 + self.navigate(d.clone(), locations, results); [INFO] [stdout] 198 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2015/d_10.rs:77:17 [INFO] [stdout] | [INFO] [stdout] 77 | / if idx > 0 { [INFO] [stdout] 78 | | if prev_char != *c { [INFO] [stdout] 79 | | tmp.extend(Day10::get_num_as_chars(char_sequence.len())); [INFO] [stdout] 80 | | tmp.push(char_sequence.chars().collect::>()[0]); [INFO] [stdout] ... | [INFO] [stdout] 84 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 77 ~ if idx > 0 [INFO] [stdout] 78 ~ && prev_char != *c { [INFO] [stdout] 79 | tmp.extend(Day10::get_num_as_chars(char_sequence.len())); [INFO] [stdout] ... [INFO] [stdout] 82 | char_sequence = String::new(); [INFO] [stdout] 83 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_11.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 32 | self.password[last_index] = self.password[last_index] + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.password[last_index] += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2015/d_11.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | / if !first_rule && idx + 2 < self.password.len() { [INFO] [stdout] 52 | | if c + 1 == self.password[idx + 1] && c + 2 == self.password[idx + 2] { [INFO] [stdout] 53 | | first_rule = true; [INFO] [stdout] 54 | | } [INFO] [stdout] 55 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 51 ~ if !first_rule && idx + 2 < self.password.len() [INFO] [stdout] 52 ~ && c + 1 == self.password[idx + 1] && c + 2 == self.password[idx + 2] { [INFO] [stdout] 53 | first_rule = true; [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `y_2015::d_11::Password` [INFO] [stdout] --> src/y_2015/d_11.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | / pub fn to_string(&self) -> String { [INFO] [stdout] 74 | | str::from_utf8(&self.password).unwrap().to_string() [INFO] [stdout] 75 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `y_2015::d_11::Password` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `ans` [INFO] [stdout] --> src/y_2015/d_11.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | let ans = ans; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `ans` is initially defined here [INFO] [stdout] --> src/y_2015/d_11.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | let ans = self.new_password(); [INFO] [stdout] | ^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2015/d_12.rs:38:24 [INFO] [stdout] | [INFO] [stdout] 38 | if num_str.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!num_str.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: you should consider adding a `Default` implementation for `Day12` [INFO] [stdout] --> src/y_2015/d_12.rs:68:5 [INFO] [stdout] | [INFO] [stdout] 68 | / pub fn new() -> Day12 { [INFO] [stdout] 69 | | Day12 { inp: String::new() } [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 67 + impl Default for Day12 { [INFO] [stdout] 68 + fn default() -> Self { [INFO] [stdout] 69 + Self::new() [INFO] [stdout] 70 + } [INFO] [stdout] 71 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/y_2015/d_12.rs:92:28 [INFO] [stdout] | [INFO] [stdout] 92 | sum += match val.as_i64() { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 93 | | None => 0, [INFO] [stdout] 94 | | Some(i) => i, [INFO] [stdout] 95 | | }; [INFO] [stdout] | |_____________________^ help: ascribe the type i64 and replace your expression with: `val.as_i64().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/y_2015/d_12.rs:107:28 [INFO] [stdout] | [INFO] [stdout] 107 | sum += match j.as_i64() { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 108 | | None => 0, [INFO] [stdout] 109 | | Some(i) => i, [INFO] [stdout] 110 | | }; [INFO] [stdout] | |_____________________^ help: ascribe the type i64 and replace your expression with: `j.as_i64().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/y_2015/d_12.rs:120:20 [INFO] [stdout] | [INFO] [stdout] 120 | sum += match v.as_i64() { [INFO] [stdout] | ____________________^ [INFO] [stdout] 121 | | None => 0, [INFO] [stdout] 122 | | Some(i) => i, [INFO] [stdout] 123 | | }; [INFO] [stdout] | |_____________^ help: replace it with: `v.as_i64().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y_2016/d_1.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | let num = d.split("L").into_iter().collect::>()[1].to_i32("L part"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `d.split("L")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y_2016/d_1.rs:17:23 [INFO] [stdout] | [INFO] [stdout] 17 | let num = d.split("R").into_iter().collect::>()[1].to_i32("R part"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `d.split("R")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: attempt to mutate range bound within loop [INFO] [stdout] --> src/y_2016/d_1.rs:174:25 [INFO] [stdout] | [INFO] [stdout] 174 | x = nx; [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: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2016/d_1.rs:203:5 [INFO] [stdout] | [INFO] [stdout] 203 | / pub fn new() -> Day1 { [INFO] [stdout] 204 | | Day1 { directions: vec![] } [INFO] [stdout] 205 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 202 + impl Default for Day1 { [INFO] [stdout] 203 + fn default() -> Self { [INFO] [stdout] 204 + Self::new() [INFO] [stdout] 205 + } [INFO] [stdout] 206 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y_2016/d_2.rs:44:26 [INFO] [stdout] | [INFO] [stdout] 44 | .map(|d| Direction::parse(d)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Direction::parse` [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: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2016/d_2.rs:156:5 [INFO] [stdout] | [INFO] [stdout] 156 | / pub fn new() -> Day2 { [INFO] [stdout] 157 | | Day2 { [INFO] [stdout] 158 | | data: vec![], [INFO] [stdout] 159 | | grid: vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]], [INFO] [stdout] ... | [INFO] [stdout] 168 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 155 + impl Default for Day2 { [INFO] [stdout] 156 + fn default() -> Self { [INFO] [stdout] 157 + Self::new() [INFO] [stdout] 158 + } [INFO] [stdout] 159 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2016/d_3.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / pub fn new() -> Day3 { [INFO] [stdout] 66 | | Day3 { data: vec![] } [INFO] [stdout] 67 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 64 + impl Default for Day3 { [INFO] [stdout] 65 + fn default() -> Self { [INFO] [stdout] 66 + Self::new() [INFO] [stdout] 67 + } [INFO] [stdout] 68 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2016/d_4.rs:153:5 [INFO] [stdout] | [INFO] [stdout] 153 | / pub fn new() -> Day4 { [INFO] [stdout] 154 | | Day4 { data: vec![] } [INFO] [stdout] 155 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 152 + impl Default for Day4 { [INFO] [stdout] 153 + fn default() -> Self { [INFO] [stdout] 154 + Self::new() [INFO] [stdout] 155 + } [INFO] [stdout] 156 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/y_2016/d_5.rs:25:39 [INFO] [stdout] | [INFO] [stdout] 25 | let digest = md5::compute(&format!("{}{}", self.word, count)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}{}", self.word, count)` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/y_2016/d_5.rs:62:39 [INFO] [stdout] | [INFO] [stdout] 62 | let digest = md5::compute(&format!("{}{}", self.word, count)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}{}", self.word, count)` [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: you should consider adding a `Default` implementation for `Day5` [INFO] [stdout] --> src/y_2016/d_5.rs:106:5 [INFO] [stdout] | [INFO] [stdout] 106 | / pub fn new() -> Day5 { [INFO] [stdout] 107 | | Day5 { [INFO] [stdout] 108 | | word: String::new(), [INFO] [stdout] 109 | | } [INFO] [stdout] 110 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 105 + impl Default for Day5 { [INFO] [stdout] 106 + fn default() -> Self { [INFO] [stdout] 107 + Self::new() [INFO] [stdout] 108 + } [INFO] [stdout] 109 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y_2016/d_6.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashMap, i32}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day6` [INFO] [stdout] --> src/y_2016/d_6.rs:118:5 [INFO] [stdout] | [INFO] [stdout] 118 | / pub fn new() -> Day6 { [INFO] [stdout] 119 | | Day6 { data: vec![] } [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 117 + impl Default for Day6 { [INFO] [stdout] 118 + fn default() -> Self { [INFO] [stdout] 119 + Self::new() [INFO] [stdout] 120 + } [INFO] [stdout] 121 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2016/d_7.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 40 | if hypernet_set.len() == 0 || supernet_set.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `hypernet_set.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2016/d_7.rs:40:39 [INFO] [stdout] | [INFO] [stdout] 40 | if hypernet_set.len() == 0 || supernet_set.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `supernet_set.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2016/d_7.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | return; [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 - } [INFO] [stdout] 71 - [INFO] [stdout] 72 - return; [INFO] [stdout] 70 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `l` is used as a loop counter [INFO] [stdout] --> src/y_2016/d_7.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | for _ in 2..inp.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (l, _) in (2..inp.len()).enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `r` is used as a loop counter [INFO] [stdout] --> src/y_2016/d_7.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | for _ in 2..inp.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (r, _) in (2..).zip((2..inp.len()))` [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: casting to the same type is unnecessary (`char` -> `char`) [INFO] [stdout] --> src/y_2016/d_7.rs:91:33 [INFO] [stdout] | [INFO] [stdout] 91 | let mut prev_char = ' ' as char; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `' '` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `tr` is used as a loop counter [INFO] [stdout] --> src/y_2016/d_7.rs:94:13 [INFO] [stdout] | [INFO] [stdout] 94 | for _ in 0..2 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using: `for (tr, _) in (r..).zip((0..2))` [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: you should consider adding a `Default` implementation for `Day7` [INFO] [stdout] --> src/y_2016/d_7.rs:204:5 [INFO] [stdout] | [INFO] [stdout] 204 | / pub fn new() -> Day7 { [INFO] [stdout] 205 | | Day7 { data: vec![] } [INFO] [stdout] 206 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 203 + impl Default for Day7 { [INFO] [stdout] 204 + fn default() -> Self { [INFO] [stdout] 205 + Self::new() [INFO] [stdout] 206 + } [INFO] [stdout] 207 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/y_2016/d_8.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | writeln!(f, "").expect("something went wrong while using the Display lol"); [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#writeln_empty_string [INFO] [stdout] = note: `#[warn(clippy::writeln_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/y_2016/d_8.rs:125:17 [INFO] [stdout] | [INFO] [stdout] 125 | cols.push('.'); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec!['.';SIZE]` [INFO] [stdout] = help: or `cols.extend(std::iter::repeat_n('.', SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `idy` is used as a loop counter [INFO] [stdout] --> src/y_2016/d_8.rs:160:21 [INFO] [stdout] | [INFO] [stdout] 160 | for row in &mut self.screen.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (idy, row) in self.screen.0.iter_mut().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: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/y_2016/d_8.rs:168:37 [INFO] [stdout] | [INFO] [stdout] 168 | for (idx, c) in (&self.screen.0[*pos as usize]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.screen.0[*pos as usize]` [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 should consider adding a `Default` implementation for `Day9` [INFO] [stdout] --> src/y_2016/d_9.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn new() -> Day9 { [INFO] [stdout] 43 | | Day9 { [INFO] [stdout] 44 | | data: String::new(), [INFO] [stdout] 45 | | } [INFO] [stdout] 46 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 41 + impl Default for Day9 { [INFO] [stdout] 42 + fn default() -> Self { [INFO] [stdout] 43 + Self::new() [INFO] [stdout] 44 + } [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2016/d_9.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | / return inp[..start_part].len() [INFO] [stdout] 66 | | + inp[end_part + 1..end_part + len + 1].len() * times [INFO] [stdout] 67 | | + Day9::decompressed_count_q1(&inp[end_part + 1 + 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] 65 ~ inp[..start_part].len() [INFO] [stdout] 66 + + inp[end_part + 1..end_part + len + 1].len() * times [INFO] [stdout] 67 ~ + Day9::decompressed_count_q1(&inp[end_part + 1 + len..]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2016/d_9.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | / return inp[..start_part].len() [INFO] [stdout] 88 | | + Day9::decompressed_count(&inp[end_part + 1..end_part + len + 1]) * times [INFO] [stdout] 89 | | + Day9::decompressed_count(&inp[end_part + 1 + 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] 87 ~ inp[..start_part].len() [INFO] [stdout] 88 + + Day9::decompressed_count(&inp[end_part + 1..end_part + len + 1]) * times [INFO] [stdout] 89 ~ + Day9::decompressed_count(&inp[end_part + 1 + len..]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2017/d_1.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 77 | / pub fn new() -> Day1 { [INFO] [stdout] 78 | | Day1 { inp: String::new() } [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 76 + impl Default for Day1 { [INFO] [stdout] 77 + fn default() -> Self { [INFO] [stdout] 78 + Self::new() [INFO] [stdout] 79 + } [INFO] [stdout] 80 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/y_2017/d_2.rs:19:27 [INFO] [stdout] | [INFO] [stdout] 19 | let v = v.trim().split_whitespace(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> src/y_2017/d_2.rs:53:25 [INFO] [stdout] | [INFO] [stdout] 53 | let e = e.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `e` [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: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2017/d_2.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | / pub fn new() -> Day2 { [INFO] [stdout] 75 | | Day2 { inp: vec![] } [INFO] [stdout] 76 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 73 + impl Default for Day2 { [INFO] [stdout] 74 + fn default() -> Self { [INFO] [stdout] 75 + Self::new() [INFO] [stdout] 76 + } [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/y_2022/d_1.rs:17:19 [INFO] [stdout] | [INFO] [stdout] 17 | let ans = (&self.inp.iter().take(3).sum::()).to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.inp.iter().take(3).sum::()` [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: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y_2022/d_1.rs:27:31 [INFO] [stdout] | [INFO] [stdout] 27 | let mut elves_input = input [INFO] [stdout] | _______________________________^ [INFO] [stdout] 28 | | .split("\n\n") [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] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 27 ~ let mut elves_input = input [INFO] [stdout] 28 + .split("\n\n") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2022/d_1.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | / pub fn new() -> Day1 { [INFO] [stdout] 53 | | Day1 { inp: vec![] } [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 51 + impl Default for Day1 { [INFO] [stdout] 52 + fn default() -> Self { [INFO] [stdout] 53 + Self::new() [INFO] [stdout] 54 + } [INFO] [stdout] 55 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(Pieces, Pieces)` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_2.rs:37:41 [INFO] [stdout] | [INFO] [stdout] 37 | let res = Day2::game_result(fight.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*fight` [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 `(Pieces, Pieces)` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_2.rs:52:42 [INFO] [stdout] | [INFO] [stdout] 52 | let res = Day2::me_to_result(fight.clone().1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `(*fight)` [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 `(Pieces, Pieces)` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_2.rs:53:60 [INFO] [stdout] | [INFO] [stdout] 53 | score += res as u32 + Day2::what_should_i_play(fight.clone().0, res) as u32; [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `(*fight)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2022/d_2.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | / pub fn new() -> Day2 { [INFO] [stdout] 82 | | Day2 { inp: vec![] } [INFO] [stdout] 83 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 80 + impl Default for Day2 { [INFO] [stdout] 81 + fn default() -> Self { [INFO] [stdout] 82 + Self::new() [INFO] [stdout] 83 + } [INFO] [stdout] 84 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_2.rs:114:17 [INFO] [stdout] | [INFO] [stdout] 114 | / return match opponent { [INFO] [stdout] 115 | | Pieces::Rock => Pieces::Scissors, [INFO] [stdout] 116 | | Pieces::Paper => Pieces::Rock, [INFO] [stdout] 117 | | Pieces::Scissors => Pieces::Scissors, [INFO] [stdout] 118 | | }; [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] 114 ~ match opponent { [INFO] [stdout] 115 + Pieces::Rock => Pieces::Scissors, [INFO] [stdout] 116 + Pieces::Paper => Pieces::Rock, [INFO] [stdout] 117 + Pieces::Scissors => Pieces::Scissors, [INFO] [stdout] 118 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_2.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | / return match opponent { [INFO] [stdout] 122 | | Pieces::Rock => Pieces::Paper, [INFO] [stdout] 123 | | Pieces::Paper => Pieces::Scissors, [INFO] [stdout] 124 | | Pieces::Scissors => Pieces::Rock, [INFO] [stdout] 125 | | }; [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] 121 ~ match opponent { [INFO] [stdout] 122 + Pieces::Rock => Pieces::Paper, [INFO] [stdout] 123 + Pieces::Paper => Pieces::Scissors, [INFO] [stdout] 124 + Pieces::Scissors => Pieces::Rock, [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_2.rs:128:17 [INFO] [stdout] | [INFO] [stdout] 128 | return opponent; [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] 128 - return opponent; [INFO] [stdout] 128 + opponent [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/y_2022/d_3.rs:16:22 [INFO] [stdout] | [INFO] [stdout] 16 | .map(|v| v.chars().into_iter().map(|j| j as u8).collect::>()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `v.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2022/d_3.rs:73:21 [INFO] [stdout] | [INFO] [stdout] 73 | / if line_num == 2 { [INFO] [stdout] 74 | | if v == 2 { [INFO] [stdout] 75 | | sum += Day3::fetch_value(c); [INFO] [stdout] ... | [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_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 73 ~ if line_num == 2 [INFO] [stdout] 74 ~ && v == 2 { [INFO] [stdout] 75 | sum += Day3::fetch_value(c); [INFO] [stdout] 76 | [INFO] [stdout] 77 | break; [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2022/d_3.rs:99:5 [INFO] [stdout] | [INFO] [stdout] 99 | / pub fn new() -> Day3 { [INFO] [stdout] 100 | | Day3 { inp: vec![] } [INFO] [stdout] 101 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 98 + impl Default for Day3 { [INFO] [stdout] 99 + fn default() -> Self { [INFO] [stdout] 100 + Self::new() [INFO] [stdout] 101 + } [INFO] [stdout] 102 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2022/d_3.rs:106:13 [INFO] [stdout] | [INFO] [stdout] 106 | c = c - 96; [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `c -= 96` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/y_2022/d_4.rs:20:21 [INFO] [stdout] | [INFO] [stdout] 20 | format!("(?P\\d+)-(?P\\d+),(?P\\d+)-(?P\\d+)").as_str(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(?P\\d+)-(?P\\d+),(?P\\d+)-(?P\\d+)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2022/d_4.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | / pub fn new() -> Day4 { [INFO] [stdout] 92 | | Day4 { inp: vec![] } [INFO] [stdout] 93 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 90 + impl Default for Day4 { [INFO] [stdout] 91 + fn default() -> Self { [INFO] [stdout] 92 + Self::new() [INFO] [stdout] 93 + } [INFO] [stdout] 94 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y_2022/d_6.rs:26:16 [INFO] [stdout] | [INFO] [stdout] 26 | if !(idx + 4 < self.inp.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(idx + 4 >= self.inp.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y_2022/d_6.rs:54:16 [INFO] [stdout] | [INFO] [stdout] 54 | if !(idx + 14 < self.inp.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(idx + 14 >= self.inp.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day6` [INFO] [stdout] --> src/y_2022/d_6.rs:79:5 [INFO] [stdout] | [INFO] [stdout] 79 | / pub fn new() -> Day6 { [INFO] [stdout] 80 | | Day6 { inp: vec![] } [INFO] [stdout] 81 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 78 + impl Default for Day6 { [INFO] [stdout] 79 + fn default() -> Self { [INFO] [stdout] 80 + Self::new() [INFO] [stdout] 81 + } [INFO] [stdout] 82 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/y_2022/d_7.rs:54:22 [INFO] [stdout] | [INFO] [stdout] 54 | .trim() [INFO] [stdout] | ______________________^ [INFO] [stdout] 55 | | .split_whitespace() [INFO] [stdout] | |_____________________^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/y_2022/d_7.rs:86:76 [INFO] [stdout] | [INFO] [stdout] 86 | format!("{}-{}", Day7::get_file_name(&path), res[1].to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2022/d_7.rs:104:12 [INFO] [stdout] | [INFO] [stdout] 104 | if files.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!files.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_7.rs:149:25 [INFO] [stdout] | [INFO] [stdout] 149 | let root_size = self.sizes.get("/").unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.sizes.get("/").unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2022/d_7.rs:164:13 [INFO] [stdout] | [INFO] [stdout] 164 | / if i + available_space >= required_space { [INFO] [stdout] 165 | | if smallest > i { [INFO] [stdout] 166 | | smallest = i; [INFO] [stdout] 167 | | } [INFO] [stdout] 168 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 164 ~ if i + available_space >= required_space [INFO] [stdout] 165 ~ && smallest > i { [INFO] [stdout] 166 | smallest = i; [INFO] [stdout] 167 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day7` [INFO] [stdout] --> src/y_2022/d_7.rs:180:5 [INFO] [stdout] | [INFO] [stdout] 180 | / pub fn new() -> Day7 { [INFO] [stdout] 181 | | Day7 { [INFO] [stdout] 182 | | inp: HashMap::new(), [INFO] [stdout] 183 | | sizes: HashMap::new(), [INFO] [stdout] 184 | | } [INFO] [stdout] 185 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 179 + impl Default for Day7 { [INFO] [stdout] 180 + fn default() -> Self { [INFO] [stdout] 181 + Self::new() [INFO] [stdout] 182 + } [INFO] [stdout] 183 + } [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/y_2022/d_7.rs:203:32 [INFO] [stdout] | [INFO] [stdout] 203 | pub fn get_file_name(path: &Vec) -> 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] 203 - pub fn get_file_name(path: &Vec) -> String { [INFO] [stdout] 203 + pub fn get_file_name(path: &[String]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2022/d_8.rs:146:17 [INFO] [stdout] | [INFO] [stdout] 146 | / if res.0 { [INFO] [stdout] 147 | | if res.1 > max_scenic_score_possible { [INFO] [stdout] 148 | | max_scenic_score_possible = res.1; [INFO] [stdout] 149 | | } [INFO] [stdout] 150 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if res.0 [INFO] [stdout] 147 ~ && res.1 > max_scenic_score_possible { [INFO] [stdout] 148 | max_scenic_score_possible = res.1; [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day8` [INFO] [stdout] --> src/y_2022/d_8.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | / pub fn new() -> Day8 { [INFO] [stdout] 164 | | Day8 { [INFO] [stdout] 165 | | inp: Forest::default(), [INFO] [stdout] 166 | | } [INFO] [stdout] 167 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 162 + impl Default for Day8 { [INFO] [stdout] 163 + fn default() -> Self { [INFO] [stdout] 164 + Self::new() [INFO] [stdout] 165 + } [INFO] [stdout] 166 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::SplitWhitespace<'_>` [INFO] [stdout] --> src/y_2022/d_9.rs:43:30 [INFO] [stdout] | [INFO] [stdout] 43 | let values = f.split_whitespace().into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `f.split_whitespace()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day9` [INFO] [stdout] --> src/y_2022/d_9.rs:129:5 [INFO] [stdout] | [INFO] [stdout] 129 | / pub fn new() -> Day9 { [INFO] [stdout] 130 | | // these constant values when added to `x` and `y` coords will give us the diagonals of that position [INFO] [stdout] 131 | | let diagonal_constants = vec![(1, 1), (1, -1), (-1, 1), (-1, -1)]; [INFO] [stdout] ... | [INFO] [stdout] 141 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 128 + impl Default for Day9 { [INFO] [stdout] 129 + fn default() -> Self { [INFO] [stdout] 130 + Self::new() [INFO] [stdout] 131 + } [INFO] [stdout] 132 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_9.rs:180:9 [INFO] [stdout] | [INFO] [stdout] 180 | return (tx, ty); [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] 180 - return (tx, ty); [INFO] [stdout] 180 + (tx, ty) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_9.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 204 - return false; [INFO] [stdout] 204 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ToDisplay` [INFO] [stdout] --> src/y_2022/d_10.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / pub fn new() -> Self { [INFO] [stdout] 10 | | Self(vec![vec![]]) [INFO] [stdout] 11 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 8 + impl Default for ToDisplay { [INFO] [stdout] 9 + fn default() -> Self { [INFO] [stdout] 10 + Self::new() [INFO] [stdout] 11 + } [INFO] [stdout] 12 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `println!` in `Display` impl [INFO] [stdout] --> src/y_2022/d_10.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | println!(); [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `writeln!(f, ..)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_in_format_impl [INFO] [stdout] = note: `#[warn(clippy::print_in_format_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/y_2022/d_10.rs:35:22 [INFO] [stdout] | [INFO] [stdout] 35 | let val = op.trim().split_whitespace().collect::>(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y_2022/d_10.rs:64:18 [INFO] [stdout] | [INFO] [stdout] 64 | .map(|v| ClockCircuit::new(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `ClockCircuit::new` [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: you should consider adding a `Default` implementation for `Day10` [INFO] [stdout] --> src/y_2022/d_10.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | / pub fn new() -> Day10 { [INFO] [stdout] 129 | | Day10 { [INFO] [stdout] 130 | | instructions: vec![], [INFO] [stdout] 131 | | } [INFO] [stdout] 132 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 127 + impl Default for Day10 { [INFO] [stdout] 128 + fn default() -> Self { [INFO] [stdout] 129 + Self::new() [INFO] [stdout] 130 + } [INFO] [stdout] 131 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/y_2022/d_10.rs:140:17 [INFO] [stdout] | [INFO] [stdout] 139 | let ans = *cycle * register; [INFO] [stdout] | ---------------------------- unnecessary `let` binding [INFO] [stdout] 140 | ans [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] 139 ~ [INFO] [stdout] 140 ~ *cycle * register [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y_2022/d_10.rs:152:27 [INFO] [stdout] | [INFO] [stdout] 152 | if range.contains(&cycle) { [INFO] [stdout] | ^^^^^^ help: change this to: `cycle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/y_2022/d_11.rs:84:16 [INFO] [stdout] | [INFO] [stdout] 84 | if after_bored % self.divisible_by == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `after_bored.is_multiple_of(self.divisible_by)` [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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2022/d_11.rs:91:21 [INFO] [stdout] | [INFO] [stdout] 91 | (to_return, values.len() as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `values.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/y_2022/d_11.rs:191:13 [INFO] [stdout] | [INFO] [stdout] 191 | monkeys_processed.push(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `monkeys_processed.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `fn(usize) -> usize {Day11::bored}` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_11.rs:198:77 [INFO] [stdout] | [INFO] [stdout] 198 | let results = ops.perform_ops(self.monkeys[monkey].clone(), bored.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `bored` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2022/d_11.rs:201:34 [INFO] [stdout] | [INFO] [stdout] 201 | self.monkeys[new_monkey as usize].push(new_value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `{ new_monkey }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/y_2022/d_11.rs:234:13 [INFO] [stdout] | [INFO] [stdout] 234 | monkeys_processed.push(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `monkeys_processed.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2022/d_11.rs:243:47 [INFO] [stdout] | [INFO] [stdout] 243 | let bored = |v: usize| -> usize { v % (val as usize) }; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `val` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `{closure@d_11.rs:243:21}` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_11.rs:247:77 [INFO] [stdout] | [INFO] [stdout] 247 | let results = ops.perform_ops(self.monkeys[monkey].clone(), bored.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `bored` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2022/d_11.rs:250:34 [INFO] [stdout] | [INFO] [stdout] 250 | self.monkeys[new_monkey as usize].push(new_value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `{ new_monkey }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y_2022/d_12.rs:2:33 [INFO] [stdout] | [INFO] [stdout] 2 | use std::{collections::HashSet, usize}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/y_2022/d_12.rs:20:27 [INFO] [stdout] | [INFO] [stdout] 20 | let start_point = 'S' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'S'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/y_2022/d_12.rs:21:25 [INFO] [stdout] | [INFO] [stdout] 21 | let end_point = 'E' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'E'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/y_2022/d_12.rs:36:30 [INFO] [stdout] | [INFO] [stdout] 36 | tmp.push('a' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/y_2022/d_12.rs:39:30 [INFO] [stdout] | [INFO] [stdout] 39 | tmp.push('z' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day12` [INFO] [stdout] --> src/y_2022/d_12.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | / pub fn new() -> Day12 { [INFO] [stdout] 87 | | Day12 { [INFO] [stdout] 88 | | end: (0, 0), [INFO] [stdout] 89 | | start: (0, 0), [INFO] [stdout] ... | [INFO] [stdout] 93 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 85 + impl Default for Day12 { [INFO] [stdout] 86 + fn default() -> Self { [INFO] [stdout] 87 + Self::new() [INFO] [stdout] 88 + } [INFO] [stdout] 89 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y_2022/d_12.rs:130:24 [INFO] [stdout] | [INFO] [stdout] 130 | if updated_val >= val && updated_val - val <= 1 || updated_val < val { [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] 130 - if updated_val >= val && updated_val - val <= 1 || updated_val < val { [INFO] [stdout] 130 + if !(updated_val >= val && updated_val - val > 1) { [INFO] [stdout] | [INFO] [stdout] 130 - if updated_val >= val && updated_val - val <= 1 || updated_val < val { [INFO] [stdout] 130 + if updated_val < val || updated_val - val <= 1 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2022/d_12.rs:104:15 [INFO] [stdout] | [INFO] [stdout] 104 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2023/d_1.rs:68:5 [INFO] [stdout] | [INFO] [stdout] 68 | / pub fn new() -> Day1 { [INFO] [stdout] 69 | | Day1 { data: vec![] } [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 67 + impl Default for Day1 { [INFO] [stdout] 68 + fn default() -> Self { [INFO] [stdout] 69 + Self::new() [INFO] [stdout] 70 + } [INFO] [stdout] 71 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2023/d_2.rs:133:5 [INFO] [stdout] | [INFO] [stdout] 133 | / pub fn new() -> Day2 { [INFO] [stdout] 134 | | Day2 { games: vec![] } [INFO] [stdout] 135 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 132 + impl Default for Day2 { [INFO] [stdout] 133 + fn default() -> Self { [INFO] [stdout] 134 + Self::new() [INFO] [stdout] 135 + } [INFO] [stdout] 136 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/y_2023/d_3.rs:68:40 [INFO] [stdout] | [INFO] [stdout] 68 | ... || (pos_val >= NUM_START_RANGE && pos_val <= NUM_END_RANGE)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(NUM_START_RANGE..=NUM_END_RANGE).contains(&pos_val)` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2023/d_3.rs:88:17 [INFO] [stdout] | [INFO] [stdout] 88 | / if jdx + 1 == vec.len() { [INFO] [stdout] 89 | | if is_part_number { [INFO] [stdout] 90 | | let n = std::str::from_utf8(num.as_slice()) [INFO] [stdout] 91 | | .expect("converting num slice to number") [INFO] [stdout] ... | [INFO] [stdout] 97 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 88 ~ if jdx + 1 == vec.len() [INFO] [stdout] 89 ~ && is_part_number { [INFO] [stdout] 90 | let n = std::str::from_utf8(num.as_slice()) [INFO] [stdout] ... [INFO] [stdout] 95 | sum += n; [INFO] [stdout] 96 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/y_2023/d_3.rs:129:32 [INFO] [stdout] | [INFO] [stdout] 129 | ... if nd >= NUM_START_RANGE && nd <= NUM_END_RANGE { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(NUM_START_RANGE..=NUM_END_RANGE).contains(&nd)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2023/d_3.rs:159:5 [INFO] [stdout] | [INFO] [stdout] 159 | / pub fn new() -> Day3 { [INFO] [stdout] 160 | | Day3 { [INFO] [stdout] 161 | | data: vec![], [INFO] [stdout] 162 | | all_side_constants: vec![], [INFO] [stdout] 163 | | } [INFO] [stdout] 164 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 158 + impl Default for Day3 { [INFO] [stdout] 159 + fn default() -> Self { [INFO] [stdout] 160 + Self::new() [INFO] [stdout] 161 + } [INFO] [stdout] 162 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y_2023/d_4.rs:82:62 [INFO] [stdout] | [INFO] [stdout] 82 | if scratchcard_info.winning_numbers.contains(&num) { [INFO] [stdout] | ^^^^ help: change this to: `num` [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/y_2023/d_4.rs:115:62 [INFO] [stdout] | [INFO] [stdout] 115 | if scratchcard_info.winning_numbers.contains(&num) { [INFO] [stdout] | ^^^^ help: change this to: `num` [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 should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2023/d_4.rs:147:5 [INFO] [stdout] | [INFO] [stdout] 147 | / pub fn new() -> Day4 { [INFO] [stdout] 148 | | Day4 { data: vec![] } [INFO] [stdout] 149 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 146 + impl Default for Day4 { [INFO] [stdout] 147 + fn default() -> Self { [INFO] [stdout] 148 + Self::new() [INFO] [stdout] 149 + } [INFO] [stdout] 150 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y_2023/d_5.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, isize}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `isize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2023/d_5.rs:54:15 [INFO] [stdout] | [INFO] [stdout] 54 | while ranges.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ranges.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/y_2023/d_5.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | / plants_info.seeds = data[0] [INFO] [stdout] 124 | | .split_once(":") [INFO] [stdout] 125 | | .expect("expect two parts to exist") [INFO] [stdout] 126 | | .1 [INFO] [stdout] ... | [INFO] [stdout] 129 | | .map(|n| n.trim().parse().expect("expected a number")) [INFO] [stdout] 130 | | .collect::>(); [INFO] [stdout] | |_____________________________________^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `y_2023::d_5::PlantsInfo { seeds: data[0] [INFO] [stdout] .split_once(":") [INFO] [stdout] .expect("expect two parts to exist") [INFO] [stdout] .1 [INFO] [stdout] .trim() [INFO] [stdout] .split(" ") [INFO] [stdout] .map(|n| n.trim().parse().expect("expected a number")) [INFO] [stdout] .collect::>(), seed_to_soil: Day5::parse_raw_data(data[1]), soil_to_fertilizer: Day5::parse_raw_data(data[2]), fertilizer_to_water: Day5::parse_raw_data(data[3]), water_to_light: Day5::parse_raw_data(data[4]), light_to_temperature: Day5::parse_raw_data(data[5]), temperature_to_humidity: Day5::parse_raw_data(data[6]), humidity_to_location: Day5::parse_raw_data(data[7]) }` and removing relevant reassignments [INFO] [stdout] --> src/y_2023/d_5.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | let mut plants_info = PlantsInfo::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: unnecessary map of the identity function [INFO] [stdout] --> src/y_2023/d_5.rs:118:42 [INFO] [stdout] | [INFO] [stdout] 118 | let data = contents.split("\n\n").map(|s| s).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/util.rs:6:41 [INFO] [stdout] | [INFO] [stdout] 6 | pub fn prompt_select(q: &str, items: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 6 - pub fn prompt_select(q: &str, items: &Vec) -> usize [INFO] [stdout] 6 + pub fn prompt_select(q: &str, items: &[T]) -> usize [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day5` [INFO] [stdout] --> src/y_2023/d_5.rs:215:5 [INFO] [stdout] | [INFO] [stdout] 215 | / pub fn new() -> Day5 { [INFO] [stdout] 216 | | Day5 { [INFO] [stdout] 217 | | data: Default::default(), [INFO] [stdout] 218 | | } [INFO] [stdout] 219 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 214 + impl Default for Day5 { [INFO] [stdout] 215 + fn default() -> Self { [INFO] [stdout] 216 + Self::new() [INFO] [stdout] 217 + } [INFO] [stdout] 218 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/util.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | / return Cow::Owned( [INFO] [stdout] 60 | | fs::read_to_string(path) [INFO] [stdout] 61 | | .expect("expected a valid file at the specified path but found none") [INFO] [stdout] 62 | | .trim() [INFO] [stdout] 63 | | .to_string(), [INFO] [stdout] 64 | | ); [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] 59 ~ Cow::Owned( [INFO] [stdout] 60 + fs::read_to_string(path) [INFO] [stdout] 61 + .expect("expected a valid file at the specified path but found none") [INFO] [stdout] 62 + .trim() [INFO] [stdout] 63 + .to_string(), [INFO] [stdout] 64 ~ ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2018/d_1.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 70 | / pub fn new() -> Day1 { [INFO] [stdout] 71 | | Day1 { data: vec![] } [INFO] [stdout] 72 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 69 + impl Default for Day1 { [INFO] [stdout] 70 + fn default() -> Self { [INFO] [stdout] 71 + Self::new() [INFO] [stdout] 72 + } [INFO] [stdout] 73 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2018/d_2.rs:118:5 [INFO] [stdout] | [INFO] [stdout] 118 | / pub fn new() -> Day2 { [INFO] [stdout] 119 | | Day2 { data: vec![] } [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 117 + impl Default for Day2 { [INFO] [stdout] 118 + fn default() -> Self { [INFO] [stdout] 119 + Self::new() [INFO] [stdout] 120 + } [INFO] [stdout] 121 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/y_2018/d_3.rs:6:11 [INFO] [stdout] | [INFO] [stdout] 6 | data: Vec<(usize, (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#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/util.rs:102:43 [INFO] [stdout] | [INFO] [stdout] 102 | let pattern = Regex::new(pattern).expect( [INFO] [stdout] | ___________________________________________^ [INFO] [stdout] 103 | | format!("error initializing regex parser with the given pattern - {pattern}").as_str(), [INFO] [stdout] 104 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("error initializing regex parser with the given pattern - {pattern}"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/y_2015/d_1.rs:9:19 [INFO] [stdout] | [INFO] [stdout] 9 | let ans = (&self.inp.iter().sum::()).to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.inp.iter().sum::()` [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: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2015/d_1.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | / pub fn new() -> Day1 { [INFO] [stdout] 59 | | Day1 { inp: vec![] } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 57 + impl Default for Day1 { [INFO] [stdout] 58 + fn default() -> Self { [INFO] [stdout] 59 + Self::new() [INFO] [stdout] 60 + } [INFO] [stdout] 61 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2018/d_3.rs:142:5 [INFO] [stdout] | [INFO] [stdout] 142 | / pub fn new() -> Day3 { [INFO] [stdout] 143 | | Day3 { data: vec![] } [INFO] [stdout] 144 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 141 + impl Default for Day3 { [INFO] [stdout] 142 + fn default() -> Self { [INFO] [stdout] 143 + Self::new() [INFO] [stdout] 144 + } [INFO] [stdout] 145 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_2.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | res = least_area + total + res; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `res += least_area + total` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2019/d_1.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / pub fn new() -> Day1 { [INFO] [stdout] 66 | | Day1 { data: vec![] } [INFO] [stdout] 67 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 64 + impl Default for Day1 { [INFO] [stdout] 65 + fn default() -> Self { [INFO] [stdout] 66 + Self::new() [INFO] [stdout] 67 + } [INFO] [stdout] 68 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_2.rs:64:13 [INFO] [stdout] | [INFO] [stdout] 64 | res = wrap + bow + res; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `res += wrap + bow` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2015/d_2.rs:76:5 [INFO] [stdout] | [INFO] [stdout] 76 | / pub fn new() -> Day2 { [INFO] [stdout] 77 | | Day2 { inp: vec![] } [INFO] [stdout] 78 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 75 + impl Default for Day2 { [INFO] [stdout] 76 + fn default() -> Self { [INFO] [stdout] 77 + Self::new() [INFO] [stdout] 78 + } [INFO] [stdout] 79 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_2.rs:99:13 [INFO] [stdout] | [INFO] [stdout] 99 | bow = bow * *a; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `bow *= *a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_2.rs:105:13 [INFO] [stdout] | [INFO] [stdout] 105 | wrap = wrap + (*v * 2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `wrap += (*v * 2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2019/d_2.rs:118:5 [INFO] [stdout] | [INFO] [stdout] 118 | / pub fn new() -> Day2 { [INFO] [stdout] 119 | | Day2 { data: vec![] } [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 117 + impl Default for Day2 { [INFO] [stdout] 118 + fn default() -> Self { [INFO] [stdout] 119 + Self::new() [INFO] [stdout] 120 + } [INFO] [stdout] 121 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y_2019/d_3.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | i32, vec, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y_2019/d_3.rs:49:26 [INFO] [stdout] | [INFO] [stdout] 49 | .map(|v| Vector::parse(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vector::parse` [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 `data.get(0)` [INFO] [stdout] --> src/y_2019/d_3.rs:54:23 [INFO] [stdout] | [INFO] [stdout] 54 | self.data.0 = data.get(0).expect("expected it to present").to_vec(); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `data.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: you should consider adding a `Default` implementation for `Record` [INFO] [stdout] --> src/y_2015/d_3.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn new() -> Self { [INFO] [stdout] 37 | | Record { [INFO] [stdout] 38 | | x: 0, [INFO] [stdout] 39 | | y: 0, [INFO] [stdout] ... | [INFO] [stdout] 42 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 35 + impl Default for Record { [INFO] [stdout] 36 + fn default() -> Self { [INFO] [stdout] 37 + Self::new() [INFO] [stdout] 38 + } [INFO] [stdout] 39 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/y_2015/d_3.rs:47:21 [INFO] [stdout] | [INFO] [stdout] 47 | None => 0 as usize, [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Record` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/y_2015/d_3.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_3.rs:59:31 [INFO] [stdout] | [INFO] [stdout] 59 | Compass::North => self.y = self.y + 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.y += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_3.rs:60:30 [INFO] [stdout] | [INFO] [stdout] 60 | Compass::East => self.x = self.x + 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.x += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_3.rs:61:31 [INFO] [stdout] | [INFO] [stdout] 61 | Compass::South => self.y = self.y - 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.y -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_3.rs:62:30 [INFO] [stdout] | [INFO] [stdout] 62 | Compass::West => self.x = self.x - 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.x -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y_2015/d_3.rs:84:18 [INFO] [stdout] | [INFO] [stdout] 84 | .map(|v| Compass::parse(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Compass::parse` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/y_2019/d_3.rs:138:28 [INFO] [stdout] | [INFO] [stdout] 138 | let distance = (overlap.0 - 0i32).abs() + (overlap.1 - 0i32).abs(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `overlap.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/y_2019/d_3.rs:138:55 [INFO] [stdout] | [INFO] [stdout] 138 | let distance = (overlap.0 - 0i32).abs() + (overlap.1 - 0i32).abs(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `overlap.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2019/d_3.rs:269:5 [INFO] [stdout] | [INFO] [stdout] 269 | / pub fn new() -> Day3 { [INFO] [stdout] 270 | | Day3 { [INFO] [stdout] 271 | | data: (vec![], vec![]), [INFO] [stdout] 272 | | } [INFO] [stdout] 273 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 268 + impl Default for Day3 { [INFO] [stdout] 269 + fn default() -> Self { [INFO] [stdout] 270 + Self::new() [INFO] [stdout] 271 + } [INFO] [stdout] 272 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y_2015/d_3.rs:79:20 [INFO] [stdout] | [INFO] [stdout] 79 | self.inp = contents [INFO] [stdout] | ____________________^ [INFO] [stdout] 80 | | .trim() [INFO] [stdout] 81 | | .split("") [INFO] [stdout] 82 | | .into_iter() [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 79 ~ self.inp = contents [INFO] [stdout] 80 + .trim() [INFO] [stdout] 81 + .split("") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2015/d_3.rs:135:5 [INFO] [stdout] | [INFO] [stdout] 135 | / pub fn new() -> Day3 { [INFO] [stdout] 136 | | Day3 { inp: vec![] } [INFO] [stdout] 137 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 134 + impl Default for Day3 { [INFO] [stdout] 135 + fn default() -> Self { [INFO] [stdout] 136 + Self::new() [INFO] [stdout] 137 + } [INFO] [stdout] 138 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2019/d_4.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / pub fn new() -> Day4 { [INFO] [stdout] 66 | | Day4 { min: 0, max: 0 } [INFO] [stdout] 67 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 64 + impl Default for Day4 { [INFO] [stdout] 65 + fn default() -> Self { [INFO] [stdout] 66 + Self::new() [INFO] [stdout] 67 + } [INFO] [stdout] 68 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2020/d_1.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | / pub fn new() -> Day1 { [INFO] [stdout] 98 | | Day1 { [INFO] [stdout] 99 | | data: vec![], [INFO] [stdout] 100 | | in_question: 2020, [INFO] [stdout] 101 | | } [INFO] [stdout] 102 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 96 + impl Default for Day1 { [INFO] [stdout] 97 + fn default() -> Self { [INFO] [stdout] 98 + Self::new() [INFO] [stdout] 99 + } [INFO] [stdout] 100 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2015/d_4.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / pub fn new() -> Day4 { [INFO] [stdout] 61 | | Day4 { inp: String::new() } [INFO] [stdout] 62 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 59 + impl Default for Day4 { [INFO] [stdout] 60 + fn default() -> Self { [INFO] [stdout] 61 + Self::new() [INFO] [stdout] 62 + } [INFO] [stdout] 63 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2020/d_2.rs:100:5 [INFO] [stdout] | [INFO] [stdout] 100 | / pub fn new() -> Day2 { [INFO] [stdout] 101 | | Day2 { data: vec![] } [INFO] [stdout] 102 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 99 + impl Default for Day2 { [INFO] [stdout] 100 + fn default() -> Self { [INFO] [stdout] 101 + Self::new() [INFO] [stdout] 102 + } [INFO] [stdout] 103 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2015/d_5.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / if self.rule_2 == State::Unknown && self.valid == State::Unknown { [INFO] [stdout] 53 | | if a == b { [INFO] [stdout] 54 | | self.rule_2 = State::Valid; [INFO] [stdout] 55 | | self.validate(); [INFO] [stdout] 56 | | } [INFO] [stdout] 57 | | } [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] 52 ~ if self.rule_2 == State::Unknown && self.valid == State::Unknown [INFO] [stdout] 53 ~ && a == b { [INFO] [stdout] 54 | self.rule_2 = State::Valid; [INFO] [stdout] 55 | self.validate(); [INFO] [stdout] 56 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2015/d_5.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | / if self.rule_3 == State::Unknown && self.valid == State::Unknown { [INFO] [stdout] 62 | | if a == b - 1 && vec![98, 100, 113, 121].contains(&(b as i32)) { [INFO] [stdout] 63 | | self.rule_3 = State::Invalid; [INFO] [stdout] 64 | | self.validate(); [INFO] [stdout] 65 | | } [INFO] [stdout] 66 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if self.rule_3 == State::Unknown && self.valid == State::Unknown [INFO] [stdout] 62 ~ && a == b - 1 && vec![98, 100, 113, 121].contains(&(b as i32)) { [INFO] [stdout] 63 | self.rule_3 = State::Invalid; [INFO] [stdout] 64 | self.validate(); [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2021/d_1.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | / pub fn new() -> Day1 { [INFO] [stdout] 73 | | Day1 { data: vec![] } [INFO] [stdout] 74 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 71 + impl Default for Day1 { [INFO] [stdout] 72 + fn default() -> Self { [INFO] [stdout] 73 + Self::new() [INFO] [stdout] 74 + } [INFO] [stdout] 75 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's values [INFO] [stdout] --> src/y_2015/d_5.rs:137:23 [INFO] [stdout] | [INFO] [stdout] 137 | for (_, v) in &self.rule_1_map { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 137 - for (_, v) in &self.rule_1_map { [INFO] [stdout] 137 + for v in self.rule_1_map.values() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2021/d_2.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | / pub fn new() -> Day2 { [INFO] [stdout] 85 | | Day2 { data: vec![] } [INFO] [stdout] 86 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 83 + impl Default for Day2 { [INFO] [stdout] 84 + fn default() -> Self { [INFO] [stdout] 85 + Self::new() [INFO] [stdout] 86 + } [INFO] [stdout] 87 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y_2024/d_1.rs:66:33 [INFO] [stdout] | [INFO] [stdout] 66 | if map.contains_key(&left) { [INFO] [stdout] | ^^^^^ help: change this to: `left` [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/y_2024/d_1.rs:67:39 [INFO] [stdout] | [INFO] [stdout] 67 | let mut val = map.get(&left).unwrap().clone(); [INFO] [stdout] | ^^^^^ help: change this to: `left` [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 should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2024/d_1.rs:114:5 [INFO] [stdout] | [INFO] [stdout] 114 | / pub fn new() -> Day1 { [INFO] [stdout] 115 | | Day1 { [INFO] [stdout] 116 | | left: vec![], [INFO] [stdout] 117 | | right: vec![], [INFO] [stdout] 118 | | } [INFO] [stdout] 119 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 113 + impl Default for Day1 { [INFO] [stdout] 114 + fn default() -> Self { [INFO] [stdout] 115 + Self::new() [INFO] [stdout] 116 + } [INFO] [stdout] 117 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day5` [INFO] [stdout] --> src/y_2015/d_5.rs:259:5 [INFO] [stdout] | [INFO] [stdout] 259 | / pub fn new() -> Day5 { [INFO] [stdout] 260 | | Day5 { [INFO] [stdout] 261 | | q1: vec![], [INFO] [stdout] 262 | | q2: vec![], [INFO] [stdout] 263 | | } [INFO] [stdout] 264 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 258 + impl Default for Day5 { [INFO] [stdout] 259 + fn default() -> Self { [INFO] [stdout] 260 + Self::new() [INFO] [stdout] 261 + } [INFO] [stdout] 262 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y_2015/d_2.rs:81:26 [INFO] [stdout] | [INFO] [stdout] 81 | let dimensions = vec![d.l * d.h, d.h * d.w, d.w * d.l]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[d.l * d.h, d.h * d.w, d.w * d.l]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y_2015/d_2.rs:94:30 [INFO] [stdout] | [INFO] [stdout] 94 | let mut dimensions = vec![d.l, d.h, d.w]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[d.l, d.h, d.w]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y_2015/d_5.rs:62:30 [INFO] [stdout] | [INFO] [stdout] 62 | if a == b - 1 && vec![98, 100, 113, 121].contains(&(b as i32)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[98, 100, 113, 121]` [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: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/util.rs:58:29 [INFO] [stdout] | [INFO] [stdout] 58 | pub fn read_from_file(path: &str) -> Cow { [INFO] [stdout] | ^^^^ ^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 58 | pub fn read_from_file(path: &str) -> Cow<'_, str> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day6` [INFO] [stdout] --> src/y_2015/d_6.rs:120:5 [INFO] [stdout] | [INFO] [stdout] 120 | / pub fn new() -> Day6 { [INFO] [stdout] 121 | | Day6 { [INFO] [stdout] 122 | | inp: vec![], [INFO] [stdout] 123 | | lights: vec![vec![0; 1000]; 1000], [INFO] [stdout] 124 | | } [INFO] [stdout] 125 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 119 + impl Default for Day6 { [INFO] [stdout] 120 + fn default() -> Self { [INFO] [stdout] 121 + Self::new() [INFO] [stdout] 122 + } [INFO] [stdout] 123 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/y_2015/d_7.rs:103:39 [INFO] [stdout] | [INFO] [stdout] 103 | .filter(|v| !v.is_empty()) [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 104 | | .map(|v| v) [INFO] [stdout] | |_______________________^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `inp` after checking its variant with `is_ok` [INFO] [stdout] --> src/y_2015/d_7.rs:145:61 [INFO] [stdout] | [INFO] [stdout] 144 | if inp.is_ok() { [INFO] [stdout] | -------------- help: try: `if let Ok() = inp` [INFO] [stdout] 145 | self.map.insert(output.to_string(), inp.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day7` [INFO] [stdout] --> src/y_2015/d_7.rs:203:5 [INFO] [stdout] | [INFO] [stdout] 203 | / pub fn new() -> Day7 { [INFO] [stdout] 204 | | Day7 { [INFO] [stdout] 205 | | data: HashMap::new(), [INFO] [stdout] 206 | | map: HashMap::new(), [INFO] [stdout] 207 | | } [INFO] [stdout] 208 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 202 + impl Default for Day7 { [INFO] [stdout] 203 + fn default() -> Self { [INFO] [stdout] 204 + Self::new() [INFO] [stdout] 205 + } [INFO] [stdout] 206 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y_2015/d_7.rs:220:38 [INFO] [stdout] | [INFO] [stdout] 220 | let val = &self.value_of(&inp); [INFO] [stdout] | ^^^^ help: change this to: `inp` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/y_2015/d_7.rs:223:40 [INFO] [stdout] | [INFO] [stdout] 223 | let res = (*v).op.operate(tmp).expect( [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 224 | | format!("2nd place expected a valid response for the operation but got this error") [INFO] [stdout] 225 | | .as_str(), [INFO] [stdout] 226 | | ); [INFO] [stdout] | |_________^ help: try: `unwrap_or_else(|_| panic!("2nd place expected a valid response for the operation but got this error"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/y_2015/d_7.rs:223:19 [INFO] [stdout] | [INFO] [stdout] 223 | let res = (*v).op.operate(tmp).expect( [INFO] [stdout] | ^^^^ help: try: `v` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/y_2015/d_7.rs:224:13 [INFO] [stdout] | [INFO] [stdout] 224 | format!("2nd place expected a valid response for the operation but got this error") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"2nd place expected a valid response for the operation but got this error".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/y_2015/d_7.rs:239:22 [INFO] [stdout] | [INFO] [stdout] 239 | .expect(format!("error trying to parse string to int {key}").as_str()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("error trying to parse string to int {key}"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/y_2015/d_8.rs:37:44 [INFO] [stdout] | [INFO] [stdout] 37 | let v = pattern.replace_all(v, format!("x")); [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using `.to_string()`: `"x".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day8` [INFO] [stdout] --> src/y_2015/d_8.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | / pub fn new() -> Day8 { [INFO] [stdout] 75 | | Day8 { inp: vec![] } [INFO] [stdout] 76 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 73 + impl Default for Day8 { [INFO] [stdout] 74 + fn default() -> Self { [INFO] [stdout] 75 + Self::new() [INFO] [stdout] 76 + } [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2015/d_9.rs:58:28 [INFO] [stdout] | [INFO] [stdout] 58 | let distance = captures.get_name_usize("distance") as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `captures.get_name_usize("distance")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2015/d_9.rs:75:33 [INFO] [stdout] | [INFO] [stdout] 75 | self.number_of_cities = unique_cities.len() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unique_cities.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day9` [INFO] [stdout] --> src/y_2015/d_9.rs:136:5 [INFO] [stdout] | [INFO] [stdout] 136 | / pub fn new() -> Day9 { [INFO] [stdout] 137 | | Day9 { [INFO] [stdout] 138 | | data: HashMap::new(), [INFO] [stdout] 139 | | distances_reference: HashMap::new(), [INFO] [stdout] ... | [INFO] [stdout] 142 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 135 + impl Default for Day9 { [INFO] [stdout] 136 + fn default() -> Self { [INFO] [stdout] 137 + Self::new() [INFO] [stdout] 138 + } [INFO] [stdout] 139 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/y_2015/d_9.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 161 | / if !self.distances_reference.contains_key(&key) { [INFO] [stdout] 162 | | self.distances_reference.insert(key, distance); [INFO] [stdout] 163 | | } [INFO] [stdout] | |_________^ help: try: `self.distances_reference.entry(key).or_insert(distance);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2015/d_9.rs:186:20 [INFO] [stdout] | [INFO] [stdout] 186 | if locations.len() as usize == self.number_of_cities { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `locations.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/y_2015/d_9.rs:196:13 [INFO] [stdout] | [INFO] [stdout] 196 | / match self.data.get(&location) { [INFO] [stdout] 197 | | Some(d) => { [INFO] [stdout] 198 | | self.navigate(d.clone(), locations, results); [INFO] [stdout] ... | [INFO] [stdout] 201 | | }; [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] 196 ~ if let Some(d) = self.data.get(&location) { [INFO] [stdout] 197 + self.navigate(d.clone(), locations, results); [INFO] [stdout] 198 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2015/d_10.rs:77:17 [INFO] [stdout] | [INFO] [stdout] 77 | / if idx > 0 { [INFO] [stdout] 78 | | if prev_char != *c { [INFO] [stdout] 79 | | tmp.extend(Day10::get_num_as_chars(char_sequence.len())); [INFO] [stdout] 80 | | tmp.push(char_sequence.chars().collect::>()[0]); [INFO] [stdout] ... | [INFO] [stdout] 84 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 77 ~ if idx > 0 [INFO] [stdout] 78 ~ && prev_char != *c { [INFO] [stdout] 79 | tmp.extend(Day10::get_num_as_chars(char_sequence.len())); [INFO] [stdout] ... [INFO] [stdout] 82 | char_sequence = String::new(); [INFO] [stdout] 83 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2015/d_11.rs:32:17 [INFO] [stdout] | [INFO] [stdout] 32 | self.password[last_index] = self.password[last_index] + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.password[last_index] += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2015/d_11.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | / if !first_rule && idx + 2 < self.password.len() { [INFO] [stdout] 52 | | if c + 1 == self.password[idx + 1] && c + 2 == self.password[idx + 2] { [INFO] [stdout] 53 | | first_rule = true; [INFO] [stdout] 54 | | } [INFO] [stdout] 55 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 51 ~ if !first_rule && idx + 2 < self.password.len() [INFO] [stdout] 52 ~ && c + 1 == self.password[idx + 1] && c + 2 == self.password[idx + 2] { [INFO] [stdout] 53 | first_rule = true; [INFO] [stdout] 54 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `y_2015::d_11::Password` [INFO] [stdout] --> src/y_2015/d_11.rs:73:5 [INFO] [stdout] | [INFO] [stdout] 73 | / pub fn to_string(&self) -> String { [INFO] [stdout] 74 | | str::from_utf8(&self.password).unwrap().to_string() [INFO] [stdout] 75 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `y_2015::d_11::Password` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `ans` [INFO] [stdout] --> src/y_2015/d_11.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | let ans = ans; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `ans` is initially defined here [INFO] [stdout] --> src/y_2015/d_11.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | let ans = self.new_password(); [INFO] [stdout] | ^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2015/d_12.rs:38:24 [INFO] [stdout] | [INFO] [stdout] 38 | if num_str.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!num_str.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: you should consider adding a `Default` implementation for `Day12` [INFO] [stdout] --> src/y_2015/d_12.rs:68:5 [INFO] [stdout] | [INFO] [stdout] 68 | / pub fn new() -> Day12 { [INFO] [stdout] 69 | | Day12 { inp: String::new() } [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 67 + impl Default for Day12 { [INFO] [stdout] 68 + fn default() -> Self { [INFO] [stdout] 69 + Self::new() [INFO] [stdout] 70 + } [INFO] [stdout] 71 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/y_2015/d_12.rs:92:28 [INFO] [stdout] | [INFO] [stdout] 92 | sum += match val.as_i64() { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 93 | | None => 0, [INFO] [stdout] 94 | | Some(i) => i, [INFO] [stdout] 95 | | }; [INFO] [stdout] | |_____________________^ help: ascribe the type i64 and replace your expression with: `val.as_i64().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/y_2015/d_12.rs:107:28 [INFO] [stdout] | [INFO] [stdout] 107 | sum += match j.as_i64() { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 108 | | None => 0, [INFO] [stdout] 109 | | Some(i) => i, [INFO] [stdout] 110 | | }; [INFO] [stdout] | |_____________________^ help: ascribe the type i64 and replace your expression with: `j.as_i64().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/y_2015/d_12.rs:120:20 [INFO] [stdout] | [INFO] [stdout] 120 | sum += match v.as_i64() { [INFO] [stdout] | ____________________^ [INFO] [stdout] 121 | | None => 0, [INFO] [stdout] 122 | | Some(i) => i, [INFO] [stdout] 123 | | }; [INFO] [stdout] | |_____________^ help: replace it with: `v.as_i64().unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y_2016/d_1.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | let num = d.split("L").into_iter().collect::>()[1].to_i32("L part"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `d.split("L")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y_2016/d_1.rs:17:23 [INFO] [stdout] | [INFO] [stdout] 17 | let num = d.split("R").into_iter().collect::>()[1].to_i32("R part"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `d.split("R")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: attempt to mutate range bound within loop [INFO] [stdout] --> src/y_2016/d_1.rs:174:25 [INFO] [stdout] | [INFO] [stdout] 174 | x = nx; [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: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2016/d_1.rs:203:5 [INFO] [stdout] | [INFO] [stdout] 203 | / pub fn new() -> Day1 { [INFO] [stdout] 204 | | Day1 { directions: vec![] } [INFO] [stdout] 205 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 202 + impl Default for Day1 { [INFO] [stdout] 203 + fn default() -> Self { [INFO] [stdout] 204 + Self::new() [INFO] [stdout] 205 + } [INFO] [stdout] 206 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y_2016/d_2.rs:44:26 [INFO] [stdout] | [INFO] [stdout] 44 | .map(|d| Direction::parse(d)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Direction::parse` [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: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2016/d_2.rs:156:5 [INFO] [stdout] | [INFO] [stdout] 156 | / pub fn new() -> Day2 { [INFO] [stdout] 157 | | Day2 { [INFO] [stdout] 158 | | data: vec![], [INFO] [stdout] 159 | | grid: vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]], [INFO] [stdout] ... | [INFO] [stdout] 168 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 155 + impl Default for Day2 { [INFO] [stdout] 156 + fn default() -> Self { [INFO] [stdout] 157 + Self::new() [INFO] [stdout] 158 + } [INFO] [stdout] 159 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2016/d_3.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / pub fn new() -> Day3 { [INFO] [stdout] 66 | | Day3 { data: vec![] } [INFO] [stdout] 67 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 64 + impl Default for Day3 { [INFO] [stdout] 65 + fn default() -> Self { [INFO] [stdout] 66 + Self::new() [INFO] [stdout] 67 + } [INFO] [stdout] 68 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2016/d_4.rs:153:5 [INFO] [stdout] | [INFO] [stdout] 153 | / pub fn new() -> Day4 { [INFO] [stdout] 154 | | Day4 { data: vec![] } [INFO] [stdout] 155 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 152 + impl Default for Day4 { [INFO] [stdout] 153 + fn default() -> Self { [INFO] [stdout] 154 + Self::new() [INFO] [stdout] 155 + } [INFO] [stdout] 156 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/y_2016/d_5.rs:25:39 [INFO] [stdout] | [INFO] [stdout] 25 | let digest = md5::compute(&format!("{}{}", self.word, count)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}{}", self.word, count)` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/y_2016/d_5.rs:62:39 [INFO] [stdout] | [INFO] [stdout] 62 | let digest = md5::compute(&format!("{}{}", self.word, count)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("{}{}", self.word, count)` [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: you should consider adding a `Default` implementation for `Day5` [INFO] [stdout] --> src/y_2016/d_5.rs:106:5 [INFO] [stdout] | [INFO] [stdout] 106 | / pub fn new() -> Day5 { [INFO] [stdout] 107 | | Day5 { [INFO] [stdout] 108 | | word: String::new(), [INFO] [stdout] 109 | | } [INFO] [stdout] 110 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 105 + impl Default for Day5 { [INFO] [stdout] 106 + fn default() -> Self { [INFO] [stdout] 107 + Self::new() [INFO] [stdout] 108 + } [INFO] [stdout] 109 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y_2016/d_6.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashMap, i32}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day6` [INFO] [stdout] --> src/y_2016/d_6.rs:118:5 [INFO] [stdout] | [INFO] [stdout] 118 | / pub fn new() -> Day6 { [INFO] [stdout] 119 | | Day6 { data: vec![] } [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 117 + impl Default for Day6 { [INFO] [stdout] 118 + fn default() -> Self { [INFO] [stdout] 119 + Self::new() [INFO] [stdout] 120 + } [INFO] [stdout] 121 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2016/d_7.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 40 | if hypernet_set.len() == 0 || supernet_set.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `hypernet_set.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2016/d_7.rs:40:39 [INFO] [stdout] | [INFO] [stdout] 40 | if hypernet_set.len() == 0 || supernet_set.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `supernet_set.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2016/d_7.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | return; [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 - } [INFO] [stdout] 71 - [INFO] [stdout] 72 - return; [INFO] [stdout] 70 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `l` is used as a loop counter [INFO] [stdout] --> src/y_2016/d_7.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | for _ in 2..inp.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (l, _) in (2..inp.len()).enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `r` is used as a loop counter [INFO] [stdout] --> src/y_2016/d_7.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | for _ in 2..inp.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (r, _) in (2..).zip((2..inp.len()))` [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: casting to the same type is unnecessary (`char` -> `char`) [INFO] [stdout] --> src/y_2016/d_7.rs:91:33 [INFO] [stdout] | [INFO] [stdout] 91 | let mut prev_char = ' ' as char; [INFO] [stdout] | ^^^^^^^^^^^ help: try: `' '` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `tr` is used as a loop counter [INFO] [stdout] --> src/y_2016/d_7.rs:94:13 [INFO] [stdout] | [INFO] [stdout] 94 | for _ in 0..2 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using: `for (tr, _) in (r..).zip((0..2))` [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: you should consider adding a `Default` implementation for `Day7` [INFO] [stdout] --> src/y_2016/d_7.rs:204:5 [INFO] [stdout] | [INFO] [stdout] 204 | / pub fn new() -> Day7 { [INFO] [stdout] 205 | | Day7 { data: vec![] } [INFO] [stdout] 206 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 203 + impl Default for Day7 { [INFO] [stdout] 204 + fn default() -> Self { [INFO] [stdout] 205 + Self::new() [INFO] [stdout] 206 + } [INFO] [stdout] 207 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/y_2016/d_8.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | writeln!(f, "").expect("something went wrong while using the Display lol"); [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#writeln_empty_string [INFO] [stdout] = note: `#[warn(clippy::writeln_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/y_2016/d_8.rs:125:17 [INFO] [stdout] | [INFO] [stdout] 125 | cols.push('.'); [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec!['.';SIZE]` [INFO] [stdout] = help: or `cols.extend(std::iter::repeat_n('.', SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `idy` is used as a loop counter [INFO] [stdout] --> src/y_2016/d_8.rs:160:21 [INFO] [stdout] | [INFO] [stdout] 160 | for row in &mut self.screen.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (idy, row) in self.screen.0.iter_mut().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: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/y_2016/d_8.rs:168:37 [INFO] [stdout] | [INFO] [stdout] 168 | for (idx, c) in (&self.screen.0[*pos as usize]).iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.screen.0[*pos as usize]` [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 should consider adding a `Default` implementation for `Day9` [INFO] [stdout] --> src/y_2016/d_9.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn new() -> Day9 { [INFO] [stdout] 43 | | Day9 { [INFO] [stdout] 44 | | data: String::new(), [INFO] [stdout] 45 | | } [INFO] [stdout] 46 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 41 + impl Default for Day9 { [INFO] [stdout] 42 + fn default() -> Self { [INFO] [stdout] 43 + Self::new() [INFO] [stdout] 44 + } [INFO] [stdout] 45 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2016/d_9.rs:65:9 [INFO] [stdout] | [INFO] [stdout] 65 | / return inp[..start_part].len() [INFO] [stdout] 66 | | + inp[end_part + 1..end_part + len + 1].len() * times [INFO] [stdout] 67 | | + Day9::decompressed_count_q1(&inp[end_part + 1 + 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] 65 ~ inp[..start_part].len() [INFO] [stdout] 66 + + inp[end_part + 1..end_part + len + 1].len() * times [INFO] [stdout] 67 ~ + Day9::decompressed_count_q1(&inp[end_part + 1 + len..]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2016/d_9.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | / return inp[..start_part].len() [INFO] [stdout] 88 | | + Day9::decompressed_count(&inp[end_part + 1..end_part + len + 1]) * times [INFO] [stdout] 89 | | + Day9::decompressed_count(&inp[end_part + 1 + 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] 87 ~ inp[..start_part].len() [INFO] [stdout] 88 + + Day9::decompressed_count(&inp[end_part + 1..end_part + len + 1]) * times [INFO] [stdout] 89 ~ + Day9::decompressed_count(&inp[end_part + 1 + len..]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2017/d_1.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 77 | / pub fn new() -> Day1 { [INFO] [stdout] 78 | | Day1 { inp: String::new() } [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 76 + impl Default for Day1 { [INFO] [stdout] 77 + fn default() -> Self { [INFO] [stdout] 78 + Self::new() [INFO] [stdout] 79 + } [INFO] [stdout] 80 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/y_2017/d_2.rs:19:27 [INFO] [stdout] | [INFO] [stdout] 19 | let v = v.trim().split_whitespace(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/main.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> src/y_2017/d_2.rs:53:25 [INFO] [stdout] | [INFO] [stdout] 53 | let e = e.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `e` [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: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2017/d_2.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | / pub fn new() -> Day2 { [INFO] [stdout] 75 | | Day2 { inp: vec![] } [INFO] [stdout] 76 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 73 + impl Default for Day2 { [INFO] [stdout] 74 + fn default() -> Self { [INFO] [stdout] 75 + Self::new() [INFO] [stdout] 76 + } [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/y_2022/d_1.rs:17:19 [INFO] [stdout] | [INFO] [stdout] 17 | let ans = (&self.inp.iter().take(3).sum::()).to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.inp.iter().take(3).sum::()` [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: useless conversion to the same type: `std::str::Split<'_, &str>` [INFO] [stdout] --> src/y_2022/d_1.rs:27:31 [INFO] [stdout] | [INFO] [stdout] 27 | let mut elves_input = input [INFO] [stdout] | _______________________________^ [INFO] [stdout] 28 | | .split("\n\n") [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] help: consider removing `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 27 ~ let mut elves_input = input [INFO] [stdout] 28 + .split("\n\n") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2022/d_1.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | / pub fn new() -> Day1 { [INFO] [stdout] 53 | | Day1 { inp: vec![] } [INFO] [stdout] 54 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 51 + impl Default for Day1 { [INFO] [stdout] 52 + fn default() -> Self { [INFO] [stdout] 53 + Self::new() [INFO] [stdout] 54 + } [INFO] [stdout] 55 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(Pieces, Pieces)` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_2.rs:37:41 [INFO] [stdout] | [INFO] [stdout] 37 | let res = Day2::game_result(fight.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*fight` [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 `(Pieces, Pieces)` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_2.rs:52:42 [INFO] [stdout] | [INFO] [stdout] 52 | let res = Day2::me_to_result(fight.clone().1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `(*fight)` [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 `(Pieces, Pieces)` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_2.rs:53:60 [INFO] [stdout] | [INFO] [stdout] 53 | score += res as u32 + Day2::what_should_i_play(fight.clone().0, res) as u32; [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `(*fight)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2022/d_2.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | / pub fn new() -> Day2 { [INFO] [stdout] 82 | | Day2 { inp: vec![] } [INFO] [stdout] 83 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 80 + impl Default for Day2 { [INFO] [stdout] 81 + fn default() -> Self { [INFO] [stdout] 82 + Self::new() [INFO] [stdout] 83 + } [INFO] [stdout] 84 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_2.rs:114:17 [INFO] [stdout] | [INFO] [stdout] 114 | / return match opponent { [INFO] [stdout] 115 | | Pieces::Rock => Pieces::Scissors, [INFO] [stdout] 116 | | Pieces::Paper => Pieces::Rock, [INFO] [stdout] 117 | | Pieces::Scissors => Pieces::Scissors, [INFO] [stdout] 118 | | }; [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] 114 ~ match opponent { [INFO] [stdout] 115 + Pieces::Rock => Pieces::Scissors, [INFO] [stdout] 116 + Pieces::Paper => Pieces::Rock, [INFO] [stdout] 117 + Pieces::Scissors => Pieces::Scissors, [INFO] [stdout] 118 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_2.rs:121:17 [INFO] [stdout] | [INFO] [stdout] 121 | / return match opponent { [INFO] [stdout] 122 | | Pieces::Rock => Pieces::Paper, [INFO] [stdout] 123 | | Pieces::Paper => Pieces::Scissors, [INFO] [stdout] 124 | | Pieces::Scissors => Pieces::Rock, [INFO] [stdout] 125 | | }; [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] 121 ~ match opponent { [INFO] [stdout] 122 + Pieces::Rock => Pieces::Paper, [INFO] [stdout] 123 + Pieces::Paper => Pieces::Scissors, [INFO] [stdout] 124 + Pieces::Scissors => Pieces::Rock, [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_2.rs:128:17 [INFO] [stdout] | [INFO] [stdout] 128 | return opponent; [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] 128 - return opponent; [INFO] [stdout] 128 + opponent [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::Chars<'_>` [INFO] [stdout] --> src/y_2022/d_3.rs:16:22 [INFO] [stdout] | [INFO] [stdout] 16 | .map(|v| v.chars().into_iter().map(|j| j as u8).collect::>()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `v.chars()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2022/d_3.rs:73:21 [INFO] [stdout] | [INFO] [stdout] 73 | / if line_num == 2 { [INFO] [stdout] 74 | | if v == 2 { [INFO] [stdout] 75 | | sum += Day3::fetch_value(c); [INFO] [stdout] ... | [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_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 73 ~ if line_num == 2 [INFO] [stdout] 74 ~ && v == 2 { [INFO] [stdout] 75 | sum += Day3::fetch_value(c); [INFO] [stdout] 76 | [INFO] [stdout] 77 | break; [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2022/d_3.rs:99:5 [INFO] [stdout] | [INFO] [stdout] 99 | / pub fn new() -> Day3 { [INFO] [stdout] 100 | | Day3 { inp: vec![] } [INFO] [stdout] 101 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 98 + impl Default for Day3 { [INFO] [stdout] 99 + fn default() -> Self { [INFO] [stdout] 100 + Self::new() [INFO] [stdout] 101 + } [INFO] [stdout] 102 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/y_2022/d_3.rs:106:13 [INFO] [stdout] | [INFO] [stdout] 106 | c = c - 96; [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `c -= 96` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/y_2022/d_4.rs:20:21 [INFO] [stdout] | [INFO] [stdout] 20 | format!("(?P\\d+)-(?P\\d+),(?P\\d+)-(?P\\d+)").as_str(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"(?P\\d+)-(?P\\d+),(?P\\d+)-(?P\\d+)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2022/d_4.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 91 | / pub fn new() -> Day4 { [INFO] [stdout] 92 | | Day4 { inp: vec![] } [INFO] [stdout] 93 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 90 + impl Default for Day4 { [INFO] [stdout] 91 + fn default() -> Self { [INFO] [stdout] 92 + Self::new() [INFO] [stdout] 93 + } [INFO] [stdout] 94 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y_2022/d_6.rs:26:16 [INFO] [stdout] | [INFO] [stdout] 26 | if !(idx + 4 < self.inp.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(idx + 4 >= self.inp.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit expression [INFO] [stdout] --> src/main.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | () [INFO] [stdout] | ^^ help: remove the final `()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y_2022/d_6.rs:54:16 [INFO] [stdout] | [INFO] [stdout] 54 | if !(idx + 14 < self.inp.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(idx + 14 >= self.inp.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day6` [INFO] [stdout] --> src/y_2022/d_6.rs:79:5 [INFO] [stdout] | [INFO] [stdout] 79 | / pub fn new() -> Day6 { [INFO] [stdout] 80 | | Day6 { inp: vec![] } [INFO] [stdout] 81 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 78 + impl Default for Day6 { [INFO] [stdout] 79 + fn default() -> Self { [INFO] [stdout] 80 + Self::new() [INFO] [stdout] 81 + } [INFO] [stdout] 82 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/y_2022/d_7.rs:54:22 [INFO] [stdout] | [INFO] [stdout] 54 | .trim() [INFO] [stdout] | ______________________^ [INFO] [stdout] 55 | | .split_whitespace() [INFO] [stdout] | |_____________________^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/y_2022/d_7.rs:86:76 [INFO] [stdout] | [INFO] [stdout] 86 | format!("{}-{}", Day7::get_file_name(&path), res[1].to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2022/d_7.rs:104:12 [INFO] [stdout] | [INFO] [stdout] 104 | if files.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!files.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_7.rs:149:25 [INFO] [stdout] | [INFO] [stdout] 149 | let root_size = self.sizes.get("/").unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.sizes.get("/").unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2022/d_7.rs:164:13 [INFO] [stdout] | [INFO] [stdout] 164 | / if i + available_space >= required_space { [INFO] [stdout] 165 | | if smallest > i { [INFO] [stdout] 166 | | smallest = i; [INFO] [stdout] 167 | | } [INFO] [stdout] 168 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 164 ~ if i + available_space >= required_space [INFO] [stdout] 165 ~ && smallest > i { [INFO] [stdout] 166 | smallest = i; [INFO] [stdout] 167 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day7` [INFO] [stdout] --> src/y_2022/d_7.rs:180:5 [INFO] [stdout] | [INFO] [stdout] 180 | / pub fn new() -> Day7 { [INFO] [stdout] 181 | | Day7 { [INFO] [stdout] 182 | | inp: HashMap::new(), [INFO] [stdout] 183 | | sizes: HashMap::new(), [INFO] [stdout] 184 | | } [INFO] [stdout] 185 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 179 + impl Default for Day7 { [INFO] [stdout] 180 + fn default() -> Self { [INFO] [stdout] 181 + Self::new() [INFO] [stdout] 182 + } [INFO] [stdout] 183 + } [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/y_2022/d_7.rs:203:32 [INFO] [stdout] | [INFO] [stdout] 203 | pub fn get_file_name(path: &Vec) -> 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] 203 - pub fn get_file_name(path: &Vec) -> String { [INFO] [stdout] 203 + pub fn get_file_name(path: &[String]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/backstage.rs:112:10 [INFO] [stdout] | [INFO] [stdout] 112 | .expect(&format!( [INFO] [stdout] | __________^ [INFO] [stdout] 113 | | "error trying to open the given file {file_name} to append" [INFO] [stdout] 114 | | )); [INFO] [stdout] | |__________^ help: try: `unwrap_or_else(|_| panic!("error trying to open the given file {file_name} to append"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/backstage.rs:116:42 [INFO] [stdout] | [INFO] [stdout] 116 | writeln!(file, "{}", text_to_append).expect(&format!( [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 117 | | "error trying to append the text to the given file" [INFO] [stdout] 118 | | )); [INFO] [stdout] | |______^ help: try: `unwrap_or_else(|_| panic!("error trying to append the text to the given file"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/backstage.rs:116:50 [INFO] [stdout] | [INFO] [stdout] 116 | writeln!(file, "{}", text_to_append).expect(&format!( [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 117 | | "error trying to append the text to the given file" [INFO] [stdout] 118 | | )); [INFO] [stdout] | |_____^ help: consider using `.to_string()`: `"error trying to append the text to the given file".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/backstage.rs:136:39 [INFO] [stdout] | [INFO] [stdout] 136 | fs::read_to_string(file_name).expect(&format!("error trying to open the file {file_name}")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("error trying to open the file {file_name}"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2022/d_8.rs:146:17 [INFO] [stdout] | [INFO] [stdout] 146 | / if res.0 { [INFO] [stdout] 147 | | if res.1 > max_scenic_score_possible { [INFO] [stdout] 148 | | max_scenic_score_possible = res.1; [INFO] [stdout] 149 | | } [INFO] [stdout] 150 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if res.0 [INFO] [stdout] 147 ~ && res.1 > max_scenic_score_possible { [INFO] [stdout] 148 | max_scenic_score_possible = res.1; [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day8` [INFO] [stdout] --> src/y_2022/d_8.rs:163:5 [INFO] [stdout] | [INFO] [stdout] 163 | / pub fn new() -> Day8 { [INFO] [stdout] 164 | | Day8 { [INFO] [stdout] 165 | | inp: Forest::default(), [INFO] [stdout] 166 | | } [INFO] [stdout] 167 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 162 + impl Default for Day8 { [INFO] [stdout] 163 + fn default() -> Self { [INFO] [stdout] 164 + Self::new() [INFO] [stdout] 165 + } [INFO] [stdout] 166 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::str::SplitWhitespace<'_>` [INFO] [stdout] --> src/y_2022/d_9.rs:43:30 [INFO] [stdout] | [INFO] [stdout] 43 | let values = f.split_whitespace().into_iter().collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `f.split_whitespace()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day9` [INFO] [stdout] --> src/y_2022/d_9.rs:129:5 [INFO] [stdout] | [INFO] [stdout] 129 | / pub fn new() -> Day9 { [INFO] [stdout] 130 | | // these constant values when added to `x` and `y` coords will give us the diagonals of that position [INFO] [stdout] 131 | | let diagonal_constants = vec![(1, 1), (1, -1), (-1, 1), (-1, -1)]; [INFO] [stdout] ... | [INFO] [stdout] 141 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 128 + impl Default for Day9 { [INFO] [stdout] 129 + fn default() -> Self { [INFO] [stdout] 130 + Self::new() [INFO] [stdout] 131 + } [INFO] [stdout] 132 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_9.rs:180:9 [INFO] [stdout] | [INFO] [stdout] 180 | return (tx, ty); [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] 180 - return (tx, ty); [INFO] [stdout] 180 + (tx, ty) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/y_2022/d_9.rs:204:9 [INFO] [stdout] | [INFO] [stdout] 204 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 204 - return false; [INFO] [stdout] 204 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ToDisplay` [INFO] [stdout] --> src/y_2022/d_10.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / pub fn new() -> Self { [INFO] [stdout] 10 | | Self(vec![vec![]]) [INFO] [stdout] 11 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 8 + impl Default for ToDisplay { [INFO] [stdout] 9 + fn default() -> Self { [INFO] [stdout] 10 + Self::new() [INFO] [stdout] 11 + } [INFO] [stdout] 12 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `println!` in `Display` impl [INFO] [stdout] --> src/y_2022/d_10.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | println!(); [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `writeln!(f, ..)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_in_format_impl [INFO] [stdout] = note: `#[warn(clippy::print_in_format_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> src/y_2022/d_10.rs:35:22 [INFO] [stdout] | [INFO] [stdout] 35 | let val = op.trim().split_whitespace().collect::>(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y_2022/d_10.rs:64:18 [INFO] [stdout] | [INFO] [stdout] 64 | .map(|v| ClockCircuit::new(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `ClockCircuit::new` [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: you should consider adding a `Default` implementation for `Day10` [INFO] [stdout] --> src/y_2022/d_10.rs:128:5 [INFO] [stdout] | [INFO] [stdout] 128 | / pub fn new() -> Day10 { [INFO] [stdout] 129 | | Day10 { [INFO] [stdout] 130 | | instructions: vec![], [INFO] [stdout] 131 | | } [INFO] [stdout] 132 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 127 + impl Default for Day10 { [INFO] [stdout] 128 + fn default() -> Self { [INFO] [stdout] 129 + Self::new() [INFO] [stdout] 130 + } [INFO] [stdout] 131 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/y_2022/d_10.rs:140:17 [INFO] [stdout] | [INFO] [stdout] 139 | let ans = *cycle * register; [INFO] [stdout] | ---------------------------- unnecessary `let` binding [INFO] [stdout] 140 | ans [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] 139 ~ [INFO] [stdout] 140 ~ *cycle * register [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y_2022/d_10.rs:152:27 [INFO] [stdout] | [INFO] [stdout] 152 | if range.contains(&cycle) { [INFO] [stdout] | ^^^^^^ help: change this to: `cycle` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/y_2022/d_11.rs:84:16 [INFO] [stdout] | [INFO] [stdout] 84 | if after_bored % self.divisible_by == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `after_bored.is_multiple_of(self.divisible_by)` [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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2022/d_11.rs:91:21 [INFO] [stdout] | [INFO] [stdout] 91 | (to_return, values.len() as usize) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `values.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/y_2022/d_11.rs:191:13 [INFO] [stdout] | [INFO] [stdout] 191 | monkeys_processed.push(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `monkeys_processed.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `fn(usize) -> usize {Day11::bored}` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_11.rs:198:77 [INFO] [stdout] | [INFO] [stdout] 198 | let results = ops.perform_ops(self.monkeys[monkey].clone(), bored.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `bored` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2022/d_11.rs:201:34 [INFO] [stdout] | [INFO] [stdout] 201 | self.monkeys[new_monkey as usize].push(new_value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `{ new_monkey }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/y_2022/d_11.rs:234:13 [INFO] [stdout] | [INFO] [stdout] 234 | monkeys_processed.push(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![0;SIZE]` [INFO] [stdout] = help: or `monkeys_processed.extend(std::iter::repeat_n(0, SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2022/d_11.rs:243:47 [INFO] [stdout] | [INFO] [stdout] 243 | let bored = |v: usize| -> usize { v % (val as usize) }; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `val` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `{closure@d_11.rs:243:21}` which implements the `Copy` trait [INFO] [stdout] --> src/y_2022/d_11.rs:247:77 [INFO] [stdout] | [INFO] [stdout] 247 | let results = ops.perform_ops(self.monkeys[monkey].clone(), bored.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `bored` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/y_2022/d_11.rs:250:34 [INFO] [stdout] | [INFO] [stdout] 250 | self.monkeys[new_monkey as usize].push(new_value); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `{ new_monkey }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y_2022/d_12.rs:2:33 [INFO] [stdout] | [INFO] [stdout] 2 | use std::{collections::HashSet, usize}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `usize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/y_2022/d_12.rs:20:27 [INFO] [stdout] | [INFO] [stdout] 20 | let start_point = 'S' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'S'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/y_2022/d_12.rs:21:25 [INFO] [stdout] | [INFO] [stdout] 21 | let end_point = 'E' as u8; [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'E'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/y_2022/d_12.rs:36:30 [INFO] [stdout] | [INFO] [stdout] 36 | tmp.push('a' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'a'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/y_2022/d_12.rs:39:30 [INFO] [stdout] | [INFO] [stdout] 39 | tmp.push('z' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'z'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day12` [INFO] [stdout] --> src/y_2022/d_12.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | / pub fn new() -> Day12 { [INFO] [stdout] 87 | | Day12 { [INFO] [stdout] 88 | | end: (0, 0), [INFO] [stdout] 89 | | start: (0, 0), [INFO] [stdout] ... | [INFO] [stdout] 93 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 85 + impl Default for Day12 { [INFO] [stdout] 86 + fn default() -> Self { [INFO] [stdout] 87 + Self::new() [INFO] [stdout] 88 + } [INFO] [stdout] 89 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/y_2022/d_12.rs:130:24 [INFO] [stdout] | [INFO] [stdout] 130 | if updated_val >= val && updated_val - val <= 1 || updated_val < val { [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] 130 - if updated_val >= val && updated_val - val <= 1 || updated_val < val { [INFO] [stdout] 130 + if !(updated_val >= val && updated_val - val > 1) { [INFO] [stdout] | [INFO] [stdout] 130 - if updated_val >= val && updated_val - val <= 1 || updated_val < val { [INFO] [stdout] 130 + if updated_val < val || updated_val - val <= 1 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2022/d_12.rs:104:15 [INFO] [stdout] | [INFO] [stdout] 104 | while queue.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!queue.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `args.year` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:67:16 [INFO] [stdout] | [INFO] [stdout] 66 | if args.year.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = args.year` [INFO] [stdout] 67 | year = args.year.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `args.day` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:73:15 [INFO] [stdout] | [INFO] [stdout] 72 | if args.day.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = args.day` [INFO] [stdout] 73 | day = args.day.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/main.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | let year; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `year` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 59 ~ [INFO] [stdout] 60 | let day; [INFO] [stdout] ... [INFO] [stdout] 65 | [INFO] [stdout] 66 ~ let year = if args.year.is_some() { [INFO] [stdout] 67 ~ args.year.unwrap() [INFO] [stdout] 68 | } else { [INFO] [stdout] 69 ~ years[prompt_select("Select the year", &years)] [INFO] [stdout] 70 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/main.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | let day; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `day` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 60 ~ [INFO] [stdout] 61 | [INFO] [stdout] ... [INFO] [stdout] 71 | [INFO] [stdout] 72 ~ let day = if args.day.is_some() { [INFO] [stdout] 73 ~ args.day.unwrap() [INFO] [stdout] 74 | } else { [INFO] [stdout] 75 ~ prompt("Type in the problem number", "1") [INFO] [stdout] 76 | .parse::() [INFO] [stdout] 77 ~ .expect("expected the day to be an integer") [INFO] [stdout] 78 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/backstage.rs:112:10 [INFO] [stdout] | [INFO] [stdout] 112 | .expect(&format!( [INFO] [stdout] | __________^ [INFO] [stdout] 113 | | "error trying to open the given file {file_name} to append" [INFO] [stdout] 114 | | )); [INFO] [stdout] | |__________^ help: try: `unwrap_or_else(|_| panic!("error trying to open the given file {file_name} to append"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/backstage.rs:116:42 [INFO] [stdout] | [INFO] [stdout] 116 | writeln!(file, "{}", text_to_append).expect(&format!( [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 117 | | "error trying to append the text to the given file" [INFO] [stdout] 118 | | )); [INFO] [stdout] | |______^ help: try: `unwrap_or_else(|_| panic!("error trying to append the text to the given file"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2023/d_1.rs:68:5 [INFO] [stdout] | [INFO] [stdout] 68 | / pub fn new() -> Day1 { [INFO] [stdout] 69 | | Day1 { data: vec![] } [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 67 + impl Default for Day1 { [INFO] [stdout] 68 + fn default() -> Self { [INFO] [stdout] 69 + Self::new() [INFO] [stdout] 70 + } [INFO] [stdout] 71 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/backstage.rs:116:50 [INFO] [stdout] | [INFO] [stdout] 116 | writeln!(file, "{}", text_to_append).expect(&format!( [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 117 | | "error trying to append the text to the given file" [INFO] [stdout] 118 | | )); [INFO] [stdout] | |_____^ help: consider using `.to_string()`: `"error trying to append the text to the given file".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/bin/backstage.rs:136:39 [INFO] [stdout] | [INFO] [stdout] 136 | fs::read_to_string(file_name).expect(&format!("error trying to open the file {file_name}")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|_| panic!("error trying to open the file {file_name}"))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2023/d_2.rs:133:5 [INFO] [stdout] | [INFO] [stdout] 133 | / pub fn new() -> Day2 { [INFO] [stdout] 134 | | Day2 { games: vec![] } [INFO] [stdout] 135 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 132 + impl Default for Day2 { [INFO] [stdout] 133 + fn default() -> Self { [INFO] [stdout] 134 + Self::new() [INFO] [stdout] 135 + } [INFO] [stdout] 136 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/y_2023/d_3.rs:68:40 [INFO] [stdout] | [INFO] [stdout] 68 | ... || (pos_val >= NUM_START_RANGE && pos_val <= NUM_END_RANGE)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(NUM_START_RANGE..=NUM_END_RANGE).contains(&pos_val)` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/y_2023/d_3.rs:88:17 [INFO] [stdout] | [INFO] [stdout] 88 | / if jdx + 1 == vec.len() { [INFO] [stdout] 89 | | if is_part_number { [INFO] [stdout] 90 | | let n = std::str::from_utf8(num.as_slice()) [INFO] [stdout] 91 | | .expect("converting num slice to number") [INFO] [stdout] ... | [INFO] [stdout] 97 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 88 ~ if jdx + 1 == vec.len() [INFO] [stdout] 89 ~ && is_part_number { [INFO] [stdout] 90 | let n = std::str::from_utf8(num.as_slice()) [INFO] [stdout] ... [INFO] [stdout] 95 | sum += n; [INFO] [stdout] 96 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/y_2023/d_3.rs:129:32 [INFO] [stdout] | [INFO] [stdout] 129 | ... if nd >= NUM_START_RANGE && nd <= NUM_END_RANGE { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(NUM_START_RANGE..=NUM_END_RANGE).contains(&nd)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2023/d_3.rs:159:5 [INFO] [stdout] | [INFO] [stdout] 159 | / pub fn new() -> Day3 { [INFO] [stdout] 160 | | Day3 { [INFO] [stdout] 161 | | data: vec![], [INFO] [stdout] 162 | | all_side_constants: vec![], [INFO] [stdout] 163 | | } [INFO] [stdout] 164 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 158 + impl Default for Day3 { [INFO] [stdout] 159 + fn default() -> Self { [INFO] [stdout] 160 + Self::new() [INFO] [stdout] 161 + } [INFO] [stdout] 162 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y_2023/d_4.rs:82:62 [INFO] [stdout] | [INFO] [stdout] 82 | if scratchcard_info.winning_numbers.contains(&num) { [INFO] [stdout] | ^^^^ help: change this to: `num` [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/y_2023/d_4.rs:115:62 [INFO] [stdout] | [INFO] [stdout] 115 | if scratchcard_info.winning_numbers.contains(&num) { [INFO] [stdout] | ^^^^ help: change this to: `num` [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 should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2023/d_4.rs:147:5 [INFO] [stdout] | [INFO] [stdout] 147 | / pub fn new() -> Day4 { [INFO] [stdout] 148 | | Day4 { data: vec![] } [INFO] [stdout] 149 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 146 + impl Default for Day4 { [INFO] [stdout] 147 + fn default() -> Self { [INFO] [stdout] 148 + Self::new() [INFO] [stdout] 149 + } [INFO] [stdout] 150 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y_2023/d_5.rs:1:33 [INFO] [stdout] | [INFO] [stdout] 1 | use std::{collections::HashSet, isize}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `isize::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/y_2023/d_5.rs:54:15 [INFO] [stdout] | [INFO] [stdout] 54 | while ranges.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!ranges.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/y_2023/d_5.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | / plants_info.seeds = data[0] [INFO] [stdout] 124 | | .split_once(":") [INFO] [stdout] 125 | | .expect("expect two parts to exist") [INFO] [stdout] 126 | | .1 [INFO] [stdout] ... | [INFO] [stdout] 129 | | .map(|n| n.trim().parse().expect("expected a number")) [INFO] [stdout] 130 | | .collect::>(); [INFO] [stdout] | |_____________________________________^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `y_2023::d_5::PlantsInfo { seeds: data[0] [INFO] [stdout] .split_once(":") [INFO] [stdout] .expect("expect two parts to exist") [INFO] [stdout] .1 [INFO] [stdout] .trim() [INFO] [stdout] .split(" ") [INFO] [stdout] .map(|n| n.trim().parse().expect("expected a number")) [INFO] [stdout] .collect::>(), seed_to_soil: Day5::parse_raw_data(data[1]), soil_to_fertilizer: Day5::parse_raw_data(data[2]), fertilizer_to_water: Day5::parse_raw_data(data[3]), water_to_light: Day5::parse_raw_data(data[4]), light_to_temperature: Day5::parse_raw_data(data[5]), temperature_to_humidity: Day5::parse_raw_data(data[6]), humidity_to_location: Day5::parse_raw_data(data[7]) }` and removing relevant reassignments [INFO] [stdout] --> src/y_2023/d_5.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | let mut plants_info = PlantsInfo::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: unnecessary map of the identity function [INFO] [stdout] --> src/y_2023/d_5.rs:118:42 [INFO] [stdout] | [INFO] [stdout] 118 | let data = contents.split("\n\n").map(|s| s).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day5` [INFO] [stdout] --> src/y_2023/d_5.rs:215:5 [INFO] [stdout] | [INFO] [stdout] 215 | / pub fn new() -> Day5 { [INFO] [stdout] 216 | | Day5 { [INFO] [stdout] 217 | | data: Default::default(), [INFO] [stdout] 218 | | } [INFO] [stdout] 219 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 214 + impl Default for Day5 { [INFO] [stdout] 215 + fn default() -> Self { [INFO] [stdout] 216 + Self::new() [INFO] [stdout] 217 + } [INFO] [stdout] 218 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2018/d_1.rs:70:5 [INFO] [stdout] | [INFO] [stdout] 70 | / pub fn new() -> Day1 { [INFO] [stdout] 71 | | Day1 { data: vec![] } [INFO] [stdout] 72 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 69 + impl Default for Day1 { [INFO] [stdout] 70 + fn default() -> Self { [INFO] [stdout] 71 + Self::new() [INFO] [stdout] 72 + } [INFO] [stdout] 73 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2018/d_2.rs:118:5 [INFO] [stdout] | [INFO] [stdout] 118 | / pub fn new() -> Day2 { [INFO] [stdout] 119 | | Day2 { data: vec![] } [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 117 + impl Default for Day2 { [INFO] [stdout] 118 + fn default() -> Self { [INFO] [stdout] 119 + Self::new() [INFO] [stdout] 120 + } [INFO] [stdout] 121 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/y_2018/d_3.rs:6:11 [INFO] [stdout] | [INFO] [stdout] 6 | data: Vec<(usize, (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#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2018/d_3.rs:142:5 [INFO] [stdout] | [INFO] [stdout] 142 | / pub fn new() -> Day3 { [INFO] [stdout] 143 | | Day3 { data: vec![] } [INFO] [stdout] 144 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 141 + impl Default for Day3 { [INFO] [stdout] 142 + fn default() -> Self { [INFO] [stdout] 143 + Self::new() [INFO] [stdout] 144 + } [INFO] [stdout] 145 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `args.year` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:67:16 [INFO] [stdout] | [INFO] [stdout] 66 | if args.year.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = args.year` [INFO] [stdout] 67 | year = args.year.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `args.day` after checking its variant with `is_some` [INFO] [stdout] --> src/main.rs:73:15 [INFO] [stdout] | [INFO] [stdout] 72 | if args.day.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = args.day` [INFO] [stdout] 73 | day = args.day.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/main.rs:59:5 [INFO] [stdout] | [INFO] [stdout] 59 | let year; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `year` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 59 ~ [INFO] [stdout] 60 | let day; [INFO] [stdout] ... [INFO] [stdout] 65 | [INFO] [stdout] 66 ~ let year = if args.year.is_some() { [INFO] [stdout] 67 ~ args.year.unwrap() [INFO] [stdout] 68 | } else { [INFO] [stdout] 69 ~ years[prompt_select("Select the year", &years)] [INFO] [stdout] 70 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/main.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | let day; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `day` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 60 ~ [INFO] [stdout] 61 | [INFO] [stdout] ... [INFO] [stdout] 71 | [INFO] [stdout] 72 ~ let day = if args.day.is_some() { [INFO] [stdout] 73 ~ args.day.unwrap() [INFO] [stdout] 74 | } else { [INFO] [stdout] 75 ~ prompt("Type in the problem number", "1") [INFO] [stdout] 76 | .parse::() [INFO] [stdout] 77 ~ .expect("expected the day to be an integer") [INFO] [stdout] 78 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2019/d_1.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / pub fn new() -> Day1 { [INFO] [stdout] 66 | | Day1 { data: vec![] } [INFO] [stdout] 67 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 64 + impl Default for Day1 { [INFO] [stdout] 65 + fn default() -> Self { [INFO] [stdout] 66 + Self::new() [INFO] [stdout] 67 + } [INFO] [stdout] 68 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2019/d_2.rs:118:5 [INFO] [stdout] | [INFO] [stdout] 118 | / pub fn new() -> Day2 { [INFO] [stdout] 119 | | Day2 { data: vec![] } [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 117 + impl Default for Day2 { [INFO] [stdout] 118 + fn default() -> Self { [INFO] [stdout] 119 + Self::new() [INFO] [stdout] 120 + } [INFO] [stdout] 121 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: importing legacy numeric constants [INFO] [stdout] --> src/y_2019/d_3.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | i32, vec, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/y_2019/d_3.rs:49:26 [INFO] [stdout] | [INFO] [stdout] 49 | .map(|v| Vector::parse(v)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vector::parse` [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 `data.get(0)` [INFO] [stdout] --> src/y_2019/d_3.rs:54:23 [INFO] [stdout] | [INFO] [stdout] 54 | self.data.0 = data.get(0).expect("expected it to present").to_vec(); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `data.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: this operation has no effect [INFO] [stdout] --> src/y_2019/d_3.rs:138:28 [INFO] [stdout] | [INFO] [stdout] 138 | let distance = (overlap.0 - 0i32).abs() + (overlap.1 - 0i32).abs(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `overlap.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/y_2019/d_3.rs:138:55 [INFO] [stdout] | [INFO] [stdout] 138 | let distance = (overlap.0 - 0i32).abs() + (overlap.1 - 0i32).abs(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `overlap.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day3` [INFO] [stdout] --> src/y_2019/d_3.rs:269:5 [INFO] [stdout] | [INFO] [stdout] 269 | / pub fn new() -> Day3 { [INFO] [stdout] 270 | | Day3 { [INFO] [stdout] 271 | | data: (vec![], vec![]), [INFO] [stdout] 272 | | } [INFO] [stdout] 273 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 268 + impl Default for Day3 { [INFO] [stdout] 269 + fn default() -> Self { [INFO] [stdout] 270 + Self::new() [INFO] [stdout] 271 + } [INFO] [stdout] 272 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day4` [INFO] [stdout] --> src/y_2019/d_4.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / pub fn new() -> Day4 { [INFO] [stdout] 66 | | Day4 { min: 0, max: 0 } [INFO] [stdout] 67 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 64 + impl Default for Day4 { [INFO] [stdout] 65 + fn default() -> Self { [INFO] [stdout] 66 + Self::new() [INFO] [stdout] 67 + } [INFO] [stdout] 68 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2020/d_1.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | / pub fn new() -> Day1 { [INFO] [stdout] 98 | | Day1 { [INFO] [stdout] 99 | | data: vec![], [INFO] [stdout] 100 | | in_question: 2020, [INFO] [stdout] 101 | | } [INFO] [stdout] 102 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 96 + impl Default for Day1 { [INFO] [stdout] 97 + fn default() -> Self { [INFO] [stdout] 98 + Self::new() [INFO] [stdout] 99 + } [INFO] [stdout] 100 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2020/d_2.rs:100:5 [INFO] [stdout] | [INFO] [stdout] 100 | / pub fn new() -> Day2 { [INFO] [stdout] 101 | | Day2 { data: vec![] } [INFO] [stdout] 102 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 99 + impl Default for Day2 { [INFO] [stdout] 100 + fn default() -> Self { [INFO] [stdout] 101 + Self::new() [INFO] [stdout] 102 + } [INFO] [stdout] 103 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2021/d_1.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | / pub fn new() -> Day1 { [INFO] [stdout] 73 | | Day1 { data: vec![] } [INFO] [stdout] 74 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 71 + impl Default for Day1 { [INFO] [stdout] 72 + fn default() -> Self { [INFO] [stdout] 73 + Self::new() [INFO] [stdout] 74 + } [INFO] [stdout] 75 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Day2` [INFO] [stdout] --> src/y_2021/d_2.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | / pub fn new() -> Day2 { [INFO] [stdout] 85 | | Day2 { data: vec![] } [INFO] [stdout] 86 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 83 + impl Default for Day2 { [INFO] [stdout] 84 + fn default() -> Self { [INFO] [stdout] 85 + Self::new() [INFO] [stdout] 86 + } [INFO] [stdout] 87 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/y_2024/d_1.rs:66:33 [INFO] [stdout] | [INFO] [stdout] 66 | if map.contains_key(&left) { [INFO] [stdout] | ^^^^^ help: change this to: `left` [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/y_2024/d_1.rs:67:39 [INFO] [stdout] | [INFO] [stdout] 67 | let mut val = map.get(&left).unwrap().clone(); [INFO] [stdout] | ^^^^^ help: change this to: `left` [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 should consider adding a `Default` implementation for `Day1` [INFO] [stdout] --> src/y_2024/d_1.rs:114:5 [INFO] [stdout] | [INFO] [stdout] 114 | / pub fn new() -> Day1 { [INFO] [stdout] 115 | | Day1 { [INFO] [stdout] 116 | | left: vec![], [INFO] [stdout] 117 | | right: vec![], [INFO] [stdout] 118 | | } [INFO] [stdout] 119 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 113 + impl Default for Day1 { [INFO] [stdout] 114 + fn default() -> Self { [INFO] [stdout] 115 + Self::new() [INFO] [stdout] 116 + } [INFO] [stdout] 117 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y_2015/d_2.rs:81:26 [INFO] [stdout] | [INFO] [stdout] 81 | let dimensions = vec![d.l * d.h, d.h * d.w, d.w * d.l]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[d.l * d.h, d.h * d.w, d.w * d.l]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y_2015/d_2.rs:94:30 [INFO] [stdout] | [INFO] [stdout] 94 | let mut dimensions = vec![d.l, d.h, d.w]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[d.l, d.h, d.w]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/y_2015/d_5.rs:62:30 [INFO] [stdout] | [INFO] [stdout] 62 | if a == b - 1 && vec![98, 100, 113, 121].contains(&(b as i32)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[98, 100, 113, 121]` [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: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/util.rs:58:29 [INFO] [stdout] | [INFO] [stdout] 58 | pub fn read_from_file(path: &str) -> Cow { [INFO] [stdout] | ^^^^ ^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 58 | pub fn read_from_file(path: &str) -> Cow<'_, str> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.38s [INFO] running `Command { std: "docker" "inspect" "d67b9c82dfdfbd7cc021810956f7c5150e653ddc29f977e3d5915ffe176c3e02", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d67b9c82dfdfbd7cc021810956f7c5150e653ddc29f977e3d5915ffe176c3e02", kill_on_drop: false }` [INFO] [stdout] d67b9c82dfdfbd7cc021810956f7c5150e653ddc29f977e3d5915ffe176c3e02