[INFO] cloning repository https://github.com/FrederikFinckh/aoc2024 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/FrederikFinckh/aoc2024" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FFrederikFinckh%2Faoc2024", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FFrederikFinckh%2Faoc2024'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 23134ff347db62c16b180a91eb1e70073b63e796 [INFO] linting FrederikFinckh/aoc2024 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FFrederikFinckh%2Faoc2024" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/FrederikFinckh/aoc2024 [INFO] finished tweaking git repo https://github.com/FrederikFinckh/aoc2024 [INFO] tweaked toml for git repo https://github.com/FrederikFinckh/aoc2024 written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/FrederikFinckh/aoc2024 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/FrederikFinckh/aoc2024 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] ba640a69449c5a57bdeb0f3ef4ea1cc41fb0c9d41be0e26fa2f2dbdb65285ff6 [INFO] running `Command { std: "docker" "start" "-a" "ba640a69449c5a57bdeb0f3ef4ea1cc41fb0c9d41be0e26fa2f2dbdb65285ff6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "ba640a69449c5a57bdeb0f3ef4ea1cc41fb0c9d41be0e26fa2f2dbdb65285ff6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ba640a69449c5a57bdeb0f3ef4ea1cc41fb0c9d41be0e26fa2f2dbdb65285ff6", kill_on_drop: false }` [INFO] [stdout] ba640a69449c5a57bdeb0f3ef4ea1cc41fb0c9d41be0e26fa2f2dbdb65285ff6 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 545a88b6eaadfb55587d6861e526f0e37c328d31269c7fa654bf21c0da1f55a3 [INFO] running `Command { std: "docker" "start" "-a" "545a88b6eaadfb55587d6861e526f0e37c328d31269c7fa654bf21c0da1f55a3", kill_on_drop: false }` [INFO] [stderr] Checking aoc2024 v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day1.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | .filter(|l| l.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.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: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day1.rs:40:37 [INFO] [stdout] | [INFO] [stdout] 40 | .and_modify(|count| *count = *count + 1) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `*count += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day6.rs:4:30 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec = read_to_string("inputs/day6") [INFO] [stdout] | ______________________________^ [INFO] [stdout] 5 | | .unwrap() [INFO] [stdout] 6 | | .to_string() [INFO] [stdout] 7 | | .split('\n') [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4 ~ let input: Vec = read_to_string("inputs/day6") [INFO] [stdout] 5 + .unwrap().split('\n') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day6.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day6.rs:11:29 [INFO] [stdout] | [INFO] [stdout] 11 | let starting_position = (0..input.len()) [INFO] [stdout] | _____________________________^ [INFO] [stdout] 12 | | .map(|row| (row, input[row].find('^'))) [INFO] [stdout] 13 | | .filter(|(_, col)| col.is_some()) [INFO] [stdout] 14 | | .map(|(row, col)| (row, col.unwrap())) [INFO] [stdout] 15 | | .nth(0) [INFO] [stdout] | |_______________^ [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] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 11 ~ let starting_position = (0..input.len()) [INFO] [stdout] 12 + .map(|row| (row, input[row].find('^'))) [INFO] [stdout] 13 + .filter(|(_, col)| col.is_some()) [INFO] [stdout] 14 + .map(|(row, col)| (row, col.unwrap())).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `obstacle` after checking its variant with `is_none` [INFO] [stdout] --> src/bin/day6.rs:54:28 [INFO] [stdout] | [INFO] [stdout] 46 | if obstacle.is_none() { [INFO] [stdout] | --------------------- help: try: `if let Some() = obstacle` [INFO] [stdout] ... [INFO] [stdout] 54 | let obstacle = obstacle.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:30:12 [INFO] [stdout] | [INFO] [stdout] 30 | input: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 - input: &Vec, [INFO] [stdout] 30 + input: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day6.rs:35:24 [INFO] [stdout] | [INFO] [stdout] 35 | let mut position = starting_position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*starting_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day18.rs:8:19 [INFO] [stdout] | [INFO] [stdout] 8 | let is_test = args().last() == Some("test".to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 8 - let is_test = args().last() == Some("test".to_string()); [INFO] [stdout] 8 + let is_test = args().next_back() == Some("test".to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day6.rs:45:59 [INFO] [stdout] | [INFO] [stdout] 45 | let obstacle = find_obstacle(position, direction, &obstacles); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `obstacles` [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: length comparison to zero [INFO] [stdout] --> src/bin/day18.rs:16:17 [INFO] [stdout] | [INFO] [stdout] 16 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: unnecessary use of `get(&end).is_some()` [INFO] [stdout] --> src/bin/day18.rs:51:26 [INFO] [stdout] | [INFO] [stdout] 51 | if cost_by_field.get(&end).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&end)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | input: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 76 - input: &Vec, [INFO] [stdout] 76 + input: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/bin/day18.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | / if x.is_none() { [INFO] [stdout] 62 | | return None; [INFO] [stdout] 63 | | } [INFO] [stdout] | |_________^ help: replace it with: `x?;` [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: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day18.rs:72:16 [INFO] [stdout] | [INFO] [stdout] 72 | if !cost_by_field [INFO] [stdout] | ________________^ [INFO] [stdout] 73 | | .get(&neighbour) [INFO] [stdout] 74 | | .is_some_and(|neighbour_cost| *neighbour_cost < cost + 1) [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] 72 ~ if cost_by_field [INFO] [stdout] 73 + .get(&neighbour).is_none_or(|neighbour_cost| *neighbour_cost >= cost + 1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:86:12 [INFO] [stdout] | [INFO] [stdout] 86 | input: &Vec<(usize, usize)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 86 - input: &Vec<(usize, usize)>, [INFO] [stdout] 86 + input: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:112:27 [INFO] [stdout] | [INFO] [stdout] 112 | fn _vizualize_maze(input: &Vec<(usize, usize)>, dimensions: (usize, usize)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 112 - fn _vizualize_maze(input: &Vec<(usize, usize)>, dimensions: (usize, usize)) { [INFO] [stdout] 112 + fn _vizualize_maze(input: &[(usize, usize)], dimensions: (usize, usize)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:127:14 [INFO] [stdout] | [INFO] [stdout] 127 | fn p2(input: &Vec<(usize, usize)>, dimensions: (usize, usize)) -> (usize, usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 127 - fn p2(input: &Vec<(usize, usize)>, dimensions: (usize, usize)) -> (usize, usize) { [INFO] [stdout] 127 + fn p2(input: &[(usize, usize)], dimensions: (usize, usize)) -> (usize, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day5.rs:17:21 [INFO] [stdout] | [INFO] [stdout] 17 | .filter(|l| l.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | obstacles: &Vec<(usize, usize)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 141 - obstacles: &Vec<(usize, usize)>, [INFO] [stdout] 141 + obstacles: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day5.rs:25:21 [INFO] [stdout] | [INFO] [stdout] 25 | .filter(|l| l.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:38:18 [INFO] [stdout] | [INFO] [stdout] 38 | fn p1(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn p1(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] 38 + fn p1(orderings: &[Ordering], updates: &Vec>) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:38:43 [INFO] [stdout] | [INFO] [stdout] 38 | fn p1(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn p1(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] 38 + fn p1(orderings: &Vec, updates: &[Vec]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:54:43 [INFO] [stdout] | [INFO] [stdout] 54 | fn p2(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn p2(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] 54 + fn p2(orderings: &Vec, updates: &[Vec]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:71:28 [INFO] [stdout] | [INFO] [stdout] 71 | fn fix_ordering(orderings: &Vec, update: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - fn fix_ordering(orderings: &Vec, update: &Vec) -> Vec { [INFO] [stdout] 71 + fn fix_ordering(orderings: &[Ordering], update: &Vec) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:71:52 [INFO] [stdout] | [INFO] [stdout] 71 | fn fix_ordering(orderings: &Vec, update: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - fn fix_ordering(orderings: &Vec, update: &Vec) -> Vec { [INFO] [stdout] 71 + fn fix_ordering(orderings: &Vec, update: &[u64]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `obstacle` after checking its variant with `is_none` [INFO] [stdout] --> src/bin/day6.rs:198:36 [INFO] [stdout] | [INFO] [stdout] 195 | if obstacle.is_none() { [INFO] [stdout] | --------------------- help: try: `if let Some() = obstacle` [INFO] [stdout] ... [INFO] [stdout] 198 | let obstacle = obstacle.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:169:12 [INFO] [stdout] | [INFO] [stdout] 169 | input: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 169 - input: &Vec, [INFO] [stdout] 169 + input: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:171:16 [INFO] [stdout] | [INFO] [stdout] 171 | obstacles: &Vec<(usize, usize)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 171 ~ obstacles: &[(usize, usize)], [INFO] [stdout] 172 | ) -> u64 { [INFO] [stdout] ... [INFO] [stdout] 183 | let new_obstacle = (row, col); [INFO] [stdout] 184 ~ let mut new_obstacles = obstacles.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day6.rs:188:32 [INFO] [stdout] | [INFO] [stdout] 188 | let mut position = starting_position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*starting_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day2.rs:7:21 [INFO] [stdout] | [INFO] [stdout] 7 | .filter(|l| l.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day2.rs:18:14 [INFO] [stdout] | [INFO] [stdout] 18 | fn p1(input: &Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 18 - fn p1(input: &Vec>) { [INFO] [stdout] 18 + fn p1(input: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day2.rs:27:31 [INFO] [stdout] | [INFO] [stdout] 27 | fn is_safe_increasing(levels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 27 - fn is_safe_increasing(levels: &Vec) -> bool { [INFO] [stdout] 27 + fn is_safe_increasing(levels: &[i64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `levels.get(0)` [INFO] [stdout] --> src/bin/day2.rs:28:29 [INFO] [stdout] | [INFO] [stdout] 28 | if let Some(mut prev) = levels.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `levels.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day16.rs:11:15 [INFO] [stdout] | [INFO] [stdout] 11 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 11 - match args().last() { [INFO] [stdout] 11 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day16.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day16.rs:13:29 [INFO] [stdout] | [INFO] [stdout] 13 | Some(x) if x == "test2".to_string() => "_test2", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `"test2"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day16.rs:19:17 [INFO] [stdout] | [INFO] [stdout] 19 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day16.rs:23:26 [INFO] [stdout] | [INFO] [stdout] 23 | let start_position = (0..input.len()) [INFO] [stdout] | __________________________^ [INFO] [stdout] 24 | | .filter_map(|row| { [INFO] [stdout] 25 | | (0..input[row].len()) [INFO] [stdout] 26 | | .filter(|col| input[row][*col] == 'S') [INFO] [stdout] ... | [INFO] [stdout] 29 | | }) [INFO] [stdout] 30 | | .nth(0) [INFO] [stdout] | |_______________^ [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] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 23 ~ let start_position = (0..input.len()) [INFO] [stdout] 24 + .filter_map(|row| { [INFO] [stdout] 25 + (0..input[row].len()) [INFO] [stdout] 26 + .filter(|col| input[row][*col] == 'S') [INFO] [stdout] 27 + .nth(0) [INFO] [stdout] 28 + .map(|col| (row, col)) [INFO] [stdout] 29 + }).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day16.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | / (0..input[row].len()) [INFO] [stdout] 26 | | .filter(|col| input[row][*col] == 'S') [INFO] [stdout] 27 | | .nth(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 25 ~ (0..input[row].len()) [INFO] [stdout] 26 + .filter(|col| input[row][*col] == 'S').next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day16.rs:33:28 [INFO] [stdout] | [INFO] [stdout] 33 | let target_position1 = (0..input.len()) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 34 | | .filter_map(|row| { [INFO] [stdout] 35 | | (0..input[row].len()) [INFO] [stdout] 36 | | .filter(|col| input[row][*col] == 'E') [INFO] [stdout] ... | [INFO] [stdout] 39 | | }) [INFO] [stdout] 40 | | .nth(0) [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 33 ~ let target_position1 = (0..input.len()) [INFO] [stdout] 34 + .filter_map(|row| { [INFO] [stdout] 35 + (0..input[row].len()) [INFO] [stdout] 36 + .filter(|col| input[row][*col] == 'E') [INFO] [stdout] 37 + .nth(0) [INFO] [stdout] 38 + .map(|col| (row, col)) [INFO] [stdout] 39 + }).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day16.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | / (0..input[row].len()) [INFO] [stdout] 36 | | .filter(|col| input[row][*col] == 'E') [INFO] [stdout] 37 | | .nth(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 35 ~ (0..input[row].len()) [INFO] [stdout] 36 + .filter(|col| input[row][*col] == 'E').next() [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/day2.rs:43:31 [INFO] [stdout] | [INFO] [stdout] 43 | fn is_safe_decreasing(levels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 43 - fn is_safe_decreasing(levels: &Vec) -> bool { [INFO] [stdout] 43 + fn is_safe_decreasing(levels: &[i64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `levels.get(0)` [INFO] [stdout] --> src/bin/day2.rs:44:29 [INFO] [stdout] | [INFO] [stdout] 44 | if let Some(mut prev) = levels.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `levels.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:55:16 [INFO] [stdout] | [INFO] [stdout] 55 | for row in 0..input.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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 55 - for row in 0..input.len() { [INFO] [stdout] 55 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day2.rs:67:35 [INFO] [stdout] | [INFO] [stdout] 67 | fn is_safe_with_dampening(levels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 67 - fn is_safe_with_dampening(levels: &Vec) -> bool { [INFO] [stdout] 67 + fn is_safe_with_dampening(levels: &[i64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day10.rs:4:30 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec = read_to_string(format!( [INFO] [stdout] | ______________________________^ [INFO] [stdout] 5 | | "inputs/day10{}", [INFO] [stdout] 6 | | match args().last() { [INFO] [stdout] 7 | | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] ... | [INFO] [stdout] 12 | | .to_string() [INFO] [stdout] 13 | | .split('\n') [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4 ~ let input: Vec = read_to_string(format!( [INFO] [stdout] 5 + "inputs/day10{}", [INFO] [stdout] 6 + match args().last() { [INFO] [stdout] 7 + Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] 8 + _ => "", [INFO] [stdout] 9 + } [INFO] [stdout] 10 + )) [INFO] [stdout] 11 + .unwrap().split('\n') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:77:6 [INFO] [stdout] | [INFO] [stdout] 77 | ) -> HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)> { [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: called `unwrap` on `maybe_entry` after checking its variant with `is_none` [INFO] [stdout] --> src/bin/day16.rs:110:49 [INFO] [stdout] | [INFO] [stdout] 101 | if maybe_entry.is_none() [INFO] [stdout] | --------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 110 | let mut possible_predecessors = maybe_entry.unwrap().1.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:76:23 [INFO] [stdout] | [INFO] [stdout] 76 | target_positions: &Vec<(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] 76 - target_positions: &Vec<(usize, usize, char)>, [INFO] [stdout] 76 + target_positions: &[(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/day16.rs:78:31 [INFO] [stdout] | [INFO] [stdout] 78 | let mut cost_by_position: HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)> = [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] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&target_positions[0]).is_some()` [INFO] [stdout] --> src/bin/day16.rs:84:29 [INFO] [stdout] | [INFO] [stdout] 84 | if cost_by_position.get(&target_positions[0]).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&target_positions[0])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&target_positions[1]).is_some()` [INFO] [stdout] --> src/bin/day16.rs:85:33 [INFO] [stdout] | [INFO] [stdout] 85 | || cost_by_position.get(&target_positions[1]).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&target_positions[1])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `levels.get(0)` [INFO] [stdout] --> src/bin/day2.rs:68:27 [INFO] [stdout] | [INFO] [stdout] 68 | if let Some(_first) = levels.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `levels.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:131:23 [INFO] [stdout] | [INFO] [stdout] 131 | cost_by_position: &HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)>, [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] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day10.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day10.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:132:20 [INFO] [stdout] | [INFO] [stdout] 132 | current_point: ((usize, usize, char), (u64, Vec<(usize, usize, char)>)), [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:130:12 [INFO] [stdout] | [INFO] [stdout] 130 | input: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 130 - input: &Vec>, [INFO] [stdout] 130 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day10.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day10.rs:4:30 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec = read_to_string(format!( [INFO] [stdout] | ______________________________^ [INFO] [stdout] 5 | | "inputs/day10{}", [INFO] [stdout] 6 | | match args().last() { [INFO] [stdout] 7 | | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] ... | [INFO] [stdout] 12 | | .to_string() [INFO] [stdout] 13 | | .split('\n') [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4 ~ let input: Vec = read_to_string(format!( [INFO] [stdout] 5 + "inputs/day10{}", [INFO] [stdout] 6 + match args().last() { [INFO] [stdout] 7 + Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] 8 + _ => "", [INFO] [stdout] 9 + } [INFO] [stdout] 10 + )) [INFO] [stdout] 11 + .unwrap().split('\n') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day10.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day10.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day10.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:139:16 [INFO] [stdout] | [INFO] [stdout] 139 | for row in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 139 - for row in 0..input.len() { [INFO] [stdout] 139 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:140:20 [INFO] [stdout] | [INFO] [stdout] 140 | for col in 0..input[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 140 - for col in 0..input[row].len() { [INFO] [stdout] 140 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:154:20 [INFO] [stdout] | [INFO] [stdout] 154 | for col in 0..input[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 154 - for col in 0..input[row].len() { [INFO] [stdout] 154 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/day10.rs:89:59 [INFO] [stdout] | [INFO] [stdout] 89 | let mut current_neighbours: HashSet<(usize, usize)> = neighbours(point, &dimensions) [INFO] [stdout] | ___________________________________________________________^ [INFO] [stdout] 90 | | .iter() [INFO] [stdout] 91 | | .filter(|(row, col)| input[*row].chars().nth(*col).unwrap() == '1') [INFO] [stdout] 92 | | .map(|x| *x) [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 89 ~ let mut current_neighbours: HashSet<(usize, usize)> = neighbours(point, &dimensions) [INFO] [stdout] 90 + .iter() [INFO] [stdout] 91 + .filter(|(row, col)| input[*row].chars().nth(*col).unwrap() == '1').copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:168:20 [INFO] [stdout] | [INFO] [stdout] 168 | for col in 0..input[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 168 - for col in 0..input[row].len() { [INFO] [stdout] 168 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:182:20 [INFO] [stdout] | [INFO] [stdout] 182 | for col in 0..input[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 182 - for col in 0..input[row].len() { [INFO] [stdout] 182 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [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/day16.rs:204:12 [INFO] [stdout] | [INFO] [stdout] 204 | input: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 204 - input: &Vec>, [INFO] [stdout] 204 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:236:20 [INFO] [stdout] | [INFO] [stdout] 236 | cost_by_point: &HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)>, [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:237:23 [INFO] [stdout] | [INFO] [stdout] 237 | target_positions: &Vec<(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] help: change this to [INFO] [stdout] | [INFO] [stdout] 237 - target_positions: &Vec<(usize, usize, char)>, [INFO] [stdout] 237 + target_positions: &[(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/day16.rs:251:20 [INFO] [stdout] | [INFO] [stdout] 251 | cost_by_point: &HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)>, [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:252:23 [INFO] [stdout] | [INFO] [stdout] 252 | target_positions: &Vec<(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] help: change this to [INFO] [stdout] | [INFO] [stdout] 252 - target_positions: &Vec<(usize, usize, char)>, [INFO] [stdout] 252 + target_positions: &[(usize, usize, char)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day8.rs:9:21 [INFO] [stdout] | [INFO] [stdout] 9 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day8.rs:41:28 [INFO] [stdout] | [INFO] [stdout] 41 | fn _vizualize(input_lines: &Vec, antinodes: &HashSet<(usize, usize)>) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 41 - fn _vizualize(input_lines: &Vec, antinodes: &HashSet<(usize, usize)>) { [INFO] [stdout] 41 + fn _vizualize(input_lines: &[String], antinodes: &HashSet<(usize, usize)>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/day8.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/bin/day10.rs:89:59 [INFO] [stdout] | [INFO] [stdout] 89 | let mut current_neighbours: HashSet<(usize, usize)> = neighbours(point, &dimensions) [INFO] [stdout] | ___________________________________________________________^ [INFO] [stdout] 90 | | .iter() [INFO] [stdout] 91 | | .filter(|(row, col)| input[*row].chars().nth(*col).unwrap() == '1') [INFO] [stdout] 92 | | .map(|x| *x) [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 89 ~ let mut current_neighbours: HashSet<(usize, usize)> = neighbours(point, &dimensions) [INFO] [stdout] 90 + .iter() [INFO] [stdout] 91 + .filter(|(row, col)| input[*row].chars().nth(*col).unwrap() == '1').copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input_lines` [INFO] [stdout] --> src/bin/day8.rs:43:16 [INFO] [stdout] | [INFO] [stdout] 43 | for row in 0..input_lines.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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 43 - for row in 0..input_lines.len() { [INFO] [stdout] 43 + for (row, ) in input_lines.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day10.rs:98:67 [INFO] [stdout] | [INFO] [stdout] 98 | .filter(|(row, col)| input[*row].chars().nth(*col) == height.to_string().chars().nth(0)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `height.to_string().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 `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day10.rs:104:14 [INFO] [stdout] | [INFO] [stdout] 104 | fn p1(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 104 - fn p1(input: &Vec) -> usize { [INFO] [stdout] 104 + fn p1(input: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/day8.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | println!("") [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/day8.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day10.rs:98:67 [INFO] [stdout] | [INFO] [stdout] 98 | .filter(|(row, col)| input[*row].chars().nth(*col) == height.to_string().chars().nth(0)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `height.to_string().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: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day10.rs:125:33 [INFO] [stdout] | [INFO] [stdout] 125 | let current_point = path.last().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*path.last().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day8.rs:61:55 [INFO] [stdout] | [INFO] [stdout] 61 | fn get_occuring_indices(character: char, input_lines: &Vec) -> Vec<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 61 - fn get_occuring_indices(character: char, input_lines: &Vec) -> Vec<(usize, usize)> { [INFO] [stdout] 61 + fn get_occuring_indices(character: char, input_lines: &[String]) -> Vec<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day10.rs:130:54 [INFO] [stdout] | [INFO] [stdout] 130 | input[*row].chars().nth(*col) == height.to_string().chars().nth(0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `height.to_string().chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day10.rs:148:14 [INFO] [stdout] | [INFO] [stdout] 148 | fn p2(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 148 - fn p2(input: &Vec) -> usize { [INFO] [stdout] 148 + fn p2(input: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day10.rs:104:14 [INFO] [stdout] | [INFO] [stdout] 104 | fn p1(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 104 - fn p1(input: &Vec) -> usize { [INFO] [stdout] 104 + fn p1(input: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day10.rs:125:33 [INFO] [stdout] | [INFO] [stdout] 125 | let current_point = path.last().unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*path.last().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day10.rs:130:54 [INFO] [stdout] | [INFO] [stdout] 130 | input[*row].chars().nth(*col) == height.to_string().chars().nth(0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `height.to_string().chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day13.rs:4:16 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec<((u64, u64), (u64, u64), (u64, u64))> = read_to_string(format!( [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: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day13.rs:4:60 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec<((u64, u64), (u64, u64), (u64, u64))> = read_to_string(format!( [INFO] [stdout] | ____________________________________________________________^ [INFO] [stdout] 5 | | "inputs/day13{}", [INFO] [stdout] 6 | | match args().last() { [INFO] [stdout] 7 | | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] ... | [INFO] [stdout] 12 | | .to_string() [INFO] [stdout] 13 | | .split("\n\n") [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4 ~ let input: Vec<((u64, u64), (u64, u64), (u64, u64))> = read_to_string(format!( [INFO] [stdout] 5 + "inputs/day13{}", [INFO] [stdout] 6 + match args().last() { [INFO] [stdout] 7 + Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] 8 + _ => "", [INFO] [stdout] 9 + } [INFO] [stdout] 10 + )) [INFO] [stdout] 11 + .unwrap().split("\n\n") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day13.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day13.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day10.rs:148:14 [INFO] [stdout] | [INFO] [stdout] 148 | fn p2(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 148 - fn p2(input: &Vec) -> usize { [INFO] [stdout] 148 + fn p2(input: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day13.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day13.rs:18:25 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day13.rs:90:14 [INFO] [stdout] | [INFO] [stdout] 90 | fn p1(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day13.rs:90:14 [INFO] [stdout] | [INFO] [stdout] 90 | fn p1(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 90 - fn p1(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [INFO] [stdout] 90 + fn p1(input: &[((u64, u64), (u64, u64), (u64, u64))]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/bin/day13.rs:99:10 [INFO] [stdout] | [INFO] [stdout] 99 | .filter(|x| x.is_some()) [INFO] [stdout] | __________^ [INFO] [stdout] 100 | | .map(|x| x.unwrap()) [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day13.rs:105:14 [INFO] [stdout] | [INFO] [stdout] 105 | fn p2(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day13.rs:105:14 [INFO] [stdout] | [INFO] [stdout] 105 | fn p2(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 105 - fn p2(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [INFO] [stdout] 105 + fn p2(input: &[((u64, u64), (u64, u64), (u64, u64))]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/bin/day13.rs:121:10 [INFO] [stdout] | [INFO] [stdout] 121 | .filter(|x| x.is_some()) [INFO] [stdout] | __________^ [INFO] [stdout] 122 | | .map(|x| x.unwrap()) [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:7:15 [INFO] [stdout] | [INFO] [stdout] 7 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 7 - match args().last() { [INFO] [stdout] 7 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day15.rs:8:29 [INFO] [stdout] | [INFO] [stdout] 8 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day15.rs:17:21 [INFO] [stdout] | [INFO] [stdout] 17 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | fn p1(maze: &Vec, moves: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 27 ~ fn p1(maze: &[String], moves: &Vec) -> usize { [INFO] [stdout] 28 | let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] 29 ~ let mut current_maze = maze.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:28:19 [INFO] [stdout] | [INFO] [stdout] 28 | let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 28 - let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] 28 + let is_test = args().next_back().is_some_and(|arg| arg.eq("test")); [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/day15.rs:47:16 [INFO] [stdout] | [INFO] [stdout] 47 | fn score(maze: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 47 - fn score(maze: &Vec) -> usize { [INFO] [stdout] 47 + fn score(maze: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:65:20 [INFO] [stdout] | [INFO] [stdout] 65 | let position = (0..maze.len()) [INFO] [stdout] | ____________________^ [INFO] [stdout] 66 | | .filter_map(|row| { [INFO] [stdout] 67 | | (0..maze[row].len()) [INFO] [stdout] 68 | | .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] ... | [INFO] [stdout] 71 | | }) [INFO] [stdout] 72 | | .nth(0) [INFO] [stdout] | |_______________^ [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] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 65 ~ let position = (0..maze.len()) [INFO] [stdout] 66 + .filter_map(|row| { [INFO] [stdout] 67 + (0..maze[row].len()) [INFO] [stdout] 68 + .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 69 + .map(|col| (row, col)) [INFO] [stdout] 70 + .nth(0) [INFO] [stdout] 71 + }).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:67:13 [INFO] [stdout] | [INFO] [stdout] 67 | / (0..maze[row].len()) [INFO] [stdout] 68 | | .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 69 | | .map(|col| (row, col)) [INFO] [stdout] 70 | | .nth(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 67 ~ (0..maze[row].len()) [INFO] [stdout] 68 + .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 69 + .map(|col| (row, col)).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day12.rs:8:30 [INFO] [stdout] | [INFO] [stdout] 8 | let input: Vec = read_to_string(format!( [INFO] [stdout] | ______________________________^ [INFO] [stdout] 9 | | "inputs/day12{}", [INFO] [stdout] 10 | | match args().last() { [INFO] [stdout] 11 | | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] ... | [INFO] [stdout] 16 | | .to_string() [INFO] [stdout] 17 | | .split('\n') [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 8 ~ let input: Vec = read_to_string(format!( [INFO] [stdout] 9 + "inputs/day12{}", [INFO] [stdout] 10 + match args().last() { [INFO] [stdout] 11 + Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] 12 + _ => "", [INFO] [stdout] 13 + } [INFO] [stdout] 14 + )) [INFO] [stdout] 15 + .unwrap().split('\n') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:85:21 [INFO] [stdout] | [INFO] [stdout] 85 | let next_wall = row [INFO] [stdout] | _____________________^ [INFO] [stdout] 86 | | .match_indices('#') [INFO] [stdout] 87 | | .filter(|(index, _)| *index > position.1) [INFO] [stdout] 88 | | .map(|x| x.0) [INFO] [stdout] 89 | | .nth(0) [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 85 ~ let next_wall = row [INFO] [stdout] 86 + .match_indices('#') [INFO] [stdout] 87 + .filter(|(index, _)| *index > position.1) [INFO] [stdout] 88 + .map(|x| x.0).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:92:22 [INFO] [stdout] | [INFO] [stdout] 92 | let next_space = row [INFO] [stdout] | ______________________^ [INFO] [stdout] 93 | | .match_indices('.') [INFO] [stdout] 94 | | .filter(|(index, _)| *index > position.1 && *index < next_wall) [INFO] [stdout] 95 | | .map(|x| x.0) [INFO] [stdout] 96 | | .nth(0); [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 92 ~ let next_space = row [INFO] [stdout] 93 + .match_indices('.') [INFO] [stdout] 94 + .filter(|(index, _)| *index > position.1 && *index < next_wall) [INFO] [stdout] 95 ~ .map(|x| x.0).next(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day12.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 10 - match args().last() { [INFO] [stdout] 10 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | row[..position.1].to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[..position.1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | row[next_space + 1..].to_string() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[next_space + 1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day12.rs:11:29 [INFO] [stdout] | [INFO] [stdout] 11 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day12.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:169:19 [INFO] [stdout] | [INFO] [stdout] 169 | let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 169 - let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] 169 + let is_test = args().next_back().is_some_and(|arg| arg.eq("test")); [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/day15.rs:195:20 [INFO] [stdout] | [INFO] [stdout] 195 | fn score_fat(maze: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 195 - fn score_fat(maze: &Vec) -> usize { [INFO] [stdout] 195 + fn score_fat(maze: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:213:20 [INFO] [stdout] | [INFO] [stdout] 213 | let position = (0..maze.len()) [INFO] [stdout] | ____________________^ [INFO] [stdout] 214 | | .filter_map(|row| { [INFO] [stdout] 215 | | (0..maze[row].len()) [INFO] [stdout] 216 | | .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] ... | [INFO] [stdout] 219 | | }) [INFO] [stdout] 220 | | .nth(0) [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 213 ~ let position = (0..maze.len()) [INFO] [stdout] 214 + .filter_map(|row| { [INFO] [stdout] 215 + (0..maze[row].len()) [INFO] [stdout] 216 + .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 217 + .map(|col| (row, col)) [INFO] [stdout] 218 + .nth(0) [INFO] [stdout] 219 + }).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:215:13 [INFO] [stdout] | [INFO] [stdout] 215 | / (0..maze[row].len()) [INFO] [stdout] 216 | | .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 217 | | .map(|col| (row, col)) [INFO] [stdout] 218 | | .nth(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 215 ~ (0..maze[row].len()) [INFO] [stdout] 216 + .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 217 + .map(|col| (row, col)).next() [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/day15.rs:223:41 [INFO] [stdout] | [INFO] [stdout] 223 | '>' => push_fat_right(position, &mut maze), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day15.rs:224:40 [INFO] [stdout] | [INFO] [stdout] 224 | '<' => push_fat_left(position, &mut maze), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day15.rs:225:38 [INFO] [stdout] | [INFO] [stdout] 225 | '^' => push_fat_up(position, &mut maze), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day15.rs:226:40 [INFO] [stdout] | [INFO] [stdout] 226 | 'v' => push_fat_down(position, &mut maze), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:231:51 [INFO] [stdout] | [INFO] [stdout] 231 | fn push_fat_right(position: (usize, usize), maze: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 231 - fn push_fat_right(position: (usize, usize), maze: &mut Vec) { [INFO] [stdout] 231 + fn push_fat_right(position: (usize, usize), maze: &mut [String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:233:21 [INFO] [stdout] | [INFO] [stdout] 233 | let next_wall = row [INFO] [stdout] | _____________________^ [INFO] [stdout] 234 | | .match_indices('#') [INFO] [stdout] 235 | | .filter(|(index, _)| *index > position.1) [INFO] [stdout] 236 | | .map(|x| x.0) [INFO] [stdout] 237 | | .nth(0) [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 233 ~ let next_wall = row [INFO] [stdout] 234 + .match_indices('#') [INFO] [stdout] 235 + .filter(|(index, _)| *index > position.1) [INFO] [stdout] 236 + .map(|x| x.0).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day4.rs:7:24 [INFO] [stdout] | [INFO] [stdout] 7 | .filter(|line| 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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:240:22 [INFO] [stdout] | [INFO] [stdout] 240 | let next_space = row [INFO] [stdout] | ______________________^ [INFO] [stdout] 241 | | .match_indices('.') [INFO] [stdout] 242 | | .filter(|(index, _)| *index > position.1 && *index < next_wall) [INFO] [stdout] 243 | | .map(|x| x.0) [INFO] [stdout] 244 | | .nth(0); [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 240 ~ let next_space = row [INFO] [stdout] 241 + .match_indices('.') [INFO] [stdout] 242 + .filter(|(index, _)| *index > position.1 && *index < next_wall) [INFO] [stdout] 243 ~ .map(|x| x.0).next(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/bin/day15.rs:252:24 [INFO] [stdout] | [INFO] [stdout] 252 | .match_indices(|x| x == '[' || x == ']') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | row[..position.1].to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[..position.1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:260:9 [INFO] [stdout] | [INFO] [stdout] 260 | row[next_space + 1..].to_string() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[next_space + 1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:266:50 [INFO] [stdout] | [INFO] [stdout] 266 | fn push_fat_left(position: (usize, usize), maze: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 266 - fn push_fat_left(position: (usize, usize), maze: &mut Vec) { [INFO] [stdout] 266 + fn push_fat_left(position: (usize, usize), maze: &mut [String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/day4.rs:19:47 [INFO] [stdout] | [INFO] [stdout] 19 | .map(|direction| direction.iter().map(|line| count_xmas(line)).sum::()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `count_xmas` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:268:21 [INFO] [stdout] | [INFO] [stdout] 268 | let next_wall = row [INFO] [stdout] | _____________________^ [INFO] [stdout] 269 | | .match_indices('#') [INFO] [stdout] 270 | | .filter(|(index, _)| *index < position.1) [INFO] [stdout] 271 | | .map(|x| x.0) [INFO] [stdout] 272 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 272 - .last() [INFO] [stdout] 272 + .next_back() [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/day4.rs:39:18 [INFO] [stdout] | [INFO] [stdout] 39 | fn column(input: &Vec, i: usize) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - fn column(input: &Vec, i: usize) -> String { [INFO] [stdout] 39 + fn column(input: &[String], i: usize) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:275:22 [INFO] [stdout] | [INFO] [stdout] 275 | let next_space = row [INFO] [stdout] | ______________________^ [INFO] [stdout] 276 | | .match_indices('.') [INFO] [stdout] 277 | | .filter(|(index, _)| *index < position.1 && *index > next_wall) [INFO] [stdout] 278 | | .map(|x| x.0) [INFO] [stdout] 279 | | .last(); [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 279 - .last(); [INFO] [stdout] 279 + .next_back(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/bin/day15.rs:287:24 [INFO] [stdout] | [INFO] [stdout] 287 | .match_indices(|x| x == '[' || x == ']') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:293:9 [INFO] [stdout] | [INFO] [stdout] 293 | row[..next_space].to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[..next_space]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:295:9 [INFO] [stdout] | [INFO] [stdout] 295 | row[position.1 + 1..].to_string() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[position.1 + 1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:301:50 [INFO] [stdout] | [INFO] [stdout] 301 | fn push_fat_up((row, col): (usize, usize), maze: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 301 - fn push_fat_up((row, col): (usize, usize), maze: &mut Vec) { [INFO] [stdout] 301 + fn push_fat_up((row, col): (usize, usize), maze: &mut [String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/bin/day4.rs:47:6 [INFO] [stdout] | [INFO] [stdout] 47 | ((input.len() as i64 * -1) + 1..input[0].len() as i64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `-(input.len() as i64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day12.rs:166:23 [INFO] [stdout] | [INFO] [stdout] 166 | fn get_char_at(input: &Vec, 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] 166 - fn get_char_at(input: &Vec, point: (usize, usize)) -> char { [INFO] [stdout] 166 + fn get_char_at(input: &[String], point: (usize, usize)) -> char { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `prev_row[thing.1]` and `current_row[thing.1]` manually [INFO] [stdout] --> src/bin/day15.rs:342:13 [INFO] [stdout] | [INFO] [stdout] 342 | / let tmp = prev_row[thing.1]; [INFO] [stdout] 343 | | prev_row[thing.1] = current_row[thing.1]; [INFO] [stdout] 344 | | current_row[thing.1] = tmp; [INFO] [stdout] | |_______________________________________^ help: try: `std::mem::swap(&mut prev_row[thing.1], &mut current_row[thing.1]);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day12.rs:170:16 [INFO] [stdout] | [INFO] [stdout] 170 | fn p1(regions: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 170 - fn p1(regions: &Vec) -> usize { [INFO] [stdout] 170 + fn p1(regions: &[Region]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day12.rs:181:44 [INFO] [stdout] | [INFO] [stdout] 181 | region_by_field.insert(*field, ®ion); [INFO] [stdout] | ^^^^^^^ help: change this to: `region` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:351:52 [INFO] [stdout] | [INFO] [stdout] 351 | fn push_fat_down((row, col): (usize, usize), maze: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 351 - fn push_fat_down((row, col): (usize, usize), maze: &mut Vec) { [INFO] [stdout] 351 + fn push_fat_down((row, col): (usize, usize), maze: &mut [String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day9.rs:34:12 [INFO] [stdout] | [INFO] [stdout] 34 | if !(fs_vec[i] == ".") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `(fs_vec[i] != ".")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/bin/day4.rs:53:6 [INFO] [stdout] | [INFO] [stdout] 53 | ((input.len() as i64 * -1) + 1..input[0].len() as i64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `-(input.len() as i64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `prev_row[thing.1]` and `current_row[thing.1]` manually [INFO] [stdout] --> src/bin/day15.rs:392:13 [INFO] [stdout] | [INFO] [stdout] 392 | / let tmp = prev_row[thing.1]; [INFO] [stdout] 393 | | prev_row[thing.1] = current_row[thing.1]; [INFO] [stdout] 394 | | current_row[thing.1] = tmp; [INFO] [stdout] | |_______________________________________^ help: try: `std::mem::swap(&mut prev_row[thing.1], &mut current_row[thing.1]);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:405:19 [INFO] [stdout] | [INFO] [stdout] 405 | fn make_fat(maze: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 405 - fn make_fat(maze: &Vec) -> Vec { [INFO] [stdout] 405 + fn make_fat(maze: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4.rs:58:26 [INFO] [stdout] | [INFO] [stdout] 58 | fn diagonal_ul_br(input: &Vec, i: i64) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 58 - fn diagonal_ul_br(input: &Vec, i: i64) -> String { [INFO] [stdout] 58 + fn diagonal_ul_br(input: &[String], i: i64) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/bin/day4.rs:60:25 [INFO] [stdout] | [INFO] [stdout] 60 | let start_row = (i * -1) as usize; [INFO] [stdout] | ^^^^^^^^ help: consider using: `-i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day9.rs:14:14 [INFO] [stdout] | [INFO] [stdout] 14 | fn p1(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn p1(input: &Vec) -> usize { [INFO] [stdout] 14 + fn p1(input: &[u32]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day9.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | i = i + 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `i += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day9.rs:39:13 [INFO] [stdout] | [INFO] [stdout] 39 | j = j - 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `j -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day9.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | i = i + 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `i += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day9.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | j = j - 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `j -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day9.rs:49:25 [INFO] [stdout] | [INFO] [stdout] 49 | .filter(|index| !(fs_vec[*index] == ".".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(fs_vec[*index] != ".".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day9.rs:49:45 [INFO] [stdout] | [INFO] [stdout] 49 | .filter(|index| !(fs_vec[*index] == ".".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"."` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day18.rs:8:19 [INFO] [stdout] | [INFO] [stdout] 8 | let is_test = args().last() == Some("test".to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 8 - let is_test = args().last() == Some("test".to_string()); [INFO] [stdout] 8 + let is_test = args().next_back() == Some("test".to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day9.rs:59:14 [INFO] [stdout] | [INFO] [stdout] 59 | fn p2(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn p2(input: &Vec) -> usize { [INFO] [stdout] 59 + fn p2(input: &[u32]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day9.rs:101:25 [INFO] [stdout] | [INFO] [stdout] 101 | .filter(|index| !(fs_vec[*index] == ".".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(fs_vec[*index] != ".".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day18.rs:16:17 [INFO] [stdout] | [INFO] [stdout] 16 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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 creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day9.rs:101:45 [INFO] [stdout] | [INFO] [stdout] 101 | .filter(|index| !(fs_vec[*index] == ".".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"."` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day9.rs:106:22 [INFO] [stdout] | [INFO] [stdout] 106 | fn serialize(fs_vec: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 106 - fn serialize(fs_vec: &Vec) -> Vec { [INFO] [stdout] 106 + fn serialize(fs_vec: &[Block]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4.rs:88:26 [INFO] [stdout] | [INFO] [stdout] 88 | fn diagonal_ur_bl(input: &Vec, i: i64) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 88 - fn diagonal_ur_bl(input: &Vec, i: i64) -> String { [INFO] [stdout] 88 + fn diagonal_ur_bl(input: &[String], i: i64) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/bin/day4.rs:90:25 [INFO] [stdout] | [INFO] [stdout] 90 | let start_row = (i * -1) as usize; [INFO] [stdout] | ^^^^^^^^ help: consider using: `-i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [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/day4.rs:120:21 [INFO] [stdout] | [INFO] [stdout] 120 | fn count_xmas(line: &String) -> u64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 120 - fn count_xmas(line: &String) -> u64 { [INFO] [stdout] 120 + fn count_xmas(line: &str) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day16.rs:11:15 [INFO] [stdout] | [INFO] [stdout] 11 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 11 - match args().last() { [INFO] [stdout] 11 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day16.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day16.rs:13:29 [INFO] [stdout] | [INFO] [stdout] 13 | Some(x) if x == "test2".to_string() => "_test2", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `"test2"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day16.rs:19:17 [INFO] [stdout] | [INFO] [stdout] 19 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: unnecessary use of `get(&end).is_some()` [INFO] [stdout] --> src/bin/day18.rs:51:26 [INFO] [stdout] | [INFO] [stdout] 51 | if cost_by_field.get(&end).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&end)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/bin/day18.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | / if x.is_none() { [INFO] [stdout] 62 | | return None; [INFO] [stdout] 63 | | } [INFO] [stdout] | |_________^ help: replace it with: `x?;` [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: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day18.rs:72:16 [INFO] [stdout] | [INFO] [stdout] 72 | if !cost_by_field [INFO] [stdout] | ________________^ [INFO] [stdout] 73 | | .get(&neighbour) [INFO] [stdout] 74 | | .is_some_and(|neighbour_cost| *neighbour_cost < cost + 1) [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] 72 ~ if cost_by_field [INFO] [stdout] 73 + .get(&neighbour).is_none_or(|neighbour_cost| *neighbour_cost >= cost + 1) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:86:12 [INFO] [stdout] | [INFO] [stdout] 86 | input: &Vec<(usize, usize)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 86 - input: &Vec<(usize, usize)>, [INFO] [stdout] 86 + input: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day16.rs:23:26 [INFO] [stdout] | [INFO] [stdout] 23 | let start_position = (0..input.len()) [INFO] [stdout] | __________________________^ [INFO] [stdout] 24 | | .filter_map(|row| { [INFO] [stdout] 25 | | (0..input[row].len()) [INFO] [stdout] 26 | | .filter(|col| input[row][*col] == 'S') [INFO] [stdout] ... | [INFO] [stdout] 29 | | }) [INFO] [stdout] 30 | | .nth(0) [INFO] [stdout] | |_______________^ [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] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 23 ~ let start_position = (0..input.len()) [INFO] [stdout] 24 + .filter_map(|row| { [INFO] [stdout] 25 + (0..input[row].len()) [INFO] [stdout] 26 + .filter(|col| input[row][*col] == 'S') [INFO] [stdout] 27 + .nth(0) [INFO] [stdout] 28 + .map(|col| (row, col)) [INFO] [stdout] 29 + }).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day16.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | / (0..input[row].len()) [INFO] [stdout] 26 | | .filter(|col| input[row][*col] == 'S') [INFO] [stdout] 27 | | .nth(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 25 ~ (0..input[row].len()) [INFO] [stdout] 26 + .filter(|col| input[row][*col] == 'S').next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day16.rs:33:28 [INFO] [stdout] | [INFO] [stdout] 33 | let target_position1 = (0..input.len()) [INFO] [stdout] | ____________________________^ [INFO] [stdout] 34 | | .filter_map(|row| { [INFO] [stdout] 35 | | (0..input[row].len()) [INFO] [stdout] 36 | | .filter(|col| input[row][*col] == 'E') [INFO] [stdout] ... | [INFO] [stdout] 39 | | }) [INFO] [stdout] 40 | | .nth(0) [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 33 ~ let target_position1 = (0..input.len()) [INFO] [stdout] 34 + .filter_map(|row| { [INFO] [stdout] 35 + (0..input[row].len()) [INFO] [stdout] 36 + .filter(|col| input[row][*col] == 'E') [INFO] [stdout] 37 + .nth(0) [INFO] [stdout] 38 + .map(|col| (row, col)) [INFO] [stdout] 39 + }).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day16.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | / (0..input[row].len()) [INFO] [stdout] 36 | | .filter(|col| input[row][*col] == 'E') [INFO] [stdout] 37 | | .nth(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 35 ~ (0..input[row].len()) [INFO] [stdout] 36 + .filter(|col| input[row][*col] == 'E').next() [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/day18.rs:112:27 [INFO] [stdout] | [INFO] [stdout] 112 | fn _vizualize_maze(input: &Vec<(usize, usize)>, dimensions: (usize, usize)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 112 - fn _vizualize_maze(input: &Vec<(usize, usize)>, dimensions: (usize, usize)) { [INFO] [stdout] 112 + fn _vizualize_maze(input: &[(usize, usize)], dimensions: (usize, usize)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:55:16 [INFO] [stdout] | [INFO] [stdout] 55 | for row in 0..input.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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 55 - for row in 0..input.len() { [INFO] [stdout] 55 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day18.rs:127:14 [INFO] [stdout] | [INFO] [stdout] 127 | fn p2(input: &Vec<(usize, usize)>, dimensions: (usize, usize)) -> (usize, usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 127 - fn p2(input: &Vec<(usize, usize)>, dimensions: (usize, usize)) -> (usize, usize) { [INFO] [stdout] 127 + fn p2(input: &[(usize, usize)], dimensions: (usize, usize)) -> (usize, usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:77:6 [INFO] [stdout] | [INFO] [stdout] 77 | ) -> HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)> { [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: called `unwrap` on `maybe_entry` after checking its variant with `is_none` [INFO] [stdout] --> src/bin/day16.rs:110:49 [INFO] [stdout] | [INFO] [stdout] 101 | if maybe_entry.is_none() [INFO] [stdout] | --------------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 110 | let mut possible_predecessors = maybe_entry.unwrap().1.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:76:23 [INFO] [stdout] | [INFO] [stdout] 76 | target_positions: &Vec<(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] 76 - target_positions: &Vec<(usize, usize, char)>, [INFO] [stdout] 76 + target_positions: &[(usize, usize, char)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day11.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day11.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day11.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:78:31 [INFO] [stdout] | [INFO] [stdout] 78 | let mut cost_by_position: HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)> = [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] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&target_positions[0]).is_some()` [INFO] [stdout] --> src/bin/day16.rs:84:29 [INFO] [stdout] | [INFO] [stdout] 84 | if cost_by_position.get(&target_positions[0]).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&target_positions[0])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(&target_positions[1]).is_some()` [INFO] [stdout] --> src/bin/day16.rs:85:33 [INFO] [stdout] | [INFO] [stdout] 85 | || cost_by_position.get(&target_positions[1]).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(&target_positions[1])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day11.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | fn blink(stones: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 21 ~ fn blink(stones: &[u64]) -> Vec { [INFO] [stdout] 22 ~ let mut new_stones = stones.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/day11.rs:27:19 [INFO] [stdout] | [INFO] [stdout] 27 | } else if stone.to_string().len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `stone.to_string().len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:131:23 [INFO] [stdout] | [INFO] [stdout] 131 | cost_by_position: &HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)>, [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day11.rs:48:14 [INFO] [stdout] | [INFO] [stdout] 48 | fn p1(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 48 ~ fn p1(input: &[u64]) -> usize { [INFO] [stdout] 49 ~ let mut stones = input.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:132:20 [INFO] [stdout] | [INFO] [stdout] 132 | current_point: ((usize, usize, char), (u64, Vec<(usize, usize, char)>)), [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:130:12 [INFO] [stdout] | [INFO] [stdout] 130 | input: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 130 - input: &Vec>, [INFO] [stdout] 130 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day2.rs:7:21 [INFO] [stdout] | [INFO] [stdout] 7 | .filter(|l| l.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.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: the loop variable `row` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:139:16 [INFO] [stdout] | [INFO] [stdout] 139 | for row in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 139 - for row in 0..input.len() { [INFO] [stdout] 139 + for (row, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:140:20 [INFO] [stdout] | [INFO] [stdout] 140 | for col in 0..input[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 140 - for col in 0..input[row].len() { [INFO] [stdout] 140 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [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/day2.rs:18:14 [INFO] [stdout] | [INFO] [stdout] 18 | fn p1(input: &Vec>) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 18 - fn p1(input: &Vec>) { [INFO] [stdout] 18 + fn p1(input: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day2.rs:27:31 [INFO] [stdout] | [INFO] [stdout] 27 | fn is_safe_increasing(levels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 27 - fn is_safe_increasing(levels: &Vec) -> bool { [INFO] [stdout] 27 + fn is_safe_increasing(levels: &[i64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `levels.get(0)` [INFO] [stdout] --> src/bin/day2.rs:28:29 [INFO] [stdout] | [INFO] [stdout] 28 | if let Some(mut prev) = levels.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `levels.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day2.rs:43:31 [INFO] [stdout] | [INFO] [stdout] 43 | fn is_safe_decreasing(levels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 43 - fn is_safe_decreasing(levels: &Vec) -> bool { [INFO] [stdout] 43 + fn is_safe_decreasing(levels: &[i64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `levels.get(0)` [INFO] [stdout] --> src/bin/day2.rs:44:29 [INFO] [stdout] | [INFO] [stdout] 44 | if let Some(mut prev) = levels.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `levels.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day2.rs:67:35 [INFO] [stdout] | [INFO] [stdout] 67 | fn is_safe_with_dampening(levels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 67 - fn is_safe_with_dampening(levels: &Vec) -> bool { [INFO] [stdout] 67 + fn is_safe_with_dampening(levels: &[i64]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `levels.get(0)` [INFO] [stdout] --> src/bin/day2.rs:68:27 [INFO] [stdout] | [INFO] [stdout] 68 | if let Some(_first) = levels.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `levels.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:154:20 [INFO] [stdout] | [INFO] [stdout] 154 | for col in 0..input[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 154 - for col in 0..input[row].len() { [INFO] [stdout] 154 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:168:20 [INFO] [stdout] | [INFO] [stdout] 168 | for col in 0..input[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 168 - for col in 0..input[row].len() { [INFO] [stdout] 168 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `col` is used to index `input` [INFO] [stdout] --> src/bin/day16.rs:182:20 [INFO] [stdout] | [INFO] [stdout] 182 | for col in 0..input[row].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 182 - for col in 0..input[row].len() { [INFO] [stdout] 182 + for (col, ) in input.iter().enumerate().take(input[row].len()) { [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/day16.rs:204:12 [INFO] [stdout] | [INFO] [stdout] 204 | input: &Vec>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 204 - input: &Vec>, [INFO] [stdout] 204 + input: &[Vec], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day16.rs:236:20 [INFO] [stdout] | [INFO] [stdout] 236 | cost_by_point: &HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)>, [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:237:23 [INFO] [stdout] | [INFO] [stdout] 237 | target_positions: &Vec<(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] help: change this to [INFO] [stdout] | [INFO] [stdout] 237 - target_positions: &Vec<(usize, usize, char)>, [INFO] [stdout] 237 + target_positions: &[(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/day16.rs:251:20 [INFO] [stdout] | [INFO] [stdout] 251 | cost_by_point: &HashMap<(usize, usize, char), (u64, Vec<(usize, usize, char)>)>, [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day16.rs:252:23 [INFO] [stdout] | [INFO] [stdout] 252 | target_positions: &Vec<(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] help: change this to [INFO] [stdout] | [INFO] [stdout] 252 - target_positions: &Vec<(usize, usize, char)>, [INFO] [stdout] 252 + target_positions: &[(usize, usize, char)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/day11.rs:77:15 [INFO] [stdout] | [INFO] [stdout] 77 | } else if stone.to_string().len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `stone.to_string().len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day13.rs:4:16 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec<((u64, u64), (u64, u64), (u64, u64))> = read_to_string(format!( [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: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day13.rs:4:60 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec<((u64, u64), (u64, u64), (u64, u64))> = read_to_string(format!( [INFO] [stdout] | ____________________________________________________________^ [INFO] [stdout] 5 | | "inputs/day13{}", [INFO] [stdout] 6 | | match args().last() { [INFO] [stdout] 7 | | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] ... | [INFO] [stdout] 12 | | .to_string() [INFO] [stdout] 13 | | .split("\n\n") [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4 ~ let input: Vec<((u64, u64), (u64, u64), (u64, u64))> = read_to_string(format!( [INFO] [stdout] 5 + "inputs/day13{}", [INFO] [stdout] 6 + match args().last() { [INFO] [stdout] 7 + Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] 8 + _ => "", [INFO] [stdout] 9 + } [INFO] [stdout] 10 + )) [INFO] [stdout] 11 + .unwrap().split("\n\n") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day17.rs:7:15 [INFO] [stdout] | [INFO] [stdout] 7 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 7 - match args().last() { [INFO] [stdout] 7 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day17.rs:8:29 [INFO] [stdout] | [INFO] [stdout] 8 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day17.rs:9:29 [INFO] [stdout] | [INFO] [stdout] 9 | Some(x) if x == "test2".to_string() => "_test2", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `"test2"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day17.rs:18:21 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day13.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day13.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17.rs:39:46 [INFO] [stdout] | [INFO] [stdout] 39 | fn p1(r_a: u64, r_b: u64, r_c: u64, program: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - fn p1(r_a: u64, r_b: u64, r_c: u64, program: &Vec) -> String { [INFO] [stdout] 39 + fn p1(r_a: u64, r_b: u64, r_c: u64, program: &[usize]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17.rs:56:17 [INFO] [stdout] | [INFO] [stdout] 56 | b = b ^ operand as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `b ^= operand as u64` [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/day17.rs:69:17 [INFO] [stdout] | [INFO] [stdout] 69 | b = b ^ c; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `b ^= c` [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: length comparison to zero [INFO] [stdout] --> src/bin/day13.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day13.rs:18:25 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day13.rs:90:14 [INFO] [stdout] | [INFO] [stdout] 90 | fn p1(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day13.rs:90:14 [INFO] [stdout] | [INFO] [stdout] 90 | fn p1(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 90 - fn p1(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [INFO] [stdout] 90 + fn p1(input: &[((u64, u64), (u64, u64), (u64, u64))]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/bin/day13.rs:99:10 [INFO] [stdout] | [INFO] [stdout] 99 | .filter(|x| x.is_some()) [INFO] [stdout] | __________^ [INFO] [stdout] 100 | | .map(|x| x.unwrap()) [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day13.rs:105:14 [INFO] [stdout] | [INFO] [stdout] 105 | fn p2(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day13.rs:105:14 [INFO] [stdout] | [INFO] [stdout] 105 | fn p2(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 105 - fn p2(input: &Vec<((u64, u64), (u64, u64), (u64, u64))>) -> u64 { [INFO] [stdout] 105 + fn p2(input: &[((u64, u64), (u64, u64), (u64, u64))]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/bin/day13.rs:121:10 [INFO] [stdout] | [INFO] [stdout] 121 | .filter(|x| x.is_some()) [INFO] [stdout] | __________^ [INFO] [stdout] 122 | | .map(|x| x.unwrap()) [INFO] [stdout] | |____________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day1.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | .filter(|l| l.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.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: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day1.rs:40:37 [INFO] [stdout] | [INFO] [stdout] 40 | .and_modify(|count| *count = *count + 1) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `*count += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day3.rs:9:14 [INFO] [stdout] | [INFO] [stdout] 9 | fn p1(input: &String) -> u64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 9 - fn p1(input: &String) -> u64 { [INFO] [stdout] 9 + fn p1(input: &str) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day3.rs:38:14 [INFO] [stdout] | [INFO] [stdout] 38 | fn p2(input: &String) -> u64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn p2(input: &String) -> u64 { [INFO] [stdout] 38 + fn p2(input: &str) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day8.rs:9:21 [INFO] [stdout] | [INFO] [stdout] 9 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day8.rs:41:28 [INFO] [stdout] | [INFO] [stdout] 41 | fn _vizualize(input_lines: &Vec, antinodes: &HashSet<(usize, usize)>) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 41 - fn _vizualize(input_lines: &Vec, antinodes: &HashSet<(usize, usize)>) { [INFO] [stdout] 41 + fn _vizualize(input_lines: &[String], antinodes: &HashSet<(usize, usize)>) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/day8.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `input_lines` [INFO] [stdout] --> src/bin/day8.rs:43:16 [INFO] [stdout] | [INFO] [stdout] 43 | for row in 0..input_lines.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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 43 - for row in 0..input_lines.len() { [INFO] [stdout] 43 + for (row, ) in input_lines.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/day8.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | println!("") [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `println!` [INFO] [stdout] --> src/bin/day8.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day8.rs:61:55 [INFO] [stdout] | [INFO] [stdout] 61 | fn get_occuring_indices(character: char, input_lines: &Vec) -> Vec<(usize, usize)> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 61 - fn get_occuring_indices(character: char, input_lines: &Vec) -> Vec<(usize, usize)> { [INFO] [stdout] 61 + fn get_occuring_indices(character: char, input_lines: &[String]) -> Vec<(usize, usize)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/dayN.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/dayN.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/dayN.rs:13:17 [INFO] [stdout] | [INFO] [stdout] 13 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day7.rs:4:39 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec<(i64, Vec)> = read_to_string("inputs/day7") [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 5 | | .unwrap() [INFO] [stdout] 6 | | .to_string() [INFO] [stdout] 7 | | .split('\n') [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4 ~ let input: Vec<(i64, Vec)> = read_to_string("inputs/day7") [INFO] [stdout] 5 + .unwrap().split('\n') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day7.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 23 | fn p1(input: &Vec<(i64, Vec)>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 23 - fn p1(input: &Vec<(i64, Vec)>) -> i64 { [INFO] [stdout] 23 + fn p1(input: &[(i64, Vec)]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:44:20 [INFO] [stdout] | [INFO] [stdout] 44 | fn get_value(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - fn get_value(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] 44 + fn get_value(nums: &[i64], mask: &Vec) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:44:37 [INFO] [stdout] | [INFO] [stdout] 44 | fn get_value(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - fn get_value(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] 44 + fn get_value(nums: &Vec, mask: &[bool]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:66:14 [INFO] [stdout] | [INFO] [stdout] 66 | fn p2(input: &Vec<(i64, Vec)>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 66 - fn p2(input: &Vec<(i64, Vec)>) -> i64 { [INFO] [stdout] 66 + fn p2(input: &[(i64, Vec)]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:88:21 [INFO] [stdout] | [INFO] [stdout] 88 | fn get_value2(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 88 - fn get_value2(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] 88 + fn get_value2(nums: &[i64], mask: &Vec) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:88:38 [INFO] [stdout] | [INFO] [stdout] 88 | fn get_value2(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 88 - fn get_value2(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] 88 + fn get_value2(nums: &Vec, mask: &[u8]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the method `push_str` doesn't need a mutable reference [INFO] [stdout] --> src/bin/day7.rs:100:28 [INFO] [stdout] | [INFO] [stdout] 100 | x.push_str(&mut nums[index + 1].to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 100 - x.push_str(&mut nums[index + 1].to_string()); [INFO] [stdout] 100 + x.push_str(&nums[index + 1].to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day9.rs:34:12 [INFO] [stdout] | [INFO] [stdout] 34 | if !(fs_vec[i] == ".") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `(fs_vec[i] != ".")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day9.rs:14:14 [INFO] [stdout] | [INFO] [stdout] 14 | fn p1(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 14 - fn p1(input: &Vec) -> usize { [INFO] [stdout] 14 + fn p1(input: &[u32]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day9.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | i = i + 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `i += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day9.rs:39:13 [INFO] [stdout] | [INFO] [stdout] 39 | j = j - 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `j -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day9.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | i = i + 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `i += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day9.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | j = j - 1; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `j -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day9.rs:49:25 [INFO] [stdout] | [INFO] [stdout] 49 | .filter(|index| !(fs_vec[*index] == ".".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(fs_vec[*index] != ".".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day9.rs:49:45 [INFO] [stdout] | [INFO] [stdout] 49 | .filter(|index| !(fs_vec[*index] == ".".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"."` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day9.rs:59:14 [INFO] [stdout] | [INFO] [stdout] 59 | fn p2(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn p2(input: &Vec) -> usize { [INFO] [stdout] 59 + fn p2(input: &[u32]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/day9.rs:101:25 [INFO] [stdout] | [INFO] [stdout] 101 | .filter(|index| !(fs_vec[*index] == ".".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(fs_vec[*index] != ".".to_string())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day9.rs:101:45 [INFO] [stdout] | [INFO] [stdout] 101 | .filter(|index| !(fs_vec[*index] == ".".to_string())) [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `"."` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day9.rs:106:22 [INFO] [stdout] | [INFO] [stdout] 106 | fn serialize(fs_vec: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 106 - fn serialize(fs_vec: &Vec) -> Vec { [INFO] [stdout] 106 + fn serialize(fs_vec: &[Block]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day19.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day19.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day19.rs:16:21 [INFO] [stdout] | [INFO] [stdout] 16 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day19.rs:23:21 [INFO] [stdout] | [INFO] [stdout] 23 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day19.rs:29:39 [INFO] [stdout] | [INFO] [stdout] 29 | fn p1(towels: &Vec, patterns: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - fn p1(towels: &Vec, patterns: &Vec) -> usize { [INFO] [stdout] 29 + fn p1(towels: &Vec, patterns: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day19.rs:36:25 [INFO] [stdout] | [INFO] [stdout] 36 | fn satisfiable(pattern: &String, towels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 36 - fn satisfiable(pattern: &String, towels: &Vec) -> bool { [INFO] [stdout] 36 + fn satisfiable(pattern: &str, towels: &Vec) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day19.rs:75:39 [INFO] [stdout] | [INFO] [stdout] 75 | fn p2(towels: &Vec, patterns: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 75 - fn p2(towels: &Vec, patterns: &Vec) -> usize { [INFO] [stdout] 75 + fn p2(towels: &Vec, patterns: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/dayN.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day3.rs:9:14 [INFO] [stdout] | [INFO] [stdout] 9 | fn p1(input: &String) -> u64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 9 - fn p1(input: &String) -> u64 { [INFO] [stdout] 9 + fn p1(input: &str) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/dayN.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/dayN.rs:13:17 [INFO] [stdout] | [INFO] [stdout] 13 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day3.rs:38:14 [INFO] [stdout] | [INFO] [stdout] 38 | fn p2(input: &String) -> u64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn p2(input: &String) -> u64 { [INFO] [stdout] 38 + fn p2(input: &str) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day6.rs:4:30 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec = read_to_string("inputs/day6") [INFO] [stdout] | ______________________________^ [INFO] [stdout] 5 | | .unwrap() [INFO] [stdout] 6 | | .to_string() [INFO] [stdout] 7 | | .split('\n') [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4 ~ let input: Vec = read_to_string("inputs/day6") [INFO] [stdout] 5 + .unwrap().split('\n') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day6.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day6.rs:11:29 [INFO] [stdout] | [INFO] [stdout] 11 | let starting_position = (0..input.len()) [INFO] [stdout] | _____________________________^ [INFO] [stdout] 12 | | .map(|row| (row, input[row].find('^'))) [INFO] [stdout] 13 | | .filter(|(_, col)| col.is_some()) [INFO] [stdout] 14 | | .map(|(row, col)| (row, col.unwrap())) [INFO] [stdout] 15 | | .nth(0) [INFO] [stdout] | |_______________^ [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] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 11 ~ let starting_position = (0..input.len()) [INFO] [stdout] 12 + .map(|row| (row, input[row].find('^'))) [INFO] [stdout] 13 + .filter(|(_, col)| col.is_some()) [INFO] [stdout] 14 + .map(|(row, col)| (row, col.unwrap())).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `obstacle` after checking its variant with `is_none` [INFO] [stdout] --> src/bin/day6.rs:54:28 [INFO] [stdout] | [INFO] [stdout] 46 | if obstacle.is_none() { [INFO] [stdout] | --------------------- help: try: `if let Some() = obstacle` [INFO] [stdout] ... [INFO] [stdout] 54 | let obstacle = obstacle.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:30:12 [INFO] [stdout] | [INFO] [stdout] 30 | input: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 - input: &Vec, [INFO] [stdout] 30 + input: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day6.rs:35:24 [INFO] [stdout] | [INFO] [stdout] 35 | let mut position = starting_position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*starting_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` 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/day6.rs:45:59 [INFO] [stdout] | [INFO] [stdout] 45 | let obstacle = find_obstacle(position, direction, &obstacles); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `obstacles` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | input: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 76 - input: &Vec, [INFO] [stdout] 76 + input: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | obstacles: &Vec<(usize, usize)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 141 - obstacles: &Vec<(usize, usize)>, [INFO] [stdout] 141 + obstacles: &[(usize, usize)], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `obstacle` after checking its variant with `is_none` [INFO] [stdout] --> src/bin/day6.rs:198:36 [INFO] [stdout] | [INFO] [stdout] 195 | if obstacle.is_none() { [INFO] [stdout] | --------------------- help: try: `if let Some() = obstacle` [INFO] [stdout] ... [INFO] [stdout] 198 | let obstacle = obstacle.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:169:12 [INFO] [stdout] | [INFO] [stdout] 169 | input: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 169 - input: &Vec, [INFO] [stdout] 169 + input: &[String], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day6.rs:171:16 [INFO] [stdout] | [INFO] [stdout] 171 | obstacles: &Vec<(usize, usize)>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 171 ~ obstacles: &[(usize, usize)], [INFO] [stdout] 172 | ) -> u64 { [INFO] [stdout] ... [INFO] [stdout] 183 | let new_obstacle = (row, col); [INFO] [stdout] 184 ~ let mut new_obstacles = obstacles.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day11.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day11.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize)` which implements the `Copy` trait [INFO] [stdout] --> src/bin/day6.rs:188:32 [INFO] [stdout] | [INFO] [stdout] 188 | let mut position = starting_position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*starting_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day11.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day11.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | fn blink(stones: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 21 ~ fn blink(stones: &[u64]) -> Vec { [INFO] [stdout] 22 ~ let mut new_stones = stones.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/day11.rs:27:19 [INFO] [stdout] | [INFO] [stdout] 27 | } else if stone.to_string().len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `stone.to_string().len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day11.rs:48:14 [INFO] [stdout] | [INFO] [stdout] 48 | fn p1(input: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 48 ~ fn p1(input: &[u64]) -> usize { [INFO] [stdout] 49 ~ let mut stones = input.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/day11.rs:77:15 [INFO] [stdout] | [INFO] [stdout] 77 | } else if stone.to_string().len() % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `stone.to_string().len().is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day7.rs:4:39 [INFO] [stdout] | [INFO] [stdout] 4 | let input: Vec<(i64, Vec)> = read_to_string("inputs/day7") [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 5 | | .unwrap() [INFO] [stdout] 6 | | .to_string() [INFO] [stdout] 7 | | .split('\n') [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 4 ~ let input: Vec<(i64, Vec)> = read_to_string("inputs/day7") [INFO] [stdout] 5 + .unwrap().split('\n') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day7.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 8 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:23:14 [INFO] [stdout] | [INFO] [stdout] 23 | fn p1(input: &Vec<(i64, Vec)>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 23 - fn p1(input: &Vec<(i64, Vec)>) -> i64 { [INFO] [stdout] 23 + fn p1(input: &[(i64, Vec)]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:44:20 [INFO] [stdout] | [INFO] [stdout] 44 | fn get_value(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - fn get_value(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] 44 + fn get_value(nums: &[i64], mask: &Vec) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:44:37 [INFO] [stdout] | [INFO] [stdout] 44 | fn get_value(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 44 - fn get_value(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] 44 + fn get_value(nums: &Vec, mask: &[bool]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:66:14 [INFO] [stdout] | [INFO] [stdout] 66 | fn p2(input: &Vec<(i64, Vec)>) -> i64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 66 - fn p2(input: &Vec<(i64, Vec)>) -> i64 { [INFO] [stdout] 66 + fn p2(input: &[(i64, Vec)]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:88:21 [INFO] [stdout] | [INFO] [stdout] 88 | fn get_value2(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 88 - fn get_value2(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] 88 + fn get_value2(nums: &[i64], mask: &Vec) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day7.rs:88:38 [INFO] [stdout] | [INFO] [stdout] 88 | fn get_value2(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 88 - fn get_value2(nums: &Vec, mask: &Vec) -> i64 { [INFO] [stdout] 88 + fn get_value2(nums: &Vec, mask: &[u8]) -> i64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the method `push_str` doesn't need a mutable reference [INFO] [stdout] --> src/bin/day7.rs:100:28 [INFO] [stdout] | [INFO] [stdout] 100 | x.push_str(&mut nums[index + 1].to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 100 - x.push_str(&mut nums[index + 1].to_string()); [INFO] [stdout] 100 + x.push_str(&nums[index + 1].to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day5.rs:17:21 [INFO] [stdout] | [INFO] [stdout] 17 | .filter(|l| l.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day5.rs:25:21 [INFO] [stdout] | [INFO] [stdout] 25 | .filter(|l| l.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!l.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:38:18 [INFO] [stdout] | [INFO] [stdout] 38 | fn p1(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn p1(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] 38 + fn p1(orderings: &[Ordering], updates: &Vec>) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:38:43 [INFO] [stdout] | [INFO] [stdout] 38 | fn p1(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 38 - fn p1(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] 38 + fn p1(orderings: &Vec, updates: &[Vec]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day19.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 6 - match args().last() { [INFO] [stdout] 6 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day19.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day19.rs:16:21 [INFO] [stdout] | [INFO] [stdout] 16 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day19.rs:23:21 [INFO] [stdout] | [INFO] [stdout] 23 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day19.rs:29:39 [INFO] [stdout] | [INFO] [stdout] 29 | fn p1(towels: &Vec, patterns: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 29 - fn p1(towels: &Vec, patterns: &Vec) -> usize { [INFO] [stdout] 29 + fn p1(towels: &Vec, patterns: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day19.rs:36:25 [INFO] [stdout] | [INFO] [stdout] 36 | fn satisfiable(pattern: &String, towels: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 36 - fn satisfiable(pattern: &String, towels: &Vec) -> bool { [INFO] [stdout] 36 + fn satisfiable(pattern: &str, towels: &Vec) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day19.rs:75:39 [INFO] [stdout] | [INFO] [stdout] 75 | fn p2(towels: &Vec, patterns: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 75 - fn p2(towels: &Vec, patterns: &Vec) -> usize { [INFO] [stdout] 75 + fn p2(towels: &Vec, patterns: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:54:43 [INFO] [stdout] | [INFO] [stdout] 54 | fn p2(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn p2(orderings: &Vec, updates: &Vec>) -> u64 { [INFO] [stdout] 54 + fn p2(orderings: &Vec, updates: &[Vec]) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:71:28 [INFO] [stdout] | [INFO] [stdout] 71 | fn fix_ordering(orderings: &Vec, update: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - fn fix_ordering(orderings: &Vec, update: &Vec) -> Vec { [INFO] [stdout] 71 + fn fix_ordering(orderings: &[Ordering], update: &Vec) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day5.rs:71:52 [INFO] [stdout] | [INFO] [stdout] 71 | fn fix_ordering(orderings: &Vec, update: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 71 - fn fix_ordering(orderings: &Vec, update: &Vec) -> Vec { [INFO] [stdout] 71 + fn fix_ordering(orderings: &Vec, update: &[u64]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day14.rs:4:28 [INFO] [stdout] | [INFO] [stdout] 4 | let field_size = match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4 - let field_size = match args().last() { [INFO] [stdout] 4 + let field_size = match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day14.rs:5:25 [INFO] [stdout] | [INFO] [stdout] 5 | Some(x) if x == "test".to_string() => (11, 7), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day14.rs:11:15 [INFO] [stdout] | [INFO] [stdout] 11 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 11 - match args().last() { [INFO] [stdout] 11 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day14.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day14.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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 call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/bin/day14.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | i64::from_str_radix(x, 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/bin/day14.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | i64::from_str_radix(y, 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `y.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day17.rs:7:15 [INFO] [stdout] | [INFO] [stdout] 7 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 7 - match args().last() { [INFO] [stdout] 7 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/bin/day14.rs:39:17 [INFO] [stdout] | [INFO] [stdout] 39 | i64::from_str_radix(v_x, 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v_x.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/bin/day14.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | i64::from_str_radix(v_y, 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v_y.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day14.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 49 | fn p1(input: &Vec<((i64, i64), (i64, i64))>, field_size: (i64, i64)) -> 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: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day17.rs:8:29 [INFO] [stdout] | [INFO] [stdout] 8 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day14.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | input: &Vec<((i64, i64), (i64, i64))>, [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | input: &Vec<((i64, i64), (i64, i64))>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 76 - input: &Vec<((i64, i64), (i64, i64))>, [INFO] [stdout] 76 + input: &[((i64, i64), (i64, i64))], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:100:48 [INFO] [stdout] | [INFO] [stdout] 100 | fn visualize(field_size: (i64, i64), position: &Vec<(i64, i64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - fn visualize(field_size: (i64, i64), position: &Vec<(i64, i64)>) { [INFO] [stdout] 100 + fn visualize(field_size: (i64, i64), position: &[(i64, i64)]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day14.rs:114:14 [INFO] [stdout] | [INFO] [stdout] 114 | fn p2(input: &Vec<((i64, i64), (i64, i64))>, field_size: (i64, i64)) -> u64 { [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] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day17.rs:9:29 [INFO] [stdout] | [INFO] [stdout] 9 | Some(x) if x == "test2".to_string() => "_test2", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `"test2"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day17.rs:18:21 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:132:32 [INFO] [stdout] | [INFO] [stdout] 132 | fn has_some_diagonal(position: &Vec<(i64, i64)>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 132 - fn has_some_diagonal(position: &Vec<(i64, i64)>) -> bool { [INFO] [stdout] 132 + fn has_some_diagonal(position: &[(i64, i64)]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day17.rs:39:46 [INFO] [stdout] | [INFO] [stdout] 39 | fn p1(r_a: u64, r_b: u64, r_c: u64, program: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - fn p1(r_a: u64, r_b: u64, r_c: u64, program: &Vec) -> String { [INFO] [stdout] 39 + fn p1(r_a: u64, r_b: u64, r_c: u64, program: &[usize]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/day17.rs:56:17 [INFO] [stdout] | [INFO] [stdout] 56 | b = b ^ operand as u64; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `b ^= operand as u64` [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/day17.rs:69:17 [INFO] [stdout] | [INFO] [stdout] 69 | b = b ^ c; [INFO] [stdout] | ^^^^^^^^^ help: replace it with: `b ^= c` [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: unnecessary use of `to_string` [INFO] [stdout] --> src/bin/day12.rs:8:30 [INFO] [stdout] | [INFO] [stdout] 8 | let input: Vec = read_to_string(format!( [INFO] [stdout] | ______________________________^ [INFO] [stdout] 9 | | "inputs/day12{}", [INFO] [stdout] 10 | | match args().last() { [INFO] [stdout] 11 | | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] ... | [INFO] [stdout] 16 | | .to_string() [INFO] [stdout] 17 | | .split('\n') [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 8 ~ let input: Vec = read_to_string(format!( [INFO] [stdout] 9 + "inputs/day12{}", [INFO] [stdout] 10 + match args().last() { [INFO] [stdout] 11 + Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] 12 + _ => "", [INFO] [stdout] 13 + } [INFO] [stdout] 14 + )) [INFO] [stdout] 15 + .unwrap().split('\n') [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day12.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 10 - match args().last() { [INFO] [stdout] 10 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day12.rs:11:29 [INFO] [stdout] | [INFO] [stdout] 11 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day12.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day12.rs:166:23 [INFO] [stdout] | [INFO] [stdout] 166 | fn get_char_at(input: &Vec, 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] 166 - fn get_char_at(input: &Vec, point: (usize, usize)) -> char { [INFO] [stdout] 166 + fn get_char_at(input: &[String], point: (usize, usize)) -> char { [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/day12.rs:170:16 [INFO] [stdout] | [INFO] [stdout] 170 | fn p1(regions: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 170 - fn p1(regions: &Vec) -> usize { [INFO] [stdout] 170 + fn p1(regions: &[Region]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day12.rs:181:44 [INFO] [stdout] | [INFO] [stdout] 181 | region_by_field.insert(*field, ®ion); [INFO] [stdout] | ^^^^^^^ help: change this to: `region` [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: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day14.rs:4:28 [INFO] [stdout] | [INFO] [stdout] 4 | let field_size = match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 4 - let field_size = match args().last() { [INFO] [stdout] 4 + let field_size = match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day14.rs:5:25 [INFO] [stdout] | [INFO] [stdout] 5 | Some(x) if x == "test".to_string() => (11, 7), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day14.rs:11:15 [INFO] [stdout] | [INFO] [stdout] 11 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 11 - match args().last() { [INFO] [stdout] 11 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day14.rs:12:29 [INFO] [stdout] | [INFO] [stdout] 12 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day14.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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 call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/bin/day14.rs:35:17 [INFO] [stdout] | [INFO] [stdout] 35 | i64::from_str_radix(x, 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `x.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] = note: `#[warn(clippy::from_str_radix_10)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/bin/day14.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | i64::from_str_radix(y, 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `y.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/bin/day14.rs:39:17 [INFO] [stdout] | [INFO] [stdout] 39 | i64::from_str_radix(v_x, 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v_x.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `from_str_radix` can be replaced with a call to `str::parse` [INFO] [stdout] --> src/bin/day14.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | i64::from_str_radix(v_y, 10).unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `v_y.parse::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day14.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 49 | fn p1(input: &Vec<((i64, i64), (i64, i64))>, field_size: (i64, i64)) -> 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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day14.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | input: &Vec<((i64, i64), (i64, i64))>, [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | input: &Vec<((i64, i64), (i64, i64))>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 76 - input: &Vec<((i64, i64), (i64, i64))>, [INFO] [stdout] 76 + input: &[((i64, i64), (i64, i64))], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:100:48 [INFO] [stdout] | [INFO] [stdout] 100 | fn visualize(field_size: (i64, i64), position: &Vec<(i64, i64)>) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 100 - fn visualize(field_size: (i64, i64), position: &Vec<(i64, i64)>) { [INFO] [stdout] 100 + fn visualize(field_size: (i64, i64), position: &[(i64, i64)]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day4.rs:7:24 [INFO] [stdout] | [INFO] [stdout] 7 | .filter(|line| 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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/bin/day14.rs:114:14 [INFO] [stdout] | [INFO] [stdout] 114 | fn p2(input: &Vec<((i64, i64), (i64, i64))>, field_size: (i64, i64)) -> u64 { [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] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/bin/day4.rs:19:47 [INFO] [stdout] | [INFO] [stdout] 19 | .map(|direction| direction.iter().map(|line| count_xmas(line)).sum::()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `count_xmas` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4.rs:39:18 [INFO] [stdout] | [INFO] [stdout] 39 | fn column(input: &Vec, i: usize) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 39 - fn column(input: &Vec, i: usize) -> String { [INFO] [stdout] 39 + fn column(input: &[String], i: usize) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/bin/day4.rs:47:6 [INFO] [stdout] | [INFO] [stdout] 47 | ((input.len() as i64 * -1) + 1..input[0].len() as i64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `-(input.len() as i64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/bin/day4.rs:53:6 [INFO] [stdout] | [INFO] [stdout] 53 | ((input.len() as i64 * -1) + 1..input[0].len() as i64) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `-(input.len() as i64)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4.rs:58:26 [INFO] [stdout] | [INFO] [stdout] 58 | fn diagonal_ul_br(input: &Vec, i: i64) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 58 - fn diagonal_ul_br(input: &Vec, i: i64) -> String { [INFO] [stdout] 58 + fn diagonal_ul_br(input: &[String], i: i64) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/bin/day4.rs:60:25 [INFO] [stdout] | [INFO] [stdout] 60 | let start_row = (i * -1) as usize; [INFO] [stdout] | ^^^^^^^^ help: consider using: `-i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4.rs:88:26 [INFO] [stdout] | [INFO] [stdout] 88 | fn diagonal_ur_bl(input: &Vec, i: i64) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 88 - fn diagonal_ur_bl(input: &Vec, i: i64) -> String { [INFO] [stdout] 88 + fn diagonal_ur_bl(input: &[String], i: i64) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/bin/day4.rs:90:25 [INFO] [stdout] | [INFO] [stdout] 90 | let start_row = (i * -1) as usize; [INFO] [stdout] | ^^^^^^^^ help: consider using: `-i` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day14.rs:132:32 [INFO] [stdout] | [INFO] [stdout] 132 | fn has_some_diagonal(position: &Vec<(i64, i64)>) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 132 - fn has_some_diagonal(position: &Vec<(i64, i64)>) -> bool { [INFO] [stdout] 132 + fn has_some_diagonal(position: &[(i64, i64)]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day4.rs:120:21 [INFO] [stdout] | [INFO] [stdout] 120 | fn count_xmas(line: &String) -> u64 { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 120 - fn count_xmas(line: &String) -> u64 { [INFO] [stdout] 120 + fn count_xmas(line: &str) -> u64 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:7:15 [INFO] [stdout] | [INFO] [stdout] 7 | match args().last() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 7 - match args().last() { [INFO] [stdout] 7 + match args().next_back() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/day15.rs:8:29 [INFO] [stdout] | [INFO] [stdout] 8 | Some(x) if x == "test".to_string() => "_test", [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"test"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/day15.rs:17:21 [INFO] [stdout] | [INFO] [stdout] 17 | .filter(|x| x.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!x.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | fn p1(maze: &Vec, moves: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 27 ~ fn p1(maze: &[String], moves: &Vec) -> usize { [INFO] [stdout] 28 | let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] 29 ~ let mut current_maze = maze.to_owned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:28:19 [INFO] [stdout] | [INFO] [stdout] 28 | let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 28 - let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] 28 + let is_test = args().next_back().is_some_and(|arg| arg.eq("test")); [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/day15.rs:47:16 [INFO] [stdout] | [INFO] [stdout] 47 | fn score(maze: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 47 - fn score(maze: &Vec) -> usize { [INFO] [stdout] 47 + fn score(maze: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:65:20 [INFO] [stdout] | [INFO] [stdout] 65 | let position = (0..maze.len()) [INFO] [stdout] | ____________________^ [INFO] [stdout] 66 | | .filter_map(|row| { [INFO] [stdout] 67 | | (0..maze[row].len()) [INFO] [stdout] 68 | | .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] ... | [INFO] [stdout] 71 | | }) [INFO] [stdout] 72 | | .nth(0) [INFO] [stdout] | |_______________^ [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] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 65 ~ let position = (0..maze.len()) [INFO] [stdout] 66 + .filter_map(|row| { [INFO] [stdout] 67 + (0..maze[row].len()) [INFO] [stdout] 68 + .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 69 + .map(|col| (row, col)) [INFO] [stdout] 70 + .nth(0) [INFO] [stdout] 71 + }).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:67:13 [INFO] [stdout] | [INFO] [stdout] 67 | / (0..maze[row].len()) [INFO] [stdout] 68 | | .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 69 | | .map(|col| (row, col)) [INFO] [stdout] 70 | | .nth(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 67 ~ (0..maze[row].len()) [INFO] [stdout] 68 + .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 69 + .map(|col| (row, col)).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:85:21 [INFO] [stdout] | [INFO] [stdout] 85 | let next_wall = row [INFO] [stdout] | _____________________^ [INFO] [stdout] 86 | | .match_indices('#') [INFO] [stdout] 87 | | .filter(|(index, _)| *index > position.1) [INFO] [stdout] 88 | | .map(|x| x.0) [INFO] [stdout] 89 | | .nth(0) [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 85 ~ let next_wall = row [INFO] [stdout] 86 + .match_indices('#') [INFO] [stdout] 87 + .filter(|(index, _)| *index > position.1) [INFO] [stdout] 88 + .map(|x| x.0).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:92:22 [INFO] [stdout] | [INFO] [stdout] 92 | let next_space = row [INFO] [stdout] | ______________________^ [INFO] [stdout] 93 | | .match_indices('.') [INFO] [stdout] 94 | | .filter(|(index, _)| *index > position.1 && *index < next_wall) [INFO] [stdout] 95 | | .map(|x| x.0) [INFO] [stdout] 96 | | .nth(0); [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 92 ~ let next_space = row [INFO] [stdout] 93 + .match_indices('.') [INFO] [stdout] 94 + .filter(|(index, _)| *index > position.1 && *index < next_wall) [INFO] [stdout] 95 ~ .map(|x| x.0).next(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | row[..position.1].to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[..position.1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:112:9 [INFO] [stdout] | [INFO] [stdout] 112 | row[next_space + 1..].to_string() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[next_space + 1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:169:19 [INFO] [stdout] | [INFO] [stdout] 169 | let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 169 - let is_test = args().last().is_some_and(|arg| arg.eq("test")); [INFO] [stdout] 169 + let is_test = args().next_back().is_some_and(|arg| arg.eq("test")); [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/day15.rs:195:20 [INFO] [stdout] | [INFO] [stdout] 195 | fn score_fat(maze: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 195 - fn score_fat(maze: &Vec) -> usize { [INFO] [stdout] 195 + fn score_fat(maze: &[String]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:213:20 [INFO] [stdout] | [INFO] [stdout] 213 | let position = (0..maze.len()) [INFO] [stdout] | ____________________^ [INFO] [stdout] 214 | | .filter_map(|row| { [INFO] [stdout] 215 | | (0..maze[row].len()) [INFO] [stdout] 216 | | .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] ... | [INFO] [stdout] 219 | | }) [INFO] [stdout] 220 | | .nth(0) [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 213 ~ let position = (0..maze.len()) [INFO] [stdout] 214 + .filter_map(|row| { [INFO] [stdout] 215 + (0..maze[row].len()) [INFO] [stdout] 216 + .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 217 + .map(|col| (row, col)) [INFO] [stdout] 218 + .nth(0) [INFO] [stdout] 219 + }).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:215:13 [INFO] [stdout] | [INFO] [stdout] 215 | / (0..maze[row].len()) [INFO] [stdout] 216 | | .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 217 | | .map(|col| (row, col)) [INFO] [stdout] 218 | | .nth(0) [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 215 ~ (0..maze[row].len()) [INFO] [stdout] 216 + .filter(|col| maze[row].chars().nth(*col) == Some('@')) [INFO] [stdout] 217 + .map(|col| (row, col)).next() [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/day15.rs:223:41 [INFO] [stdout] | [INFO] [stdout] 223 | '>' => push_fat_right(position, &mut maze), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day15.rs:224:40 [INFO] [stdout] | [INFO] [stdout] 224 | '<' => push_fat_left(position, &mut maze), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day15.rs:225:38 [INFO] [stdout] | [INFO] [stdout] 225 | '^' => push_fat_up(position, &mut maze), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/day15.rs:226:40 [INFO] [stdout] | [INFO] [stdout] 226 | 'v' => push_fat_down(position, &mut maze), [INFO] [stdout] | ^^^^^^^^^ help: change this to: `maze` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:231:51 [INFO] [stdout] | [INFO] [stdout] 231 | fn push_fat_right(position: (usize, usize), maze: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 231 - fn push_fat_right(position: (usize, usize), maze: &mut Vec) { [INFO] [stdout] 231 + fn push_fat_right(position: (usize, usize), maze: &mut [String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:233:21 [INFO] [stdout] | [INFO] [stdout] 233 | let next_wall = row [INFO] [stdout] | _____________________^ [INFO] [stdout] 234 | | .match_indices('#') [INFO] [stdout] 235 | | .filter(|(index, _)| *index > position.1) [INFO] [stdout] 236 | | .map(|x| x.0) [INFO] [stdout] 237 | | .nth(0) [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 233 ~ let next_wall = row [INFO] [stdout] 234 + .match_indices('#') [INFO] [stdout] 235 + .filter(|(index, _)| *index > position.1) [INFO] [stdout] 236 + .map(|x| x.0).next() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/bin/day15.rs:240:22 [INFO] [stdout] | [INFO] [stdout] 240 | let next_space = row [INFO] [stdout] | ______________________^ [INFO] [stdout] 241 | | .match_indices('.') [INFO] [stdout] 242 | | .filter(|(index, _)| *index > position.1 && *index < next_wall) [INFO] [stdout] 243 | | .map(|x| x.0) [INFO] [stdout] 244 | | .nth(0); [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] help: try calling `.next()` instead of `.nth(0)` [INFO] [stdout] | [INFO] [stdout] 240 ~ let next_space = row [INFO] [stdout] 241 + .match_indices('.') [INFO] [stdout] 242 + .filter(|(index, _)| *index > position.1 && *index < next_wall) [INFO] [stdout] 243 ~ .map(|x| x.0).next(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/bin/day15.rs:252:24 [INFO] [stdout] | [INFO] [stdout] 252 | .match_indices(|x| x == '[' || x == ']') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | row[..position.1].to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[..position.1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:260:9 [INFO] [stdout] | [INFO] [stdout] 260 | row[next_space + 1..].to_string() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[next_space + 1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:266:50 [INFO] [stdout] | [INFO] [stdout] 266 | fn push_fat_left(position: (usize, usize), maze: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 266 - fn push_fat_left(position: (usize, usize), maze: &mut Vec) { [INFO] [stdout] 266 + fn push_fat_left(position: (usize, usize), maze: &mut [String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:268:21 [INFO] [stdout] | [INFO] [stdout] 268 | let next_wall = row [INFO] [stdout] | _____________________^ [INFO] [stdout] 269 | | .match_indices('#') [INFO] [stdout] 270 | | .filter(|(index, _)| *index < position.1) [INFO] [stdout] 271 | | .map(|x| x.0) [INFO] [stdout] 272 | | .last() [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 272 - .last() [INFO] [stdout] 272 + .next_back() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/bin/day15.rs:275:22 [INFO] [stdout] | [INFO] [stdout] 275 | let next_space = row [INFO] [stdout] | ______________________^ [INFO] [stdout] 276 | | .match_indices('.') [INFO] [stdout] 277 | | .filter(|(index, _)| *index < position.1 && *index > next_wall) [INFO] [stdout] 278 | | .map(|x| x.0) [INFO] [stdout] 279 | | .last(); [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 279 - .last(); [INFO] [stdout] 279 + .next_back(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> src/bin/day15.rs:287:24 [INFO] [stdout] | [INFO] [stdout] 287 | .match_indices(|x| x == '[' || x == ']') [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an array of `char`: `['[', ']']` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:293:9 [INFO] [stdout] | [INFO] [stdout] 293 | row[..next_space].to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[..next_space]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/day15.rs:295:9 [INFO] [stdout] | [INFO] [stdout] 295 | row[position.1 + 1..].to_string() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&row[position.1 + 1..]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:301:50 [INFO] [stdout] | [INFO] [stdout] 301 | fn push_fat_up((row, col): (usize, usize), maze: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 301 - fn push_fat_up((row, col): (usize, usize), maze: &mut Vec) { [INFO] [stdout] 301 + fn push_fat_up((row, col): (usize, usize), maze: &mut [String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `prev_row[thing.1]` and `current_row[thing.1]` manually [INFO] [stdout] --> src/bin/day15.rs:342:13 [INFO] [stdout] | [INFO] [stdout] 342 | / let tmp = prev_row[thing.1]; [INFO] [stdout] 343 | | prev_row[thing.1] = current_row[thing.1]; [INFO] [stdout] 344 | | current_row[thing.1] = tmp; [INFO] [stdout] | |_______________________________________^ help: try: `std::mem::swap(&mut prev_row[thing.1], &mut current_row[thing.1]);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:351:52 [INFO] [stdout] | [INFO] [stdout] 351 | fn push_fat_down((row, col): (usize, usize), maze: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 351 - fn push_fat_down((row, col): (usize, usize), maze: &mut Vec) { [INFO] [stdout] 351 + fn push_fat_down((row, col): (usize, usize), maze: &mut [String]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `prev_row[thing.1]` and `current_row[thing.1]` manually [INFO] [stdout] --> src/bin/day15.rs:392:13 [INFO] [stdout] | [INFO] [stdout] 392 | / let tmp = prev_row[thing.1]; [INFO] [stdout] 393 | | prev_row[thing.1] = current_row[thing.1]; [INFO] [stdout] 394 | | current_row[thing.1] = tmp; [INFO] [stdout] | |_______________________________________^ help: try: `std::mem::swap(&mut prev_row[thing.1], &mut current_row[thing.1]);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/day15.rs:405:19 [INFO] [stdout] | [INFO] [stdout] 405 | fn make_fat(maze: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 405 - fn make_fat(maze: &Vec) -> Vec { [INFO] [stdout] 405 + fn make_fat(maze: &[String]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.87s [INFO] running `Command { std: "docker" "inspect" "545a88b6eaadfb55587d6861e526f0e37c328d31269c7fa654bf21c0da1f55a3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "545a88b6eaadfb55587d6861e526f0e37c328d31269c7fa654bf21c0da1f55a3", kill_on_drop: false }` [INFO] [stdout] 545a88b6eaadfb55587d6861e526f0e37c328d31269c7fa654bf21c0da1f55a3