[INFO] cloning repository https://github.com/aopal/aoc-2022-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/aopal/aoc-2022-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faopal%2Faoc-2022-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faopal%2Faoc-2022-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 1d585a726244167b78fd958991de09eeadd072fa [INFO] linting aopal/aoc-2022-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faopal%2Faoc-2022-rust" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-1-tc1/source/.cargo/config [INFO] started tweaking git repo https://github.com/aopal/aoc-2022-rust [INFO] finished tweaking git repo https://github.com/aopal/aoc-2022-rust [INFO] tweaked toml for git repo https://github.com/aopal/aoc-2022-rust written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/aopal/aoc-2022-rust on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/aopal/aoc-2022-rust already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded colored v2.0.0 [INFO] [stderr] Downloaded priority-queue v1.3.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 735ac8010b6551e0c4da50ec16451e8f7fbf20cf5f4ee6119c3e5f2ebb75c86d [INFO] running `Command { std: "docker" "start" "-a" "735ac8010b6551e0c4da50ec16451e8f7fbf20cf5f4ee6119c3e5f2ebb75c86d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "735ac8010b6551e0c4da50ec16451e8f7fbf20cf5f4ee6119c3e5f2ebb75c86d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "735ac8010b6551e0c4da50ec16451e8f7fbf20cf5f4ee6119c3e5f2ebb75c86d", kill_on_drop: false }` [INFO] [stdout] 735ac8010b6551e0c4da50ec16451e8f7fbf20cf5f4ee6119c3e5f2ebb75c86d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] c713e5590191ff72203e46d85ec51af3e959debea06a2ecec6ef08f3e0561cb2 [INFO] running `Command { std: "docker" "start" "-a" "c713e5590191ff72203e46d85ec51af3e959debea06a2ecec6ef08f3e0561cb2", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.138 [INFO] [stderr] Compiling num-integer v0.1.45 [INFO] [stderr] Compiling num-bigint v0.4.3 [INFO] [stderr] Compiling priority-queue v1.3.0 [INFO] [stderr] Checking pico-args v0.5.0 [INFO] [stderr] Checking regex v1.7.0 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking colored v2.0.0 [INFO] [stderr] Checking advent_of_code v0.8.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/05.rs:194:13 [INFO] [stdout] | [INFO] [stdout] 194 | n: n, [INFO] [stdout] | ^^^^ help: replace it with: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/bin/scaffold.rs:53:36 [INFO] [stdout] | [INFO] [stdout] 53 | OpenOptions::new().write(true).create(true).open(path) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `max_elf` is assigned to, but never used [INFO] [stdout] --> src/bin/01.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let mut max_elf: u32 = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_max_elf` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `max_elf` is never read [INFO] [stdout] --> src/bin/01.rs:16:13 [INFO] [stdout] | [INFO] [stdout] 16 | max_elf = i [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `source_dists` [INFO] [stdout] --> src/bin/12.rs:129:9 [INFO] [stdout] | [INFO] [stdout] 129 | let source_dists = dijkstra(&graph, source); [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_source_dists` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `min_source` is assigned to, but never used [INFO] [stdout] --> src/bin/12.rs:132:9 [INFO] [stdout] | [INFO] [stdout] 132 | let mut min_source: (usize, usize) = (0,0); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_min_source` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `min_source` is never read [INFO] [stdout] --> src/bin/12.rs:144:17 [INFO] [stdout] | [INFO] [stdout] 144 | min_source = point; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/12.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 25 - print!("\n"); [INFO] [stdout] 25 + println!(); [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/bin/12.rs:29:19 [INFO] [stdout] | [INFO] [stdout] 29 | fn char_at(graph: &Vec<&str>, point: (usize, usize)) -> char { [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] 29 - fn char_at(graph: &Vec<&str>, point: (usize, usize)) -> char { [INFO] [stdout] 29 + fn char_at(graph: &[&str], point: (usize, usize)) -> char { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/12.rs:75:59 [INFO] [stdout] | [INFO] [stdout] 75 | fn dijkstra(graph: &Vec<&str>, source: (usize, usize)) -> (HashMap<(usize, usize), u32>, HashMap<(usize, usize), (usize, usize)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/bin/12.rs:79:26 [INFO] [stdout] | [INFO] [stdout] 79 | dists.insert(source, 0 as u32); [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/bin/12.rs:80:21 [INFO] [stdout] | [INFO] [stdout] 80 | pq.push(source, 0 as u32); [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/12.rs:82:11 [INFO] [stdout] | [INFO] [stdout] 82 | while pq.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!pq.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/12.rs:84:41 [INFO] [stdout] | [INFO] [stdout] 84 | for neighbour in get_neighbours(&graph, curr) { [INFO] [stdout] | ^^^^^^ help: change this to: `graph` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/12.rs:123:5 [INFO] [stdout] | [INFO] [stdout] 123 | return Some(dists[&target]) [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] 123 - return Some(dists[&target]) [INFO] [stdout] 123 + Some(dists[&target]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/bin/12.rs:152:10 [INFO] [stdout] | [INFO] [stdout] 152 | Some(min_dist as u32) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `min_dist` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/01.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | return Option::::from(max_cals); [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] 21 - return Option::::from(max_cals); [INFO] [stdout] 21 + Option::::from(max_cals) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `i` is used as a loop counter [INFO] [stdout] --> src/bin/01.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | for elf in elves.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (i, elf) in (0_u32..).zip(elves.iter())` [INFO] [stdout] | [INFO] [stdout] = note: `i` is of type `u32`, making it ineligible for `Iterator::enumerate` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/01.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | return Option::::from(final_sum); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 43 - return Option::::from(final_sum); [INFO] [stdout] 43 + Option::::from(final_sum) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:25:41 [INFO] [stdout] | [INFO] [stdout] 25 | score_map.insert("A Z".to_string(), 0 + 3); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:26:41 [INFO] [stdout] | [INFO] [stdout] 26 | score_map.insert("B X".to_string(), 0 + 1); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp` [INFO] [stdout] --> src/bin/15.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::cmp; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:30:41 [INFO] [stdout] | [INFO] [stdout] 30 | score_map.insert("C Y".to_string(), 0 + 2); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:39:41 [INFO] [stdout] | [INFO] [stdout] 39 | score_map.insert("A X".to_string(), 0 + 3); // 0+3 = score for losing + score for playing scissors [INFO] [stdout] | ^^^^^ help: consider reducing it to: `3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:42:41 [INFO] [stdout] | [INFO] [stdout] 42 | score_map.insert("B X".to_string(), 0 + 1); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:45:41 [INFO] [stdout] | [INFO] [stdout] 45 | score_map.insert("C X".to_string(), 0 + 2); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/02.rs:57:29 [INFO] [stdout] | [INFO] [stdout] 57 | let opponent_char = line.chars().nth(0).unwrap() as i32 - 65; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `line.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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/03.rs:66:22 [INFO] [stdout] | [INFO] [stdout] 66 | fn count_chars(line: &String, char_map: &mut [u32; 53]) { [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] 66 - fn count_chars(line: &String, char_map: &mut [u32; 53]) { [INFO] [stdout] 66 + fn count_chars(line: &str, char_map: &mut [u32; 53]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/03.rs:77:8 [INFO] [stdout] | [INFO] [stdout] 77 | if i >= 65 && i <= 90 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(65..=90).contains(&i)` [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/bin/03.rs:80:15 [INFO] [stdout] | [INFO] [stdout] 80 | } else if i >= 97 && i <= 122 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: use: `(97..=122).contains(&i)` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/08.rs:85:23 [INFO] [stdout] | [INFO] [stdout] 85 | fn visible_from(grid: &Vec, point: (usize, usize)) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 85 - fn visible_from(grid: &Vec, point: (usize, usize)) -> u32 { [INFO] [stdout] 85 + fn visible_from(grid: &[String], point: (usize, usize)) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `grid` [INFO] [stdout] --> src/bin/08.rs:103:14 [INFO] [stdout] | [INFO] [stdout] 103 | for i in point.0 + 1..grid.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 103 - for i in point.0 + 1..grid.len() { [INFO] [stdout] 103 + for in grid.iter().skip(point.0 + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/09.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | let vec: (i32, i32); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 18 | / vec = match dir { [INFO] [stdout] 19 | | "R" => (1, 0), [INFO] [stdout] 20 | | "L" => (-1, 0), [INFO] [stdout] 21 | | "U" => (0, -1), [INFO] [stdout] 22 | | "D" => (0, 1), [INFO] [stdout] 23 | | _ => (0, 0), [INFO] [stdout] 24 | | }; [INFO] [stdout] | |_________^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `vec` here [INFO] [stdout] | [INFO] [stdout] 17 ~ [INFO] [stdout] 18 ~ let vec: (i32, i32) = match dir { [INFO] [stdout] 19 + "R" => (1, 0), [INFO] [stdout] 20 + "L" => (-1, 0), [INFO] [stdout] 21 + "U" => (0, -1), [INFO] [stdout] 22 + "D" => (0, 1), [INFO] [stdout] 23 + _ => (0, 0), [INFO] [stdout] 24 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/04.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / (self.low >= other.low && self.low <= other.high) [INFO] [stdout] 23 | | || (self.high >= other.low && self.low <= other.high) [INFO] [stdout] | |_________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 - (self.low >= other.low && self.low <= other.high) [INFO] [stdout] 23 - || (self.high >= other.low && self.low <= other.high) [INFO] [stdout] 22 + !(self.low > other.high || self.low < other.low && self.high < other.low) [INFO] [stdout] | [INFO] [stdout] 22 - (self.low >= other.low && self.low <= other.high) [INFO] [stdout] 23 - || (self.high >= other.low && self.low <= other.high) [INFO] [stdout] 22 + (self.high >= other.low || self.low >= other.low) && self.low <= other.high [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:25:41 [INFO] [stdout] | [INFO] [stdout] 25 | score_map.insert("A Z".to_string(), 0 + 3); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:26:41 [INFO] [stdout] | [INFO] [stdout] 26 | score_map.insert("B X".to_string(), 0 + 1); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:30:41 [INFO] [stdout] | [INFO] [stdout] 30 | score_map.insert("C Y".to_string(), 0 + 2); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:39:41 [INFO] [stdout] | [INFO] [stdout] 39 | score_map.insert("A X".to_string(), 0 + 3); // 0+3 = score for losing + score for playing scissors [INFO] [stdout] | ^^^^^ help: consider reducing it to: `3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:42:41 [INFO] [stdout] | [INFO] [stdout] 42 | score_map.insert("B X".to_string(), 0 + 1); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/bin/02.rs:45:41 [INFO] [stdout] | [INFO] [stdout] 45 | score_map.insert("C X".to_string(), 0 + 2); [INFO] [stdout] | ^^^^^ help: consider reducing it to: `2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/02.rs:57:29 [INFO] [stdout] | [INFO] [stdout] 57 | let opponent_char = line.chars().nth(0).unwrap() as i32 - 65; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `line.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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/03.rs:66:22 [INFO] [stdout] | [INFO] [stdout] 66 | fn count_chars(line: &String, char_map: &mut [u32; 53]) { [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] 66 - fn count_chars(line: &String, char_map: &mut [u32; 53]) { [INFO] [stdout] 66 + fn count_chars(line: &str, char_map: &mut [u32; 53]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/03.rs:77:8 [INFO] [stdout] | [INFO] [stdout] 77 | if i >= 65 && i <= 90 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(65..=90).contains(&i)` [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/bin/03.rs:80:15 [INFO] [stdout] | [INFO] [stdout] 80 | } else if i >= 97 && i <= 122 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: use: `(97..=122).contains(&i)` [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: value assigned to `sx` is never read [INFO] [stdout] --> src/bin/15.rs:37:14 [INFO] [stdout] | [INFO] [stdout] 37 | let (mut sx,mut sy,mut bx,mut by) = (0,0,0,0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `sy` is never read [INFO] [stdout] --> src/bin/15.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | let (mut sx,mut sy,mut bx,mut by) = (0,0,0,0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `bx` is never read [INFO] [stdout] --> src/bin/15.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | let (mut sx,mut sy,mut bx,mut by) = (0,0,0,0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `by` is never read [INFO] [stdout] --> src/bin/15.rs:37:35 [INFO] [stdout] | [INFO] [stdout] 37 | let (mut sx,mut sy,mut bx,mut by) = (0,0,0,0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `range` [INFO] [stdout] --> src/bin/15.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | for range in ranges.iter() { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_range` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `point` is never read [INFO] [stdout] --> src/bin/15.rs:94:21 [INFO] [stdout] | [INFO] [stdout] 94 | let mut point = (-1,-1); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MultiRange` is never constructed [INFO] [stdout] --> src/bin/15.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | struct MultiRange { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/10.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 45 - print!("\n"); [INFO] [stdout] 45 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/10.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 45 - print!("\n"); [INFO] [stdout] 45 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `d` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/05.rs:39:26 [INFO] [stdout] | [INFO] [stdout] 38 | if d.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = d` [INFO] [stdout] 39 | out.push(d.unwrap()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/bin/05.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | / let mut out = Vec::::new(); [INFO] [stdout] 34 | | out.reserve(n as usize); [INFO] [stdout] | |________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut out = Vec::with_capacity(n as usize);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] = note: `#[warn(clippy::reserve_after_initialization)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing last element with `self.data.get(self.data.len() - 1)` [INFO] [stdout] --> src/bin/05.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | self.data.get(self.data.len() - 1).unwrap().to_owned() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.data.back()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len [INFO] [stdout] = note: `#[warn(clippy::get_last_with_len)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/bin/05.rs:109:9 [INFO] [stdout] | [INFO] [stdout] 109 | / let mut tops = Vec::::new(); [INFO] [stdout] 110 | | tops.reserve(self.stacks.len()); [INFO] [stdout] | |________________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut tops = Vec::with_capacity(self.stacks.len());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/05.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 123 - print!("\n"); [INFO] [stdout] 123 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/05.rs:130:13 [INFO] [stdout] | [INFO] [stdout] 130 | write!(f, "{}: {}\n", i + 1, stack); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 130 - write!(f, "{}: {}\n", i + 1, stack); [INFO] [stdout] 130 + writeln!(f, "{}: {}", i + 1, stack); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/05.rs:173:12 [INFO] [stdout] | [INFO] [stdout] 173 | if line.len() == 0 { [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: unneeded late initialization [INFO] [stdout] --> src/bin/09.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | let vec: (i32, i32); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 18 | / vec = match dir { [INFO] [stdout] 19 | | "R" => (1, 0), [INFO] [stdout] 20 | | "L" => (-1, 0), [INFO] [stdout] 21 | | "U" => (0, -1), [INFO] [stdout] 22 | | "D" => (0, 1), [INFO] [stdout] 23 | | _ => (0, 0), [INFO] [stdout] 24 | | }; [INFO] [stdout] | |_________^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `vec` here [INFO] [stdout] | [INFO] [stdout] 17 ~ [INFO] [stdout] 18 ~ let vec: (i32, i32) = match dir { [INFO] [stdout] 19 + "R" => (1, 0), [INFO] [stdout] 20 + "L" => (-1, 0), [INFO] [stdout] 21 + "U" => (0, -1), [INFO] [stdout] 22 + "D" => (0, 1), [INFO] [stdout] 23 + _ => (0, 0), [INFO] [stdout] 24 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashMap` [INFO] [stdout] --> src/bin/11.rs:1:24 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::{HashMap, VecDeque}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:24:13 [INFO] [stdout] | [INFO] [stdout] 24 | index: index, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:34:13 [INFO] [stdout] | [INFO] [stdout] 34 | index: index, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/04.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / (self.low >= other.low && self.low <= other.high) [INFO] [stdout] 23 | | || (self.high >= other.low && self.low <= other.high) [INFO] [stdout] | |_________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 - (self.low >= other.low && self.low <= other.high) [INFO] [stdout] 23 - || (self.high >= other.low && self.low <= other.high) [INFO] [stdout] 22 + !(self.low > other.high || self.low < other.low && self.high < other.low) [INFO] [stdout] | [INFO] [stdout] 22 - (self.low >= other.low && self.low <= other.high) [INFO] [stdout] 23 - || (self.high >= other.low && self.low <= other.high) [INFO] [stdout] 22 + (self.high >= other.low || self.low >= other.low) && self.low <= other.high [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/11.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | let mut item = self.items.pop_front(); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/06.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | size: size, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/11.rs:195:17 [INFO] [stdout] | [INFO] [stdout] 195 | pub fn part_one(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/bin/11.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | for k in 0..20 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/11.rs:223:17 [INFO] [stdout] | [INFO] [stdout] 223 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/bin/11.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | for k in 0..10000 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `init_sample` is never used [INFO] [stdout] --> src/bin/11.rs:36:4 [INFO] [stdout] | [INFO] [stdout] 36 | fn init_sample() -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/bin/11.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | / if item.is_none() { [INFO] [stdout] 16 | | return None; [INFO] [stdout] 17 | | } [INFO] [stdout] | |_________^ help: replace it with: `item?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/11.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | i = i/3; [INFO] [stdout] | ^^^^^^^ help: replace it with: `i /= 3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/11.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | i = i % 9699690; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `i %= 9699690` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i64` which implements the `Copy` trait [INFO] [stdout] --> src/bin/11.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | let idx = (self.throw)(i.clone()); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `i` [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: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:43:20 [INFO] [stdout] | [INFO] [stdout] 43 | if ((x % 23) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 23))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:55:20 [INFO] [stdout] | [INFO] [stdout] 55 | if ((x % 19) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 19))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:67:20 [INFO] [stdout] | [INFO] [stdout] 67 | if ((x % 13) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 13))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:79:20 [INFO] [stdout] | [INFO] [stdout] 79 | if ((x % 17) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 17))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashMap` [INFO] [stdout] --> src/bin/11.rs:1:24 [INFO] [stdout] | [INFO] [stdout] 1 | use std::collections::{HashMap, VecDeque}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/11.rs:90:5 [INFO] [stdout] | [INFO] [stdout] 90 | let v: Vec; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 91 | [INFO] [stdout] 92 | / v = vec![ [INFO] [stdout] 93 | | Monkey { [INFO] [stdout] 94 | | n_inspected: 0, [INFO] [stdout] 95 | | items: VecDeque::from([i64::from(50), i64::from(70), i64::from(54), i64::from(83), i64::from(52), i64::from(78)]), [INFO] [stdout] ... | [INFO] [stdout] 188 | | }, [INFO] [stdout] 189 | | ]; [INFO] [stdout] | |_____^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `v` here [INFO] [stdout] | [INFO] [stdout] 90 ~ [INFO] [stdout] 91 | [INFO] [stdout] 92 ~ let v: Vec = vec![ [INFO] [stdout] 93 + Monkey { [INFO] [stdout] 94 + n_inspected: 0, [INFO] [stdout] 95 + items: VecDeque::from([i64::from(50), i64::from(70), i64::from(54), i64::from(83), i64::from(52), i64::from(78)]), [INFO] [stdout] 96 + operation: |x: i64| -> i64 { x * 3 }, [INFO] [stdout] 97 + throw: |x: i64| -> usize { [INFO] [stdout] 98 + if ((x % 11) as i64).is_zero() { [INFO] [stdout] 99 + 2 [INFO] [stdout] 100 + } else { [INFO] [stdout] 101 + 7 [INFO] [stdout] 102 + } [INFO] [stdout] 103 + }, [INFO] [stdout] 104 + }, [INFO] [stdout] 105 + Monkey { [INFO] [stdout] 106 + n_inspected: 0, [INFO] [stdout] 107 + items: VecDeque::from([i64::from(71), i64::from(52), i64::from(58), i64::from(60), i64::from(71)]), [INFO] [stdout] 108 + operation: |x: i64| -> i64 { x.pow(2) }, [INFO] [stdout] 109 + throw: |x: i64| -> usize { [INFO] [stdout] 110 + if ((x % 7) as i64).is_zero() { [INFO] [stdout] 111 + 0 [INFO] [stdout] 112 + } else { [INFO] [stdout] 113 + 2 [INFO] [stdout] 114 + } [INFO] [stdout] 115 + }, [INFO] [stdout] 116 + }, [INFO] [stdout] 117 + Monkey { [INFO] [stdout] 118 + n_inspected: 0, [INFO] [stdout] 119 + items: VecDeque::from([i64::from(66), i64::from(56), i64::from(56), i64::from(94), i64::from(60), i64::from(86), i64::from(73)]), [INFO] [stdout] 120 + operation: |x: i64| -> i64 { x + 1 }, [INFO] [stdout] 121 + throw: |x: i64| -> usize { [INFO] [stdout] 122 + if ((x % 3) as i64).is_zero() { [INFO] [stdout] 123 + 7 [INFO] [stdout] 124 + } else { [INFO] [stdout] 125 + 5 [INFO] [stdout] 126 + } [INFO] [stdout] 127 + }, [INFO] [stdout] 128 + }, [INFO] [stdout] 129 + Monkey { [INFO] [stdout] 130 + n_inspected: 0, [INFO] [stdout] 131 + items: VecDeque::from([i64::from(83), i64::from(99)]), [INFO] [stdout] 132 + operation: |x: i64| -> i64 { x + 8 }, [INFO] [stdout] 133 + throw: |x: i64| -> usize { [INFO] [stdout] 134 + if ((x % 5) as i64).is_zero() { [INFO] [stdout] 135 + 6 [INFO] [stdout] 136 + } else { [INFO] [stdout] 137 + 4 [INFO] [stdout] 138 + } [INFO] [stdout] 139 + }, [INFO] [stdout] 140 + }, [INFO] [stdout] 141 + Monkey { [INFO] [stdout] 142 + n_inspected: 0, [INFO] [stdout] 143 + items: VecDeque::from([i64::from(98), i64::from(98), i64::from(79)]), [INFO] [stdout] 144 + operation: |x: i64| -> i64 { x + 3 }, [INFO] [stdout] 145 + throw: |x: i64| -> usize { [INFO] [stdout] 146 + if ((x % 17) as i64).is_zero(){ [INFO] [stdout] 147 + 1 [INFO] [stdout] 148 + } else { [INFO] [stdout] 149 + 0 [INFO] [stdout] 150 + } [INFO] [stdout] 151 + }, [INFO] [stdout] 152 + }, [INFO] [stdout] 153 + Monkey { [INFO] [stdout] 154 + n_inspected: 0, [INFO] [stdout] 155 + items: VecDeque::from([i64::from(76)]), [INFO] [stdout] 156 + operation: |x: i64| -> i64 { x + 4 }, [INFO] [stdout] 157 + throw: |x: i64| -> usize { [INFO] [stdout] 158 + if ((x % 13) as i64).is_zero() { [INFO] [stdout] 159 + 6 [INFO] [stdout] 160 + } else { [INFO] [stdout] 161 + 3 [INFO] [stdout] 162 + } [INFO] [stdout] 163 + }, [INFO] [stdout] 164 + }, [INFO] [stdout] 165 + Monkey { [INFO] [stdout] 166 + n_inspected: 0, [INFO] [stdout] 167 + items: VecDeque::from([i64::from(52), i64::from(51), i64::from(84), i64::from(54)]), [INFO] [stdout] 168 + operation: |x: i64| -> i64 { x * 17 }, [INFO] [stdout] 169 + throw: |x: i64| -> usize { [INFO] [stdout] 170 + if ((x % 19) as i64).is_zero() { [INFO] [stdout] 171 + 4 [INFO] [stdout] 172 + } else { [INFO] [stdout] 173 + 1 [INFO] [stdout] 174 + } [INFO] [stdout] 175 + }, [INFO] [stdout] 176 + }, [INFO] [stdout] 177 + Monkey { [INFO] [stdout] 178 + n_inspected: 0, [INFO] [stdout] 179 + items: VecDeque::from([i64::from(82), i64::from(86), i64::from(91), i64::from(79), i64::from(94), i64::from(92), i64::from(59), i64::from(94)]), [INFO] [stdout] 180 + operation: |x: i64| -> i64 { x + 7 }, [INFO] [stdout] 181 + throw: |x: i64| -> usize { [INFO] [stdout] 182 + if ((x % 2) as i64).is_zero() { [INFO] [stdout] 183 + 5 [INFO] [stdout] 184 + } else { [INFO] [stdout] 185 + 3 [INFO] [stdout] 186 + } [INFO] [stdout] 187 + }, [INFO] [stdout] 188 + }, [INFO] [stdout] 189 ~ ]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:98:20 [INFO] [stdout] | [INFO] [stdout] 98 | if ((x % 11) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 11))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:110:20 [INFO] [stdout] | [INFO] [stdout] 110 | if ((x % 7) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `((x % 7))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:122:20 [INFO] [stdout] | [INFO] [stdout] 122 | if ((x % 3) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `((x % 3))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:134:20 [INFO] [stdout] | [INFO] [stdout] 134 | if ((x % 5) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `((x % 5))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:146:20 [INFO] [stdout] | [INFO] [stdout] 146 | if ((x % 17) as i64).is_zero(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 17))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:158:20 [INFO] [stdout] | [INFO] [stdout] 158 | if ((x % 13) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 13))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/bin/05.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | write!(f, "["); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 53 | let _ = write!(f, "["); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/bin/05.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | write!(f, "{}", c); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 56 | let _ = write!(f, "{}", c); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/bin/05.rs:130:13 [INFO] [stdout] | [INFO] [stdout] 130 | write!(f, "{}: {}\n", i + 1, stack); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 130 | let _ = write!(f, "{}: {}\n", i + 1, stack); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:170:20 [INFO] [stdout] | [INFO] [stdout] 170 | if ((x % 19) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 19))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:182:20 [INFO] [stdout] | [INFO] [stdout] 182 | if ((x % 2) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `((x % 2))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `monkeys` [INFO] [stdout] --> src/bin/11.rs:216:14 [INFO] [stdout] | [INFO] [stdout] 216 | for i in 0..monkeys.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 216 - for i in 0..monkeys.len() { [INFO] [stdout] 216 + for in &monkeys { [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/bin/08.rs:85:23 [INFO] [stdout] | [INFO] [stdout] 85 | fn visible_from(grid: &Vec, point: (usize, usize)) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 85 - fn visible_from(grid: &Vec, point: (usize, usize)) -> u32 { [INFO] [stdout] 85 + fn visible_from(grid: &[String], point: (usize, usize)) -> u32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `monkeys` [INFO] [stdout] --> src/bin/11.rs:243:14 [INFO] [stdout] | [INFO] [stdout] 243 | for i in 0..monkeys.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 243 - for i in 0..monkeys.len() { [INFO] [stdout] 243 + for in &monkeys { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `grid` [INFO] [stdout] --> src/bin/08.rs:103:14 [INFO] [stdout] | [INFO] [stdout] 103 | for i in point.0 + 1..grid.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 103 - for i in point.0 + 1..grid.len() { [INFO] [stdout] 103 + for in grid.iter().skip(point.0 + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/05.rs:194:13 [INFO] [stdout] | [INFO] [stdout] 194 | n: n, [INFO] [stdout] | ^^^^ help: replace it with: `n` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cmp` [INFO] [stdout] --> src/bin/15.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::cmp; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:24:13 [INFO] [stdout] | [INFO] [stdout] 24 | index: index, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | name: name, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/07.rs:34:13 [INFO] [stdout] | [INFO] [stdout] 34 | index: index, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/bin/06.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | last_n_chars.push(' '); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![' ';SIZE]` [INFO] [stdout] = help: or `last_n_chars.extend(std::iter::repeat_n(' ', SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/bin/06.rs:141:20 [INFO] [stdout] | [INFO] [stdout] 141 | for c in chars.into_iter() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/11.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | let mut item = self.items.pop_front(); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/11.rs:195:17 [INFO] [stdout] | [INFO] [stdout] 195 | pub fn part_one(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/bin/11.rs:197:9 [INFO] [stdout] | [INFO] [stdout] 197 | for k in 0..20 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `input` [INFO] [stdout] --> src/bin/11.rs:223:17 [INFO] [stdout] | [INFO] [stdout] 223 | pub fn part_two(input: &str) -> Option { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/bin/11.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | for k in 0..10000 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `init_sample` is never used [INFO] [stdout] --> src/bin/11.rs:36:4 [INFO] [stdout] | [INFO] [stdout] 36 | fn init_sample() -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/bin/11.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | / if item.is_none() { [INFO] [stdout] 16 | | return None; [INFO] [stdout] 17 | | } [INFO] [stdout] | |_________^ help: replace it with: `item?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/11.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | i = i/3; [INFO] [stdout] | ^^^^^^^ help: replace it with: `i /= 3` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/11.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | i = i % 9699690; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace it with: `i %= 9699690` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i64` which implements the `Copy` trait [INFO] [stdout] --> src/bin/11.rs:29:32 [INFO] [stdout] | [INFO] [stdout] 29 | let idx = (self.throw)(i.clone()); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `i` [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: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:43:20 [INFO] [stdout] | [INFO] [stdout] 43 | if ((x % 23) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 23))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:55:20 [INFO] [stdout] | [INFO] [stdout] 55 | if ((x % 19) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 19))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:67:20 [INFO] [stdout] | [INFO] [stdout] 67 | if ((x % 13) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 13))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:79:20 [INFO] [stdout] | [INFO] [stdout] 79 | if ((x % 17) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 17))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/11.rs:90:5 [INFO] [stdout] | [INFO] [stdout] 90 | let v: Vec; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 91 | [INFO] [stdout] 92 | / v = vec![ [INFO] [stdout] 93 | | Monkey { [INFO] [stdout] 94 | | n_inspected: 0, [INFO] [stdout] 95 | | items: VecDeque::from([i64::from(50), i64::from(70), i64::from(54), i64::from(83), i64::from(52), i64::from(78)]), [INFO] [stdout] ... | [INFO] [stdout] 188 | | }, [INFO] [stdout] 189 | | ]; [INFO] [stdout] | |_____^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `v` here [INFO] [stdout] | [INFO] [stdout] 90 ~ [INFO] [stdout] 91 | [INFO] [stdout] 92 ~ let v: Vec = vec![ [INFO] [stdout] 93 + Monkey { [INFO] [stdout] 94 + n_inspected: 0, [INFO] [stdout] 95 + items: VecDeque::from([i64::from(50), i64::from(70), i64::from(54), i64::from(83), i64::from(52), i64::from(78)]), [INFO] [stdout] 96 + operation: |x: i64| -> i64 { x * 3 }, [INFO] [stdout] 97 + throw: |x: i64| -> usize { [INFO] [stdout] 98 + if ((x % 11) as i64).is_zero() { [INFO] [stdout] 99 + 2 [INFO] [stdout] 100 + } else { [INFO] [stdout] 101 + 7 [INFO] [stdout] 102 + } [INFO] [stdout] 103 + }, [INFO] [stdout] 104 + }, [INFO] [stdout] 105 + Monkey { [INFO] [stdout] 106 + n_inspected: 0, [INFO] [stdout] 107 + items: VecDeque::from([i64::from(71), i64::from(52), i64::from(58), i64::from(60), i64::from(71)]), [INFO] [stdout] 108 + operation: |x: i64| -> i64 { x.pow(2) }, [INFO] [stdout] 109 + throw: |x: i64| -> usize { [INFO] [stdout] 110 + if ((x % 7) as i64).is_zero() { [INFO] [stdout] 111 + 0 [INFO] [stdout] 112 + } else { [INFO] [stdout] 113 + 2 [INFO] [stdout] 114 + } [INFO] [stdout] 115 + }, [INFO] [stdout] 116 + }, [INFO] [stdout] 117 + Monkey { [INFO] [stdout] 118 + n_inspected: 0, [INFO] [stdout] 119 + items: VecDeque::from([i64::from(66), i64::from(56), i64::from(56), i64::from(94), i64::from(60), i64::from(86), i64::from(73)]), [INFO] [stdout] 120 + operation: |x: i64| -> i64 { x + 1 }, [INFO] [stdout] 121 + throw: |x: i64| -> usize { [INFO] [stdout] 122 + if ((x % 3) as i64).is_zero() { [INFO] [stdout] 123 + 7 [INFO] [stdout] 124 + } else { [INFO] [stdout] 125 + 5 [INFO] [stdout] 126 + } [INFO] [stdout] 127 + }, [INFO] [stdout] 128 + }, [INFO] [stdout] 129 + Monkey { [INFO] [stdout] 130 + n_inspected: 0, [INFO] [stdout] 131 + items: VecDeque::from([i64::from(83), i64::from(99)]), [INFO] [stdout] 132 + operation: |x: i64| -> i64 { x + 8 }, [INFO] [stdout] 133 + throw: |x: i64| -> usize { [INFO] [stdout] 134 + if ((x % 5) as i64).is_zero() { [INFO] [stdout] 135 + 6 [INFO] [stdout] 136 + } else { [INFO] [stdout] 137 + 4 [INFO] [stdout] 138 + } [INFO] [stdout] 139 + }, [INFO] [stdout] 140 + }, [INFO] [stdout] 141 + Monkey { [INFO] [stdout] 142 + n_inspected: 0, [INFO] [stdout] 143 + items: VecDeque::from([i64::from(98), i64::from(98), i64::from(79)]), [INFO] [stdout] 144 + operation: |x: i64| -> i64 { x + 3 }, [INFO] [stdout] 145 + throw: |x: i64| -> usize { [INFO] [stdout] 146 + if ((x % 17) as i64).is_zero(){ [INFO] [stdout] 147 + 1 [INFO] [stdout] 148 + } else { [INFO] [stdout] 149 + 0 [INFO] [stdout] 150 + } [INFO] [stdout] 151 + }, [INFO] [stdout] 152 + }, [INFO] [stdout] 153 + Monkey { [INFO] [stdout] 154 + n_inspected: 0, [INFO] [stdout] 155 + items: VecDeque::from([i64::from(76)]), [INFO] [stdout] 156 + operation: |x: i64| -> i64 { x + 4 }, [INFO] [stdout] 157 + throw: |x: i64| -> usize { [INFO] [stdout] 158 + if ((x % 13) as i64).is_zero() { [INFO] [stdout] 159 + 6 [INFO] [stdout] 160 + } else { [INFO] [stdout] 161 + 3 [INFO] [stdout] 162 + } [INFO] [stdout] 163 + }, [INFO] [stdout] 164 + }, [INFO] [stdout] 165 + Monkey { [INFO] [stdout] 166 + n_inspected: 0, [INFO] [stdout] 167 + items: VecDeque::from([i64::from(52), i64::from(51), i64::from(84), i64::from(54)]), [INFO] [stdout] 168 + operation: |x: i64| -> i64 { x * 17 }, [INFO] [stdout] 169 + throw: |x: i64| -> usize { [INFO] [stdout] 170 + if ((x % 19) as i64).is_zero() { [INFO] [stdout] 171 + 4 [INFO] [stdout] 172 + } else { [INFO] [stdout] 173 + 1 [INFO] [stdout] 174 + } [INFO] [stdout] 175 + }, [INFO] [stdout] 176 + }, [INFO] [stdout] 177 + Monkey { [INFO] [stdout] 178 + n_inspected: 0, [INFO] [stdout] 179 + items: VecDeque::from([i64::from(82), i64::from(86), i64::from(91), i64::from(79), i64::from(94), i64::from(92), i64::from(59), i64::from(94)]), [INFO] [stdout] 180 + operation: |x: i64| -> i64 { x + 7 }, [INFO] [stdout] 181 + throw: |x: i64| -> usize { [INFO] [stdout] 182 + if ((x % 2) as i64).is_zero() { [INFO] [stdout] 183 + 5 [INFO] [stdout] 184 + } else { [INFO] [stdout] 185 + 3 [INFO] [stdout] 186 + } [INFO] [stdout] 187 + }, [INFO] [stdout] 188 + }, [INFO] [stdout] 189 ~ ]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:98:20 [INFO] [stdout] | [INFO] [stdout] 98 | if ((x % 11) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 11))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:110:20 [INFO] [stdout] | [INFO] [stdout] 110 | if ((x % 7) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `((x % 7))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:122:20 [INFO] [stdout] | [INFO] [stdout] 122 | if ((x % 3) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `((x % 3))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:134:20 [INFO] [stdout] | [INFO] [stdout] 134 | if ((x % 5) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `((x % 5))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:146:20 [INFO] [stdout] | [INFO] [stdout] 146 | if ((x % 17) as i64).is_zero(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 17))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:158:20 [INFO] [stdout] | [INFO] [stdout] 158 | if ((x % 13) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 13))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:170:20 [INFO] [stdout] | [INFO] [stdout] 170 | if ((x % 19) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `((x % 19))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> src/bin/11.rs:182:20 [INFO] [stdout] | [INFO] [stdout] 182 | if ((x % 2) as i64).is_zero() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `((x % 2))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `monkeys` [INFO] [stdout] --> src/bin/11.rs:216:14 [INFO] [stdout] | [INFO] [stdout] 216 | for i in 0..monkeys.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 216 - for i in 0..monkeys.len() { [INFO] [stdout] 216 + for in &monkeys { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `monkeys` [INFO] [stdout] --> src/bin/11.rs:243:14 [INFO] [stdout] | [INFO] [stdout] 243 | for i in 0..monkeys.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 243 - for i in 0..monkeys.len() { [INFO] [stdout] 243 + for in &monkeys { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `sx` is never read [INFO] [stdout] --> src/bin/15.rs:37:14 [INFO] [stdout] | [INFO] [stdout] 37 | let (mut sx,mut sy,mut bx,mut by) = (0,0,0,0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `sy` is never read [INFO] [stdout] --> src/bin/15.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | let (mut sx,mut sy,mut bx,mut by) = (0,0,0,0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `bx` is never read [INFO] [stdout] --> src/bin/15.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | let (mut sx,mut sy,mut bx,mut by) = (0,0,0,0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `by` is never read [INFO] [stdout] --> src/bin/15.rs:37:35 [INFO] [stdout] | [INFO] [stdout] 37 | let (mut sx,mut sy,mut bx,mut by) = (0,0,0,0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `range` [INFO] [stdout] --> src/bin/15.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | for range in ranges.iter() { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_range` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `point` is never read [INFO] [stdout] --> src/bin/15.rs:94:21 [INFO] [stdout] | [INFO] [stdout] 94 | let mut point = (-1,-1); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MultiRange` is never constructed [INFO] [stdout] --> src/bin/15.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | struct MultiRange { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/06.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | size: size, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/07.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | print!(" (dir, size={})\n", self.total_size) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 43 - print!(" (dir, size={})\n", self.total_size) [INFO] [stdout] 43 + println!(" (dir, size={})", self.total_size) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/07.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | print!(" (file, size={})\n", self.total_size) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 45 - print!(" (file, size={})\n", self.total_size) [INFO] [stdout] 45 + println!(" (file, size={})", self.total_size) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/07.rs:154:15 [INFO] [stdout] | [INFO] [stdout] 154 | day_seven(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [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: items after a test module [INFO] [stdout] --> src/bin/06.rs:100:1 [INFO] [stdout] | [INFO] [stdout] 100 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 117 | fn idx_first_n_unique(input: &str, n: usize) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 134 | fn all_unique(chars: &Vec, n: &usize) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = note: `#[warn(clippy::items_after_test_module)]` on by default [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like the same item is being pushed into this `Vec` [INFO] [stdout] --> src/bin/06.rs:120:9 [INFO] [stdout] | [INFO] [stdout] 120 | last_n_chars.push(' '); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using `vec![' ';SIZE]` [INFO] [stdout] = help: or `last_n_chars.extend(std::iter::repeat_n(' ', SIZE))` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push [INFO] [stdout] = note: `#[warn(clippy::same_item_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> src/bin/06.rs:141:20 [INFO] [stdout] | [INFO] [stdout] 141 | for c in chars.into_iter() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/bin/scaffold.rs:53:36 [INFO] [stdout] | [INFO] [stdout] 53 | OpenOptions::new().write(true).create(true).open(path) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/07.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | print!(" (dir, size={})\n", self.total_size) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 43 - print!(" (dir, size={})\n", self.total_size) [INFO] [stdout] 43 + println!(" (dir, size={})", self.total_size) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/07.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | print!(" (file, size={})\n", self.total_size) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 45 - print!(" (file, size={})\n", self.total_size) [INFO] [stdout] 45 + println!(" (file, size={})", self.total_size) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `d` after checking its variant with `is_some` [INFO] [stdout] --> src/bin/05.rs:39:26 [INFO] [stdout] | [INFO] [stdout] 38 | if d.is_some() { [INFO] [stdout] | -------------- help: try: `if let Some() = d` [INFO] [stdout] 39 | out.push(d.unwrap()); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/07.rs:154:15 [INFO] [stdout] | [INFO] [stdout] 154 | day_seven(&input); [INFO] [stdout] | ^^^^^^ help: change this to: `input` [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: call to `reserve` immediately after creation [INFO] [stdout] --> src/bin/05.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | / let mut out = Vec::::new(); [INFO] [stdout] 34 | | out.reserve(n as usize); [INFO] [stdout] | |________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut out = Vec::with_capacity(n as usize);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] = note: `#[warn(clippy::reserve_after_initialization)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing last element with `self.data.get(self.data.len() - 1)` [INFO] [stdout] --> src/bin/05.rs:47:9 [INFO] [stdout] | [INFO] [stdout] 47 | self.data.get(self.data.len() - 1).unwrap().to_owned() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.data.back()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len [INFO] [stdout] = note: `#[warn(clippy::get_last_with_len)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> src/bin/05.rs:109:9 [INFO] [stdout] | [INFO] [stdout] 109 | / let mut tops = Vec::::new(); [INFO] [stdout] 110 | | tops.reserve(self.stacks.len()); [INFO] [stdout] | |________________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut tops = Vec::with_capacity(self.stacks.len());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/05.rs:123:9 [INFO] [stdout] | [INFO] [stdout] 123 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 123 - print!("\n"); [INFO] [stdout] 123 + println!(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/05.rs:130:13 [INFO] [stdout] | [INFO] [stdout] 130 | write!(f, "{}: {}\n", i + 1, stack); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 130 - write!(f, "{}: {}\n", i + 1, stack); [INFO] [stdout] 130 + writeln!(f, "{}: {}", i + 1, stack); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `source_dists` [INFO] [stdout] --> src/bin/12.rs:129:9 [INFO] [stdout] | [INFO] [stdout] 129 | let source_dists = dijkstra(&graph, source); [INFO] [stdout] | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_source_dists` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/05.rs:173:12 [INFO] [stdout] | [INFO] [stdout] 173 | if line.len() == 0 { [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: variable `min_source` is assigned to, but never used [INFO] [stdout] --> src/bin/12.rs:132:9 [INFO] [stdout] | [INFO] [stdout] 132 | let mut min_source: (usize, usize) = (0,0); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_min_source` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `min_source` is never read [INFO] [stdout] --> src/bin/12.rs:144:17 [INFO] [stdout] | [INFO] [stdout] 144 | min_source = point; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `print!()` with a format string that ends in a single newline [INFO] [stdout] --> src/bin/12.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | print!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline [INFO] [stdout] = note: `#[warn(clippy::print_with_newline)]` on by default [INFO] [stdout] help: use `println!` instead [INFO] [stdout] | [INFO] [stdout] 25 - print!("\n"); [INFO] [stdout] 25 + println!(); [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/bin/12.rs:29:19 [INFO] [stdout] | [INFO] [stdout] 29 | fn char_at(graph: &Vec<&str>, point: (usize, usize)) -> char { [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] 29 - fn char_at(graph: &Vec<&str>, point: (usize, usize)) -> char { [INFO] [stdout] 29 + fn char_at(graph: &[&str], point: (usize, usize)) -> char { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/12.rs:75:59 [INFO] [stdout] | [INFO] [stdout] 75 | fn dijkstra(graph: &Vec<&str>, source: (usize, usize)) -> (HashMap<(usize, usize), u32>, HashMap<(usize, usize), (usize, usize)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `max_elf` is assigned to, but never used [INFO] [stdout] --> src/bin/01.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let mut max_elf: u32 = 0; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_max_elf` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/bin/12.rs:79:26 [INFO] [stdout] | [INFO] [stdout] 79 | dists.insert(source, 0 as u32); [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/bin/12.rs:80:21 [INFO] [stdout] | [INFO] [stdout] 80 | pq.push(source, 0 as u32); [INFO] [stdout] | ^^^^^^^^ help: try: `0_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/12.rs:82:11 [INFO] [stdout] | [INFO] [stdout] 82 | while pq.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!pq.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/12.rs:84:41 [INFO] [stdout] | [INFO] [stdout] 84 | for neighbour in get_neighbours(&graph, curr) { [INFO] [stdout] | ^^^^^^ help: change this to: `graph` [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: value assigned to `max_elf` is never read [INFO] [stdout] --> src/bin/01.rs:16:13 [INFO] [stdout] | [INFO] [stdout] 16 | max_elf = i [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/01.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | return Option::::from(max_cals); [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] 21 - return Option::::from(max_cals); [INFO] [stdout] 21 + Option::::from(max_cals) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/bin/05.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | write!(f, "["); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 53 | let _ = write!(f, "["); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/bin/05.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | write!(f, "{}", c); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 56 | let _ = write!(f, "{}", c); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/12.rs:123:5 [INFO] [stdout] | [INFO] [stdout] 123 | return Some(dists[&target]) [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] 123 - return Some(dists[&target]) [INFO] [stdout] 123 + Some(dists[&target]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/bin/05.rs:130:13 [INFO] [stdout] | [INFO] [stdout] 130 | write!(f, "{}: {}\n", i + 1, stack); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 130 | let _ = write!(f, "{}: {}\n", i + 1, stack); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `i` is used as a loop counter [INFO] [stdout] --> src/bin/01.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | for elf in elves.iter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (i, elf) in (0_u32..).zip(elves.iter())` [INFO] [stdout] | [INFO] [stdout] = note: `i` is of type `u32`, making it ineligible for `Iterator::enumerate` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/bin/01.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | return Option::::from(final_sum); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 43 - return Option::::from(final_sum); [INFO] [stdout] 43 + Option::::from(final_sum) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u32` -> `u32`) [INFO] [stdout] --> src/bin/12.rs:152:10 [INFO] [stdout] | [INFO] [stdout] 152 | Some(min_dist as u32) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `min_dist` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.94s [INFO] running `Command { std: "docker" "inspect" "c713e5590191ff72203e46d85ec51af3e959debea06a2ecec6ef08f3e0561cb2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c713e5590191ff72203e46d85ec51af3e959debea06a2ecec6ef08f3e0561cb2", kill_on_drop: false }` [INFO] [stdout] c713e5590191ff72203e46d85ec51af3e959debea06a2ecec6ef08f3e0561cb2