[INFO] cloning repository https://github.com/DoctorAkula/AOC2021 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/DoctorAkula/AOC2021" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDoctorAkula%2FAOC2021", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDoctorAkula%2FAOC2021'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 9f34ade59a5b34e7fa1c1cc265bfb8acdfcfa8cf [INFO] linting DoctorAkula/AOC2021 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FDoctorAkula%2FAOC2021" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/DoctorAkula/AOC2021 [INFO] finished tweaking git repo https://github.com/DoctorAkula/AOC2021 [INFO] tweaked toml for git repo https://github.com/DoctorAkula/AOC2021 written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/DoctorAkula/AOC2021 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/DoctorAkula/AOC2021 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] abe507c499d139b501da5da632692b7b144a9814a7bb1a031dfdae678346d99d [INFO] running `Command { std: "docker" "start" "-a" "abe507c499d139b501da5da632692b7b144a9814a7bb1a031dfdae678346d99d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "abe507c499d139b501da5da632692b7b144a9814a7bb1a031dfdae678346d99d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "abe507c499d139b501da5da632692b7b144a9814a7bb1a031dfdae678346d99d", kill_on_drop: false }` [INFO] [stdout] abe507c499d139b501da5da632692b7b144a9814a7bb1a031dfdae678346d99d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] d5c4e9738e6234f863a5c74ee36ebccf914b41a1200e4e3fcf4cc28faf186574 [INFO] running `Command { std: "docker" "start" "-a" "d5c4e9738e6234f863a5c74ee36ebccf914b41a1200e4e3fcf4cc28faf186574", kill_on_drop: false }` [INFO] [stderr] Checking aoc2021 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/loadinput.rs:6:40 [INFO] [stdout] | [INFO] [stdout] 6 | let source_file = match File::open(&filename) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [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: `to_string` applied to a type that implements `Display` in `eprintln!` args [INFO] [stdout] --> src/loadinput.rs:9:48 [INFO] [stdout] | [INFO] [stdout] 9 | eprintln!("cannot open file: {}", e.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: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day03.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | if line[ind] == '0' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [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/day03.rs:14:35 [INFO] [stdout] | [INFO] [stdout] 14 | }else if line[ind] == '1' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [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/day03.rs:34:29 [INFO] [stdout] | [INFO] [stdout] 34 | if line[ind] == '0' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [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/day03.rs:36:35 [INFO] [stdout] | [INFO] [stdout] 36 | }else if line[ind] == '1' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [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/day03.rs:42:13 [INFO] [stdout] | [INFO] [stdout] 42 | '1' as u8 [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [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/day03.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | '0' as u8 [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [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: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/day03.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / input_clone = input_clone.into_iter().filter(|line| { [INFO] [stdout] 48 | | let line = line.as_bytes(); [INFO] [stdout] 49 | | line[ind] == comp [INFO] [stdout] 50 | | }).collect(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] = note: `#[warn(clippy::manual_retain)]` on by default [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 47 ~ input_clone.retain(|line| { [INFO] [stdout] 48 + let line = line.as_bytes(); [INFO] [stdout] 49 + line[ind] == comp [INFO] [stdout] 50 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day04.rs:25:16 [INFO] [stdout] | [INFO] [stdout] 25 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day04.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day04.rs:100:16 [INFO] [stdout] | [INFO] [stdout] 100 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day04.rs:118:50 [INFO] [stdout] | [INFO] [stdout] 118 | if let Some(entry) = bingo_table.get(&bingo_call) { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `bingo_call` [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: empty string literal in `println!` [INFO] [stdout] --> src/day04.rs:175:5 [INFO] [stdout] | [INFO] [stdout] 175 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day05.rs:28:13 [INFO] [stdout] | [INFO] [stdout] 28 | return LineType::Vertical; [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] 28 - return LineType::Vertical; [INFO] [stdout] 28 + LineType::Vertical [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day05.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | return LineType::Horizontal; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return LineType::Horizontal; [INFO] [stdout] 30 + LineType::Horizontal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day05.rs:32:13 [INFO] [stdout] | [INFO] [stdout] 32 | return LineType::Diagonal; [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] 32 - return LineType::Diagonal; [INFO] [stdout] 32 + LineType::Diagonal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/day05.rs:67:31 [INFO] [stdout] | [INFO] [stdout] 67 | let val = sea_map.get(&Coord{x,y}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 67 - let val = sea_map.get(&Coord{x,y}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] 67 + let val = sea_map.get(&Coord{x,y}).or(Some(&0)).unwrap() + 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/day05.rs:80:31 [INFO] [stdout] | [INFO] [stdout] 80 | let val = sea_map.get(&Coord{x,y}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 80 - let val = sea_map.get(&Coord{x,y}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] 80 + let val = sea_map.get(&Coord{x,y}).or(Some(&0)).unwrap() + 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/day05.rs:111:23 [INFO] [stdout] | [INFO] [stdout] 111 | let val = sea_map.get(&Coord{x: x as isize,y: y as isize}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 111 - let val = sea_map.get(&Coord{x: x as isize,y: y as isize}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] 111 + let val = sea_map.get(&Coord{x: x as isize,y: y as isize}).or(Some(&0)).unwrap() + 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/day06.rs:68:56 [INFO] [stdout] | [INFO] [stdout] 68 | let fish_population : usize = fish_counters.iter().fold(0, |acc,val| acc + val); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/day08.rs:6:11 [INFO] [stdout] | [INFO] [stdout] 6 | (*val.split('|').last().unwrap()).to_string()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - (*val.split('|').last().unwrap()).to_string()).collect(); [INFO] [stdout] 6 + (*val.split('|').next_back().unwrap()).to_string()).collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day08.rs:97:17 [INFO] [stdout] | [INFO] [stdout] 97 | !(&known[3] == digit_sample) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&known[3] != digit_sample)` [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 `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | / if (x+1) < width { [INFO] [stdout] 18 | | if heightmap[y][x+1] <= *val { [INFO] [stdout] 19 | | continue; [INFO] [stdout] 20 | | } [INFO] [stdout] 21 | | } [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] 17 ~ if (x+1) < width [INFO] [stdout] 18 ~ && heightmap[y][x+1] <= *val { [INFO] [stdout] 19 | continue; [INFO] [stdout] 20 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:22:13 [INFO] [stdout] | [INFO] [stdout] 22 | / if (y+1) < height { [INFO] [stdout] 23 | | if heightmap[y+1][x] <= *val { [INFO] [stdout] 24 | | continue; [INFO] [stdout] 25 | | } [INFO] [stdout] 26 | | } [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] 22 ~ if (y+1) < height [INFO] [stdout] 23 ~ && heightmap[y+1][x] <= *val { [INFO] [stdout] 24 | continue; [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / if x > 0 { [INFO] [stdout] 28 | | if heightmap[y][x-1] <= *val { [INFO] [stdout] 29 | | continue; [INFO] [stdout] 30 | | } [INFO] [stdout] 31 | | } [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] 27 ~ if x > 0 [INFO] [stdout] 28 ~ && heightmap[y][x-1] <= *val { [INFO] [stdout] 29 | continue; [INFO] [stdout] 30 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:32:13 [INFO] [stdout] | [INFO] [stdout] 32 | / if y > 0 { [INFO] [stdout] 33 | | if heightmap[y-1][x] <= *val { [INFO] [stdout] 34 | | continue; [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if y > 0 [INFO] [stdout] 33 ~ && heightmap[y-1][x] <= *val { [INFO] [stdout] 34 | continue; [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/day09.rs:41:40 [INFO] [stdout] | [INFO] [stdout] 41 | let danger_sum = low_levels.iter().fold(0, |acc, val| acc + val); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day09.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return acc + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 67 - return acc + 1; [INFO] [stdout] 67 + acc + 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:83:13 [INFO] [stdout] | [INFO] [stdout] 83 | / if (x+1) < width { [INFO] [stdout] 84 | | if heightmap[y][x+1] <= *val { [INFO] [stdout] 85 | | continue; [INFO] [stdout] 86 | | } [INFO] [stdout] 87 | | } [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] 83 ~ if (x+1) < width [INFO] [stdout] 84 ~ && heightmap[y][x+1] <= *val { [INFO] [stdout] 85 | continue; [INFO] [stdout] 86 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:88:13 [INFO] [stdout] | [INFO] [stdout] 88 | / if (y+1) < height { [INFO] [stdout] 89 | | if heightmap[y+1][x] <= *val { [INFO] [stdout] 90 | | continue; [INFO] [stdout] 91 | | } [INFO] [stdout] 92 | | } [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 (y+1) < height [INFO] [stdout] 89 ~ && heightmap[y+1][x] <= *val { [INFO] [stdout] 90 | continue; [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | / if x > 0 { [INFO] [stdout] 94 | | if heightmap[y][x-1] <= *val { [INFO] [stdout] 95 | | continue; [INFO] [stdout] 96 | | } [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] 93 ~ if x > 0 [INFO] [stdout] 94 ~ && heightmap[y][x-1] <= *val { [INFO] [stdout] 95 | continue; [INFO] [stdout] 96 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:98:13 [INFO] [stdout] | [INFO] [stdout] 98 | / if y > 0 { [INFO] [stdout] 99 | | if heightmap[y-1][x] <= *val { [INFO] [stdout] 100 | | continue; [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#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 98 ~ if y > 0 [INFO] [stdout] 99 ~ && heightmap[y-1][x] <= *val { [INFO] [stdout] 100 | continue; [INFO] [stdout] 101 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/loadinput.rs:6:40 [INFO] [stdout] | [INFO] [stdout] 6 | let source_file = match File::open(&filename) { [INFO] [stdout] | ^^^^^^^^^ help: change this to: `filename` [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: `to_string` applied to a type that implements `Display` in `eprintln!` args [INFO] [stdout] --> src/loadinput.rs:9:48 [INFO] [stdout] | [INFO] [stdout] 9 | eprintln!("cannot open file: {}", e.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: the loop variable `y` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for y in 0..height { [INFO] [stdout] 21 + for in dumbo_map.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:22:22 [INFO] [stdout] | [INFO] [stdout] 22 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 22 - for x in 0..width { [INFO] [stdout] 22 + for in dumbo_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day03.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | if line[ind] == '0' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [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: the loop variable `y` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:53:18 [INFO] [stdout] | [INFO] [stdout] 53 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 53 - for y in 0..height { [INFO] [stdout] 53 + for in dumbo_map.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:54:22 [INFO] [stdout] | [INFO] [stdout] 54 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 54 - for x in 0..width { [INFO] [stdout] 54 + for in dumbo_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day03.rs:14:35 [INFO] [stdout] | [INFO] [stdout] 14 | }else if line[ind] == '1' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [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: the loop variable `y` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:81:18 [INFO] [stdout] | [INFO] [stdout] 81 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 81 - for y in 0..height { [INFO] [stdout] 81 + for in dumbo_map.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:82:22 [INFO] [stdout] | [INFO] [stdout] 82 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 82 - for x in 0..width { [INFO] [stdout] 82 + for in dumbo_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/day03.rs:34:29 [INFO] [stdout] | [INFO] [stdout] 34 | if line[ind] == '0' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [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/day03.rs:36:35 [INFO] [stdout] | [INFO] [stdout] 36 | }else if line[ind] == '1' as u8 { [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [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/day03.rs:42:13 [INFO] [stdout] | [INFO] [stdout] 42 | '1' as u8 [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'1'` [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/day03.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | '0' as u8 [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'0'` [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: this expression can be written more simply using `.retain()` [INFO] [stdout] --> src/day03.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | / input_clone = input_clone.into_iter().filter(|line| { [INFO] [stdout] 48 | | let line = line.as_bytes(); [INFO] [stdout] 49 | | line[ind] == comp [INFO] [stdout] 50 | | }).collect(); [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain [INFO] [stdout] = note: `#[warn(clippy::manual_retain)]` on by default [INFO] [stdout] help: consider calling `.retain()` instead [INFO] [stdout] | [INFO] [stdout] 47 ~ input_clone.retain(|line| { [INFO] [stdout] 48 + let line = line.as_bytes(); [INFO] [stdout] 49 + line[ind] == comp [INFO] [stdout] 50 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:117:18 [INFO] [stdout] | [INFO] [stdout] 117 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 117 - for y in 0..height { [INFO] [stdout] 117 + for in dumbo_map.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:118:22 [INFO] [stdout] | [INFO] [stdout] 118 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 118 - for x in 0..width { [INFO] [stdout] 118 + for in dumbo_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day04.rs:25:16 [INFO] [stdout] | [INFO] [stdout] 25 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day12.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | if connection.chars().nth(0).unwrap().is_uppercase() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `connection.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/day12.rs:30:20 [INFO] [stdout] | [INFO] [stdout] 30 | let last = iter.last().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 30 - let last = iter.last().unwrap(); [INFO] [stdout] 30 + let last = iter.next_back().unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> src/day12.rs:42:50 [INFO] [stdout] | [INFO] [stdout] 42 | let mut node_visits : HashMap<&str, usize> = graph_connections.iter().map(|(key, _val)| (*key, 0)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `graph_connections.keys().map(|key| (*key, 0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day12.rs:62:58 [INFO] [stdout] | [INFO] [stdout] 62 | multiple_visits |= node_visits[cur_node] >= 1 && cur_node.chars().nth(0).unwrap().is_lowercase(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `cur_node.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day12.rs:64:13 [INFO] [stdout] | [INFO] [stdout] 64 | if (connection.chars().nth(0).unwrap().is_uppercase() || [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `connection.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/day12.rs:81:20 [INFO] [stdout] | [INFO] [stdout] 81 | let last = iter.last().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 - let last = iter.last().unwrap(); [INFO] [stdout] 81 + let last = iter.next_back().unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day04.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> src/day12.rs:93:50 [INFO] [stdout] | [INFO] [stdout] 93 | let mut node_visits : HashMap<&str, usize> = graph_connections.iter().map(|(key, _val)| (*key, 0)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `graph_connections.keys().map(|key| (*key, 0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/day04.rs:100:16 [INFO] [stdout] | [INFO] [stdout] 100 | if line == "" { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13.rs:15:26 [INFO] [stdout] | [INFO] [stdout] 15 | fn print_map(paper_map : &Vec>, width : usize, height : 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] 15 - fn print_map(paper_map : &Vec>, width : usize, height : usize){ [INFO] [stdout] 15 + fn print_map(paper_map : &[Vec], width : usize, height : usize){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:16:14 [INFO] [stdout] | [INFO] [stdout] 16 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 16 - for y in 0..height { [INFO] [stdout] 16 + for in paper_map.iter().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:17:18 [INFO] [stdout] | [INFO] [stdout] 17 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 17 - for x in 0..width { [INFO] [stdout] 17 + for in paper_map.iter().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day04.rs:118:50 [INFO] [stdout] | [INFO] [stdout] 118 | if let Some(entry) = bingo_table.get(&bingo_call) { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `bingo_call` [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: empty string literal in `println!` [INFO] [stdout] --> src/day13.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13.rs:28:24 [INFO] [stdout] | [INFO] [stdout] 28 | fn fold_up(paper_map : &mut Vec>, width : usize, height : &mut usize, midpoint : usize){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 28 - fn fold_up(paper_map : &mut Vec>, width : usize, height : &mut usize, midpoint : usize){ [INFO] [stdout] 28 + fn fold_up(paper_map : &mut [Vec], width : usize, height : &mut usize, midpoint : usize){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:30:18 [INFO] [stdout] | [INFO] [stdout] 30 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 30 - for x in 0..width { [INFO] [stdout] 30 + for in paper_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13.rs:38:26 [INFO] [stdout] | [INFO] [stdout] 38 | fn fold_left(paper_map : &mut Vec>, width : &mut usize, height : usize, midpoint : usize){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn fold_left(paper_map : &mut Vec>, width : &mut usize, height : usize, midpoint : usize){ [INFO] [stdout] 38 + fn fold_left(paper_map : &mut [Vec], width : &mut usize, height : usize, midpoint : usize){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:39:14 [INFO] [stdout] | [INFO] [stdout] 39 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 39 - for y in 0..height { [INFO] [stdout] 39 + for in paper_map.iter_mut().take(height) { [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/day13.rs:48:33 [INFO] [stdout] | [INFO] [stdout] 48 | fn count_map_points(paper_map : &Vec>, width : usize, height : usize) -> usize{ [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 48 - fn count_map_points(paper_map : &Vec>, width : usize, height : usize) -> usize{ [INFO] [stdout] 48 + fn count_map_points(paper_map : &[Vec], width : usize, height : usize) -> usize{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:50:14 [INFO] [stdout] | [INFO] [stdout] 50 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 50 - for y in 0..height { [INFO] [stdout] 50 + for in paper_map.iter().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:51:18 [INFO] [stdout] | [INFO] [stdout] 51 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 51 - for x in 0..width { [INFO] [stdout] 51 + for in paper_map.iter().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day13.rs:67:16 [INFO] [stdout] | [INFO] [stdout] 67 | if line.len() == 0 { cord_mode = false; continue; } [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day04.rs:175:5 [INFO] [stdout] | [INFO] [stdout] 175 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day05.rs:28:13 [INFO] [stdout] | [INFO] [stdout] 28 | return LineType::Vertical; [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] 28 - return LineType::Vertical; [INFO] [stdout] 28 + LineType::Vertical [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day05.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | return LineType::Horizontal; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return LineType::Horizontal; [INFO] [stdout] 30 + LineType::Horizontal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day05.rs:32:13 [INFO] [stdout] | [INFO] [stdout] 32 | return LineType::Diagonal; [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] 32 - return LineType::Diagonal; [INFO] [stdout] 32 + LineType::Diagonal [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day13.rs:112:16 [INFO] [stdout] | [INFO] [stdout] 112 | if line.len() == 0 { cord_mode = false; continue; } [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/day05.rs:67:31 [INFO] [stdout] | [INFO] [stdout] 67 | let val = sea_map.get(&Coord{x,y}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 67 - let val = sea_map.get(&Coord{x,y}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] 67 + let val = sea_map.get(&Coord{x,y}).or(Some(&0)).unwrap() + 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/day05.rs:80:31 [INFO] [stdout] | [INFO] [stdout] 80 | let val = sea_map.get(&Coord{x,y}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 80 - let val = sea_map.get(&Coord{x,y}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] 80 + let val = sea_map.get(&Coord{x,y}).or(Some(&0)).unwrap() + 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/day14.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | element_inserts.sort_by(|a, b| a.index.cmp(&b.index)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 45 - element_inserts.sort_by(|a, b| a.index.cmp(&b.index)); [INFO] [stdout] 45 + element_inserts.sort_by_key(|a| a.index); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/day05.rs:111:23 [INFO] [stdout] | [INFO] [stdout] 111 | let val = sea_map.get(&Coord{x: x as isize,y: y as isize}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `or` instead [INFO] [stdout] | [INFO] [stdout] 111 - let val = sea_map.get(&Coord{x: x as isize,y: y as isize}).or_else(|| Some(&0)).unwrap() + 1; [INFO] [stdout] 111 + let val = sea_map.get(&Coord{x: x as isize,y: y as isize}).or(Some(&0)).unwrap() + 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/day14.rs:61:40 [INFO] [stdout] | [INFO] [stdout] 61 | let mut char_counts : Vec = char_counts.iter().map(|(_key, val)| *val).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `char_counts.values().map(|val| *val)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/day14.rs:97:33 [INFO] [stdout] | [INFO] [stdout] 97 | right_pair.push_str(&pair[1..2].to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&pair[1..2]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/day06.rs:68:56 [INFO] [stdout] | [INFO] [stdout] 68 | let fish_population : usize = fish_counters.iter().fold(0, |acc,val| acc + val); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day14.rs:119:22 [INFO] [stdout] | [INFO] [stdout] 119 | let letter = pair.chars().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `pair.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day14.rs:123:32 [INFO] [stdout] | [INFO] [stdout] 123 | char_counts.insert(letter.clone(), *occurrences); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `letter` [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: iterating on a map's values [INFO] [stdout] --> src/day14.rs:130:40 [INFO] [stdout] | [INFO] [stdout] 130 | let mut char_counts : Vec = char_counts.iter().map(|(_key, val)| *val).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `char_counts.values().map(|val| *val)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/day08.rs:6:11 [INFO] [stdout] | [INFO] [stdout] 6 | (*val.split('|').last().unwrap()).to_string()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - (*val.split('|').last().unwrap()).to_string()).collect(); [INFO] [stdout] 6 + (*val.split('|').next_back().unwrap()).to_string()).collect(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/day08.rs:97:17 [INFO] [stdout] | [INFO] [stdout] 97 | !(&known[3] == digit_sample) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&known[3] != digit_sample)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `smoly` is used to index `smol_edges` [INFO] [stdout] --> src/day15.rs:43:26 [INFO] [stdout] | [INFO] [stdout] 43 | for smoly in 0..smol_height { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 43 - for smoly in 0..smol_height { [INFO] [stdout] 43 + for (smoly, ) in smol_edges.iter().enumerate().take(smol_height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `smolx` is used to index `smol_edges` [INFO] [stdout] --> src/day15.rs:44:30 [INFO] [stdout] | [INFO] [stdout] 44 | for smolx in 0..smol_width { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 44 - for smolx in 0..smol_width { [INFO] [stdout] 44 + for (smolx, ) in smol_edges.iter().enumerate().take(smol_width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day16.rs:19:24 [INFO] [stdout] | [INFO] [stdout] 19 | fn len_id(bin_string : &String, index : usize) -> (OperatorType, usize) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 19 - fn len_id(bin_string : &String, index : usize) -> (OperatorType, usize) { [INFO] [stdout] 19 + fn len_id(bin_string : &str, index : usize) -> (OperatorType, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day16.rs:36:33 [INFO] [stdout] | [INFO] [stdout] 36 | fn parse_immediate(bin_string : &String, mut index : usize) -> (usize, usize) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 36 - fn parse_immediate(bin_string : &String, mut index : usize) -> (usize, usize) { [INFO] [stdout] 36 + fn parse_immediate(bin_string : &str, mut index : usize) -> (usize, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day16.rs:41:20 [INFO] [stdout] | [INFO] [stdout] 41 | let lead = nibble.chars().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `nibble.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:77:61 [INFO] [stdout] | [INFO] [stdout] 77 | let (sub_packet_count, next_index) = len_id(&bin_string, packet_index+3); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `bin_string` [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 `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | / if (x+1) < width { [INFO] [stdout] 18 | | if heightmap[y][x+1] <= *val { [INFO] [stdout] 19 | | continue; [INFO] [stdout] 20 | | } [INFO] [stdout] 21 | | } [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] 17 ~ if (x+1) < width [INFO] [stdout] 18 ~ && heightmap[y][x+1] <= *val { [INFO] [stdout] 19 | continue; [INFO] [stdout] 20 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:22:13 [INFO] [stdout] | [INFO] [stdout] 22 | / if (y+1) < height { [INFO] [stdout] 23 | | if heightmap[y+1][x] <= *val { [INFO] [stdout] 24 | | continue; [INFO] [stdout] 25 | | } [INFO] [stdout] 26 | | } [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] 22 ~ if (y+1) < height [INFO] [stdout] 23 ~ && heightmap[y+1][x] <= *val { [INFO] [stdout] 24 | continue; [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / if x > 0 { [INFO] [stdout] 28 | | if heightmap[y][x-1] <= *val { [INFO] [stdout] 29 | | continue; [INFO] [stdout] 30 | | } [INFO] [stdout] 31 | | } [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] 27 ~ if x > 0 [INFO] [stdout] 28 ~ && heightmap[y][x-1] <= *val { [INFO] [stdout] 29 | continue; [INFO] [stdout] 30 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:32:13 [INFO] [stdout] | [INFO] [stdout] 32 | / if y > 0 { [INFO] [stdout] 33 | | if heightmap[y-1][x] <= *val { [INFO] [stdout] 34 | | continue; [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if y > 0 [INFO] [stdout] 33 ~ && heightmap[y-1][x] <= *val { [INFO] [stdout] 34 | continue; [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> src/day09.rs:41:40 [INFO] [stdout] | [INFO] [stdout] 41 | let danger_sum = low_levels.iter().fold(0, |acc, val| acc + val); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `sum::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day16.rs:148:36 [INFO] [stdout] | [INFO] [stdout] 148 | fn create_bin_string(hexadecimal : &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 148 - fn create_bin_string(hexadecimal : &String) -> String { [INFO] [stdout] 148 + fn create_bin_string(hexadecimal : &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/day09.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return acc + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 67 - return acc + 1; [INFO] [stdout] 67 + acc + 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:83:13 [INFO] [stdout] | [INFO] [stdout] 83 | / if (x+1) < width { [INFO] [stdout] 84 | | if heightmap[y][x+1] <= *val { [INFO] [stdout] 85 | | continue; [INFO] [stdout] 86 | | } [INFO] [stdout] 87 | | } [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] 83 ~ if (x+1) < width [INFO] [stdout] 84 ~ && heightmap[y][x+1] <= *val { [INFO] [stdout] 85 | continue; [INFO] [stdout] 86 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:88:13 [INFO] [stdout] | [INFO] [stdout] 88 | / if (y+1) < height { [INFO] [stdout] 89 | | if heightmap[y+1][x] <= *val { [INFO] [stdout] 90 | | continue; [INFO] [stdout] 91 | | } [INFO] [stdout] 92 | | } [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 (y+1) < height [INFO] [stdout] 89 ~ && heightmap[y+1][x] <= *val { [INFO] [stdout] 90 | continue; [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | / if x > 0 { [INFO] [stdout] 94 | | if heightmap[y][x-1] <= *val { [INFO] [stdout] 95 | | continue; [INFO] [stdout] 96 | | } [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] 93 ~ if x > 0 [INFO] [stdout] 94 ~ && heightmap[y][x-1] <= *val { [INFO] [stdout] 95 | continue; [INFO] [stdout] 96 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/day09.rs:98:13 [INFO] [stdout] | [INFO] [stdout] 98 | / if y > 0 { [INFO] [stdout] 99 | | if heightmap[y-1][x] <= *val { [INFO] [stdout] 100 | | continue; [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#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 98 ~ if y > 0 [INFO] [stdout] 99 ~ && heightmap[y-1][x] <= *val { [INFO] [stdout] 100 | continue; [INFO] [stdout] 101 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for y in 0..height { [INFO] [stdout] 21 + for in dumbo_map.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:22:22 [INFO] [stdout] | [INFO] [stdout] 22 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 22 - for x in 0..width { [INFO] [stdout] 22 + for in dumbo_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/main.rs:68:8 [INFO] [stdout] | [INFO] [stdout] 68 | if (1 > day) || (day > 25) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=25).contains(&day)` [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: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/main.rs:74:8 [INFO] [stdout] | [INFO] [stdout] 74 | if (1 > problem) || (problem > 2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=2).contains(&problem)` [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: the loop variable `y` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:53:18 [INFO] [stdout] | [INFO] [stdout] 53 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 53 - for y in 0..height { [INFO] [stdout] 53 + for in dumbo_map.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:54:22 [INFO] [stdout] | [INFO] [stdout] 54 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 54 - for x in 0..width { [INFO] [stdout] 54 + for in dumbo_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:32:43 [INFO] [stdout] | [INFO] [stdout] 32 | graph_connections.insert(first.clone(), vec![last.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:32:62 [INFO] [stdout] | [INFO] [stdout] 32 | graph_connections.insert(first.clone(), vec![last.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:34:65 [INFO] [stdout] | [INFO] [stdout] 34 | graph_connections.get_mut(&first).unwrap().push(last.clone()); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:81:18 [INFO] [stdout] | [INFO] [stdout] 81 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 81 - for y in 0..height { [INFO] [stdout] 81 + for in dumbo_map.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:37:42 [INFO] [stdout] | [INFO] [stdout] 37 | graph_connections.insert(last.clone(), vec![first.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:37:62 [INFO] [stdout] | [INFO] [stdout] 37 | graph_connections.insert(last.clone(), vec![first.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:39:65 [INFO] [stdout] | [INFO] [stdout] 39 | graph_connections.get_mut(&last).unwrap().push(first.clone()); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:82:22 [INFO] [stdout] | [INFO] [stdout] 82 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 82 - for x in 0..width { [INFO] [stdout] 82 + for in dumbo_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:83:43 [INFO] [stdout] | [INFO] [stdout] 83 | graph_connections.insert(first.clone(), vec![last.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:83:62 [INFO] [stdout] | [INFO] [stdout] 83 | graph_connections.insert(first.clone(), vec![last.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:85:65 [INFO] [stdout] | [INFO] [stdout] 85 | graph_connections.get_mut(&first).unwrap().push(last.clone()); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:88:42 [INFO] [stdout] | [INFO] [stdout] 88 | graph_connections.insert(last.clone(), vec![first.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:88:62 [INFO] [stdout] | [INFO] [stdout] 88 | graph_connections.insert(last.clone(), vec![first.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:90:65 [INFO] [stdout] | [INFO] [stdout] 90 | graph_connections.get_mut(&last).unwrap().push(first.clone()); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:117:18 [INFO] [stdout] | [INFO] [stdout] 117 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 117 - for y in 0..height { [INFO] [stdout] 117 + for in dumbo_map.iter_mut().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `dumbo_map` [INFO] [stdout] --> src/day11.rs:118:22 [INFO] [stdout] | [INFO] [stdout] 118 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 118 - for x in 0..width { [INFO] [stdout] 118 + for in dumbo_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day12.rs:15:12 [INFO] [stdout] | [INFO] [stdout] 15 | if connection.chars().nth(0).unwrap().is_uppercase() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `connection.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/day12.rs:30:20 [INFO] [stdout] | [INFO] [stdout] 30 | let last = iter.last().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 30 - let last = iter.last().unwrap(); [INFO] [stdout] 30 + let last = iter.next_back().unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> src/day12.rs:42:50 [INFO] [stdout] | [INFO] [stdout] 42 | let mut node_visits : HashMap<&str, usize> = graph_connections.iter().map(|(key, _val)| (*key, 0)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `graph_connections.keys().map(|key| (*key, 0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day12.rs:62:58 [INFO] [stdout] | [INFO] [stdout] 62 | multiple_visits |= node_visits[cur_node] >= 1 && cur_node.chars().nth(0).unwrap().is_lowercase(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `cur_node.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day12.rs:64:13 [INFO] [stdout] | [INFO] [stdout] 64 | if (connection.chars().nth(0).unwrap().is_uppercase() || [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `connection.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/day12.rs:81:20 [INFO] [stdout] | [INFO] [stdout] 81 | let last = iter.last().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 - let last = iter.last().unwrap(); [INFO] [stdout] 81 + let last = iter.next_back().unwrap(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> src/day12.rs:93:50 [INFO] [stdout] | [INFO] [stdout] 93 | let mut node_visits : HashMap<&str, usize> = graph_connections.iter().map(|(key, _val)| (*key, 0)).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `graph_connections.keys().map(|key| (*key, 0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13.rs:15:26 [INFO] [stdout] | [INFO] [stdout] 15 | fn print_map(paper_map : &Vec>, width : usize, height : 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] 15 - fn print_map(paper_map : &Vec>, width : usize, height : usize){ [INFO] [stdout] 15 + fn print_map(paper_map : &[Vec], width : usize, height : usize){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:16:14 [INFO] [stdout] | [INFO] [stdout] 16 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 16 - for y in 0..height { [INFO] [stdout] 16 + for in paper_map.iter().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:17:18 [INFO] [stdout] | [INFO] [stdout] 17 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 17 - for x in 0..width { [INFO] [stdout] 17 + for in paper_map.iter().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/day13.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13.rs:28:24 [INFO] [stdout] | [INFO] [stdout] 28 | fn fold_up(paper_map : &mut Vec>, width : usize, height : &mut usize, midpoint : usize){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 28 - fn fold_up(paper_map : &mut Vec>, width : usize, height : &mut usize, midpoint : usize){ [INFO] [stdout] 28 + fn fold_up(paper_map : &mut [Vec], width : usize, height : &mut usize, midpoint : usize){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:30:18 [INFO] [stdout] | [INFO] [stdout] 30 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 30 - for x in 0..width { [INFO] [stdout] 30 + for in paper_map.iter_mut().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/day13.rs:38:26 [INFO] [stdout] | [INFO] [stdout] 38 | fn fold_left(paper_map : &mut Vec>, width : &mut usize, height : usize, midpoint : usize){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn fold_left(paper_map : &mut Vec>, width : &mut usize, height : usize, midpoint : usize){ [INFO] [stdout] 38 + fn fold_left(paper_map : &mut [Vec], width : &mut usize, height : usize, midpoint : usize){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:39:14 [INFO] [stdout] | [INFO] [stdout] 39 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 39 - for y in 0..height { [INFO] [stdout] 39 + for in paper_map.iter_mut().take(height) { [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/day13.rs:48:33 [INFO] [stdout] | [INFO] [stdout] 48 | fn count_map_points(paper_map : &Vec>, width : usize, height : usize) -> usize{ [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 48 - fn count_map_points(paper_map : &Vec>, width : usize, height : usize) -> usize{ [INFO] [stdout] 48 + fn count_map_points(paper_map : &[Vec], width : usize, height : usize) -> usize{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:50:14 [INFO] [stdout] | [INFO] [stdout] 50 | for y in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 50 - for y in 0..height { [INFO] [stdout] 50 + for in paper_map.iter().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `paper_map` [INFO] [stdout] --> src/day13.rs:51:18 [INFO] [stdout] | [INFO] [stdout] 51 | for x in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 51 - for x in 0..width { [INFO] [stdout] 51 + for in paper_map.iter().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day13.rs:67:16 [INFO] [stdout] | [INFO] [stdout] 67 | if line.len() == 0 { cord_mode = false; continue; } [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/day13.rs:112:16 [INFO] [stdout] | [INFO] [stdout] 112 | if line.len() == 0 { cord_mode = false; continue; } [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `line.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/day14.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | element_inserts.sort_by(|a, b| a.index.cmp(&b.index)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 45 - element_inserts.sort_by(|a, b| a.index.cmp(&b.index)); [INFO] [stdout] 45 + element_inserts.sort_by_key(|a| a.index); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> src/day14.rs:61:40 [INFO] [stdout] | [INFO] [stdout] 61 | let mut char_counts : Vec = char_counts.iter().map(|(_key, val)| *val).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `char_counts.values().map(|val| *val)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/day14.rs:97:33 [INFO] [stdout] | [INFO] [stdout] 97 | right_pair.push_str(&pair[1..2].to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use: `&pair[1..2]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day14.rs:119:22 [INFO] [stdout] | [INFO] [stdout] 119 | let letter = pair.chars().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `pair.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/day14.rs:123:32 [INFO] [stdout] | [INFO] [stdout] 123 | char_counts.insert(letter.clone(), *occurrences); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `letter` [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: iterating on a map's values [INFO] [stdout] --> src/day14.rs:130:40 [INFO] [stdout] | [INFO] [stdout] 130 | let mut char_counts : Vec = char_counts.iter().map(|(_key, val)| *val).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `char_counts.values().map(|val| *val)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `smoly` is used to index `smol_edges` [INFO] [stdout] --> src/day15.rs:43:26 [INFO] [stdout] | [INFO] [stdout] 43 | for smoly in 0..smol_height { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 43 - for smoly in 0..smol_height { [INFO] [stdout] 43 + for (smoly, ) in smol_edges.iter().enumerate().take(smol_height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `smolx` is used to index `smol_edges` [INFO] [stdout] --> src/day15.rs:44:30 [INFO] [stdout] | [INFO] [stdout] 44 | for smolx in 0..smol_width { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 44 - for smolx in 0..smol_width { [INFO] [stdout] 44 + for (smolx, ) in smol_edges.iter().enumerate().take(smol_width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day16.rs:19:24 [INFO] [stdout] | [INFO] [stdout] 19 | fn len_id(bin_string : &String, index : usize) -> (OperatorType, usize) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 19 - fn len_id(bin_string : &String, index : usize) -> (OperatorType, usize) { [INFO] [stdout] 19 + fn len_id(bin_string : &str, index : usize) -> (OperatorType, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day16.rs:36:33 [INFO] [stdout] | [INFO] [stdout] 36 | fn parse_immediate(bin_string : &String, mut index : usize) -> (usize, usize) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 36 - fn parse_immediate(bin_string : &String, mut index : usize) -> (usize, usize) { [INFO] [stdout] 36 + fn parse_immediate(bin_string : &str, mut index : usize) -> (usize, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/day16.rs:41:20 [INFO] [stdout] | [INFO] [stdout] 41 | let lead = nibble.chars().nth(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `nibble.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/day16.rs:77:61 [INFO] [stdout] | [INFO] [stdout] 77 | let (sub_packet_count, next_index) = len_id(&bin_string, packet_index+3); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `bin_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/day16.rs:148:36 [INFO] [stdout] | [INFO] [stdout] 148 | fn create_bin_string(hexadecimal : &String) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 148 - fn create_bin_string(hexadecimal : &String) -> String { [INFO] [stdout] 148 + fn create_bin_string(hexadecimal : &str) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/main.rs:68:8 [INFO] [stdout] | [INFO] [stdout] 68 | if (1 > day) || (day > 25) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=25).contains(&day)` [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: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/main.rs:74:8 [INFO] [stdout] | [INFO] [stdout] 74 | if (1 > problem) || (problem > 2) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=2).contains(&problem)` [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: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:32:43 [INFO] [stdout] | [INFO] [stdout] 32 | graph_connections.insert(first.clone(), vec![last.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] = note: `#[warn(noop_method_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:32:62 [INFO] [stdout] | [INFO] [stdout] 32 | graph_connections.insert(first.clone(), vec![last.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:34:65 [INFO] [stdout] | [INFO] [stdout] 34 | graph_connections.get_mut(&first).unwrap().push(last.clone()); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:37:42 [INFO] [stdout] | [INFO] [stdout] 37 | graph_connections.insert(last.clone(), vec![first.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:37:62 [INFO] [stdout] | [INFO] [stdout] 37 | graph_connections.insert(last.clone(), vec![first.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:39:65 [INFO] [stdout] | [INFO] [stdout] 39 | graph_connections.get_mut(&last).unwrap().push(first.clone()); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:83:43 [INFO] [stdout] | [INFO] [stdout] 83 | graph_connections.insert(first.clone(), vec![last.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:83:62 [INFO] [stdout] | [INFO] [stdout] 83 | graph_connections.insert(first.clone(), vec![last.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:85:65 [INFO] [stdout] | [INFO] [stdout] 85 | graph_connections.get_mut(&first).unwrap().push(last.clone()); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:88:42 [INFO] [stdout] | [INFO] [stdout] 88 | graph_connections.insert(last.clone(), vec![first.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:88:62 [INFO] [stdout] | [INFO] [stdout] 88 | graph_connections.insert(last.clone(), vec![first.clone()]); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `.clone()` on a reference in this situation does nothing [INFO] [stdout] --> src/day12.rs:90:65 [INFO] [stdout] | [INFO] [stdout] 90 | graph_connections.get_mut(&last).unwrap().push(first.clone()); [INFO] [stdout] | ^^^^^^^^ help: remove this redundant call [INFO] [stdout] | [INFO] [stdout] = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.80s [INFO] running `Command { std: "docker" "inspect" "d5c4e9738e6234f863a5c74ee36ebccf914b41a1200e4e3fcf4cc28faf186574", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d5c4e9738e6234f863a5c74ee36ebccf914b41a1200e4e3fcf4cc28faf186574", kill_on_drop: false }` [INFO] [stdout] d5c4e9738e6234f863a5c74ee36ebccf914b41a1200e4e3fcf4cc28faf186574