[INFO] cloning repository https://github.com/phbruemmer/ASCII-PacMan [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/phbruemmer/ASCII-PacMan" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fphbruemmer%2FASCII-PacMan", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fphbruemmer%2FASCII-PacMan'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 23b0ba8082b3db4c53da26d507ffe7b49b7e34db [INFO] linting phbruemmer/ASCII-PacMan against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fphbruemmer%2FASCII-PacMan" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/phbruemmer/ASCII-PacMan [INFO] finished tweaking git repo https://github.com/phbruemmer/ASCII-PacMan [INFO] tweaked toml for git repo https://github.com/phbruemmer/ASCII-PacMan written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/phbruemmer/ASCII-PacMan 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/phbruemmer/ASCII-PacMan already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded coreaudio-sys v0.2.16 [INFO] [stderr] Downloaded bytemuck v1.18.0 [INFO] [stderr] Downloaded toml_edit v0.22.21 [INFO] [stderr] Downloaded winnow v0.6.18 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 199d94d2a18af2407ce25a8518a464075d03010d1ae6370de78d5c28d8312dcf [INFO] running `Command { std: "docker" "start" "-a" "199d94d2a18af2407ce25a8518a464075d03010d1ae6370de78d5c28d8312dcf", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "199d94d2a18af2407ce25a8518a464075d03010d1ae6370de78d5c28d8312dcf", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "199d94d2a18af2407ce25a8518a464075d03010d1ae6370de78d5c28d8312dcf", kill_on_drop: false }` [INFO] [stdout] 199d94d2a18af2407ce25a8518a464075d03010d1ae6370de78d5c28d8312dcf [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] edd1f77100fd75830a1cfe3a9f21bfad82f132736f6c1d55a1e6973b6412bb42 [INFO] running `Command { std: "docker" "start" "-a" "edd1f77100fd75830a1cfe3a9f21bfad82f132736f6c1d55a1e6973b6412bb42", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.158 [INFO] [stderr] Checking log v0.4.22 [INFO] [stderr] Compiling pkg-config v0.3.30 [INFO] [stderr] Checking bytemuck v1.18.0 [INFO] [stderr] Compiling signal-hook v0.3.17 [INFO] [stderr] Compiling syn v2.0.77 [INFO] [stderr] Compiling cpal v0.15.3 [INFO] [stderr] Checking ogg v0.8.0 [INFO] [stderr] Checking dasp_sample v0.11.0 [INFO] [stderr] Compiling rustix v0.38.37 [INFO] [stderr] Checking claxon v0.4.3 [INFO] [stderr] Checking symphonia-core v0.5.4 [INFO] [stderr] Checking lewton v0.10.2 [INFO] [stderr] Compiling alsa-sys v0.3.1 [INFO] [stderr] Checking hound v3.5.1 [INFO] [stderr] Checking colored v2.1.0 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking signal-hook-registry v1.4.2 [INFO] [stderr] Checking mio v1.0.2 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking signal-hook-mio v0.2.4 [INFO] [stderr] Checking alsa v0.9.1 [INFO] [stderr] Checking symphonia-metadata v0.5.4 [INFO] [stderr] Checking crossterm v0.28.1 [INFO] [stderr] Checking symphonia-bundle-mp3 v0.5.4 [INFO] [stderr] Checking symphonia v0.5.4 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Checking rodio v0.17.3 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Checking rusty_audio v1.4.1 [INFO] [stderr] Checking ppv-lite86 v0.2.20 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking ConsolePacman v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:64:41 [INFO] [stdout] | [INFO] [stdout] 64 | fn move_ghost(&mut self, obstacles: &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] 64 - fn move_ghost(&mut self, obstacles: &Vec>) { [INFO] [stdout] 64 + fn move_ghost(&mut self, obstacles: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:87:118 [INFO] [stdout] | [INFO] [stdout] 87 | ...& random_value == 0 && self.position[0] % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:90:118 [INFO] [stdout] | [INFO] [stdout] 90 | ...& random_value == 1 && self.position[0] % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:113:118 [INFO] [stdout] | [INFO] [stdout] 113 | ...& random_value == 0 && self.position[0] % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:116:118 [INFO] [stdout] | [INFO] [stdout] 116 | ...& random_value == 1 && self.position[0] % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:156:12 [INFO] [stdout] | [INFO] [stdout] 156 | if !(self.position[0] % 2 == 0) { return; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.position[0] % 2 != 0)` [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/main.rs:155:44 [INFO] [stdout] | [INFO] [stdout] 155 | fn queue_checker(&mut self, obstacles: &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] 155 ~ fn queue_checker(&mut self, obstacles: &[Vec]) { [INFO] [stdout] 156 | if !(self.position[0] % 2 == 0) { return; } [INFO] [stdout] 157 | let direction: u8 = self.direction_queue; [INFO] [stdout] 158 | match direction { [INFO] [stdout] 159 ~ 0 => if check_position([self.position[0] , self.position[1] - 1], obstacles.to_owned()) { self.current_direction = direction }, // W [INFO] [stdout] 160 ~ 1 => if check_position([self.position[0] - 2, self.position[1]], obstacles.to_owned()) { self.current_direction = direction }, // A [INFO] [stdout] 161 ~ 2 => if check_position([self.position[0] , self.position[1] + 1], obstacles.to_owned()) { self.current_direction = direction }, // S [INFO] [stdout] 162 ~ 3 => if check_position([self.position[0] + 2, self.position[1]], obstacles.to_owned()) { self.current_direction = direction }, // D [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:156:13 [INFO] [stdout] | [INFO] [stdout] 156 | if !(self.position[0] % 2 == 0) { return; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:159:18 [INFO] [stdout] | [INFO] [stdout] 159 | ...0 => if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { self.current_direction = direction }, // W [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 159 - 0 => if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { self.current_direction = direction }, // W [INFO] [stdout] 159 + 0f check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) => { self.current_direction = direction, // W [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:160:18 [INFO] [stdout] | [INFO] [stdout] 160 | ... 1 => if check_position([self.position[0] - 2, self.position[1]], obstacles.clone()) { self.current_direction = direction }, // A [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 160 - 1 => if check_position([self.position[0] - 2, self.position[1]], obstacles.clone()) { self.current_direction = direction }, // A [INFO] [stdout] 160 + 1f check_position([self.position[0] - 2, self.position[1]], obstacles.clone()) => { self.current_direction = direction, // A [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:161:18 [INFO] [stdout] | [INFO] [stdout] 161 | ...2 => if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { self.current_direction = direction }, // S [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 161 - 2 => if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { self.current_direction = direction }, // S [INFO] [stdout] 161 + 2f check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) => { self.current_direction = direction, // S [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:162:18 [INFO] [stdout] | [INFO] [stdout] 162 | ... 3 => if check_position([self.position[0] + 2, self.position[1]], obstacles.clone()) { self.current_direction = direction }, // D [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 162 - 3 => if check_position([self.position[0] + 2, self.position[1]], obstacles.clone()) { self.current_direction = direction }, // D [INFO] [stdout] 162 + 3f check_position([self.position[0] + 2, self.position[1]], obstacles.clone()) => { self.current_direction = direction, // D [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/main.rs:167:38 [INFO] [stdout] | [INFO] [stdout] 167 | fn move_up(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone(... [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 167 - fn move_up(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] 167 + fn move_up(&mut self, obstacles: &[Vec]) { if check_position([self.position[0] , self.position[1] - 1], obstacles.to_owned()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:167:55 [INFO] [stdout] | [INFO] [stdout] 167 | ... { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 167 - fn move_up(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] 167 + fn move_up(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) && self.frames % 2 == 0 { self.position[1] -= 1; }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:167:140 [INFO] [stdout] | [INFO] [stdout] 167 | ...1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.frames.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:168:40 [INFO] [stdout] | [INFO] [stdout] 168 | fn move_left(&mut self, obstacles: &Vec>) { if check_position([self.position[0] - 2, self.position[1]], obstacles.clone... [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 168 - fn move_left(&mut self, obstacles: &Vec>) { if check_position([self.position[0] - 2, self.position[1]], obstacles.clone()) { self.position[0] -= 1 }} [INFO] [stdout] 168 + fn move_left(&mut self, obstacles: &[Vec]) { if check_position([self.position[0] - 2, self.position[1]], obstacles.to_owned()) { self.position[0] -= 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/main.rs:169:40 [INFO] [stdout] | [INFO] [stdout] 169 | fn move_down(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] + 1], obstacles.clon... [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further 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 - fn move_down(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] 169 + fn move_down(&mut self, obstacles: &[Vec]) { if check_position([self.position[0] , self.position[1] + 1], obstacles.to_owned()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:169:57 [INFO] [stdout] | [INFO] [stdout] 169 | ... { if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 169 - fn move_down(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] 169 + fn move_down(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) && self.frames % 2 == 0 { self.position[1] += 1; }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:169:142 [INFO] [stdout] | [INFO] [stdout] 169 | ...1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.frames.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:170:41 [INFO] [stdout] | [INFO] [stdout] 170 | fn move_right(&mut self, obstacles: &Vec>) { if check_position([self.position[0] + 2, self.position[1]], obstacles.clon... [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further 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 move_right(&mut self, obstacles: &Vec>) { if check_position([self.position[0] + 2, self.position[1]], obstacles.clone()) { self.position[0] += 1 }} [INFO] [stdout] 170 + fn move_right(&mut self, obstacles: &[Vec]) { if check_position([self.position[0] + 2, self.position[1]], obstacles.to_owned()) { self.position[0] += 1 }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:175:31 [INFO] [stdout] | [INFO] [stdout] 175 | 0 => self.move_up(&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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:176:33 [INFO] [stdout] | [INFO] [stdout] 176 | 1 => self.move_left(&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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:177:33 [INFO] [stdout] | [INFO] [stdout] 177 | 2 => self.move_down(&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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:178:34 [INFO] [stdout] | [INFO] [stdout] 178 | 3 => self.move_right(&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] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:183:41 [INFO] [stdout] | [INFO] [stdout] 183 | fn check_position(&mut self, coins: &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] 183 - fn check_position(&mut self, coins: &mut Vec>) { [INFO] [stdout] 183 + fn check_position(&mut self, coins: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:256:76 [INFO] [stdout] | [INFO] [stdout] 256 | println!("{}", Colorize::bright_blue("#######################").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `print!` args [INFO] [stdout] --> src/main.rs:258:54 [INFO] [stdout] | [INFO] [stdout] 258 | print!("{}", Colorize::bright_blue("## ").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `print!` args [INFO] [stdout] --> src/main.rs:259:70 [INFO] [stdout] | [INFO] [stdout] 259 | print!("{}", Colorize::bright_yellow("Y O U - @ - W O N").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:260:56 [INFO] [stdout] | [INFO] [stdout] 260 | println!("{}", Colorize::bright_blue(" ##").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:262:72 [INFO] [stdout] | [INFO] [stdout] 262 | println!("{}", Colorize::bright_blue("#######################").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:270:64 [INFO] [stdout] | [INFO] [stdout] 270 | println!("{}", Colorize::red("#######################").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:271:51 [INFO] [stdout] | [INFO] [stdout] 271 | println!("{}", Colorize::red("Game over.").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:272:64 [INFO] [stdout] | [INFO] [stdout] 272 | println!("{}", Colorize::red("#######################").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:64:41 [INFO] [stdout] | [INFO] [stdout] 64 | fn move_ghost(&mut self, obstacles: &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] 64 - fn move_ghost(&mut self, obstacles: &Vec>) { [INFO] [stdout] 64 + fn move_ghost(&mut self, obstacles: &[Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:87:118 [INFO] [stdout] | [INFO] [stdout] 87 | ...& random_value == 0 && self.position[0] % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:90:118 [INFO] [stdout] | [INFO] [stdout] 90 | ...& random_value == 1 && self.position[0] % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:113:118 [INFO] [stdout] | [INFO] [stdout] 113 | ...& random_value == 0 && self.position[0] % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:116:118 [INFO] [stdout] | [INFO] [stdout] 116 | ...& random_value == 1 && self.position[0] % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:156:12 [INFO] [stdout] | [INFO] [stdout] 156 | if !(self.position[0] % 2 == 0) { return; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.position[0] % 2 != 0)` [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/main.rs:155:44 [INFO] [stdout] | [INFO] [stdout] 155 | fn queue_checker(&mut self, obstacles: &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] 155 ~ fn queue_checker(&mut self, obstacles: &[Vec]) { [INFO] [stdout] 156 | if !(self.position[0] % 2 == 0) { return; } [INFO] [stdout] 157 | let direction: u8 = self.direction_queue; [INFO] [stdout] 158 | match direction { [INFO] [stdout] 159 ~ 0 => if check_position([self.position[0] , self.position[1] - 1], obstacles.to_owned()) { self.current_direction = direction }, // W [INFO] [stdout] 160 ~ 1 => if check_position([self.position[0] - 2, self.position[1]], obstacles.to_owned()) { self.current_direction = direction }, // A [INFO] [stdout] 161 ~ 2 => if check_position([self.position[0] , self.position[1] + 1], obstacles.to_owned()) { self.current_direction = direction }, // S [INFO] [stdout] 162 ~ 3 => if check_position([self.position[0] + 2, self.position[1]], obstacles.to_owned()) { self.current_direction = direction }, // D [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:156:13 [INFO] [stdout] | [INFO] [stdout] 156 | if !(self.position[0] % 2 == 0) { return; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.position[0].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: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:159:18 [INFO] [stdout] | [INFO] [stdout] 159 | ...0 => if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { self.current_direction = direction }, // W [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 159 - 0 => if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { self.current_direction = direction }, // W [INFO] [stdout] 159 + 0f check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) => { self.current_direction = direction, // W [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:160:18 [INFO] [stdout] | [INFO] [stdout] 160 | ... 1 => if check_position([self.position[0] - 2, self.position[1]], obstacles.clone()) { self.current_direction = direction }, // A [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 160 - 1 => if check_position([self.position[0] - 2, self.position[1]], obstacles.clone()) { self.current_direction = direction }, // A [INFO] [stdout] 160 + 1f check_position([self.position[0] - 2, self.position[1]], obstacles.clone()) => { self.current_direction = direction, // A [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:161:18 [INFO] [stdout] | [INFO] [stdout] 161 | ...2 => if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { self.current_direction = direction }, // S [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 161 - 2 => if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { self.current_direction = direction }, // S [INFO] [stdout] 161 + 2f check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) => { self.current_direction = direction, // S [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:162:18 [INFO] [stdout] | [INFO] [stdout] 162 | ... 3 => if check_position([self.position[0] + 2, self.position[1]], obstacles.clone()) { self.current_direction = direction }, // D [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 162 - 3 => if check_position([self.position[0] + 2, self.position[1]], obstacles.clone()) { self.current_direction = direction }, // D [INFO] [stdout] 162 + 3f check_position([self.position[0] + 2, self.position[1]], obstacles.clone()) => { self.current_direction = direction, // D [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/main.rs:167:38 [INFO] [stdout] | [INFO] [stdout] 167 | fn move_up(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone(... [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 167 - fn move_up(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] 167 + fn move_up(&mut self, obstacles: &[Vec]) { if check_position([self.position[0] , self.position[1] - 1], obstacles.to_owned()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:167:55 [INFO] [stdout] | [INFO] [stdout] 167 | ... { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 167 - fn move_up(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] 167 + fn move_up(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] - 1], obstacles.clone()) && self.frames % 2 == 0 { self.position[1] -= 1; }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:167:140 [INFO] [stdout] | [INFO] [stdout] 167 | ...1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] -= 1; } }} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.frames.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:168:40 [INFO] [stdout] | [INFO] [stdout] 168 | fn move_left(&mut self, obstacles: &Vec>) { if check_position([self.position[0] - 2, self.position[1]], obstacles.clone... [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 168 - fn move_left(&mut self, obstacles: &Vec>) { if check_position([self.position[0] - 2, self.position[1]], obstacles.clone()) { self.position[0] -= 1 }} [INFO] [stdout] 168 + fn move_left(&mut self, obstacles: &[Vec]) { if check_position([self.position[0] - 2, self.position[1]], obstacles.to_owned()) { self.position[0] -= 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/main.rs:169:40 [INFO] [stdout] | [INFO] [stdout] 169 | fn move_down(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] + 1], obstacles.clon... [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further 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 - fn move_down(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] 169 + fn move_down(&mut self, obstacles: &[Vec]) { if check_position([self.position[0] , self.position[1] + 1], obstacles.to_owned()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:169:57 [INFO] [stdout] | [INFO] [stdout] 169 | ... { if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 169 - fn move_down(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] 169 + fn move_down(&mut self, obstacles: &Vec>) { if check_position([self.position[0] , self.position[1] + 1], obstacles.clone()) && self.frames % 2 == 0 { self.position[1] += 1; }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/main.rs:169:142 [INFO] [stdout] | [INFO] [stdout] 169 | ...1], obstacles.clone()) { if self.frames % 2 == 0 { self.position[1] += 1; } }} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `self.frames.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:170:41 [INFO] [stdout] | [INFO] [stdout] 170 | fn move_right(&mut self, obstacles: &Vec>) { if check_position([self.position[0] + 2, self.position[1]], obstacles.clon... [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further 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 move_right(&mut self, obstacles: &Vec>) { if check_position([self.position[0] + 2, self.position[1]], obstacles.clone()) { self.position[0] += 1 }} [INFO] [stdout] 170 + fn move_right(&mut self, obstacles: &[Vec]) { if check_position([self.position[0] + 2, self.position[1]], obstacles.to_owned()) { self.position[0] += 1 }} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:175:31 [INFO] [stdout] | [INFO] [stdout] 175 | 0 => self.move_up(&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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:176:33 [INFO] [stdout] | [INFO] [stdout] 176 | 1 => self.move_left(&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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:177:33 [INFO] [stdout] | [INFO] [stdout] 177 | 2 => self.move_down(&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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:178:34 [INFO] [stdout] | [INFO] [stdout] 178 | 3 => self.move_right(&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] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:183:41 [INFO] [stdout] | [INFO] [stdout] 183 | fn check_position(&mut self, coins: &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] 183 - fn check_position(&mut self, coins: &mut Vec>) { [INFO] [stdout] 183 + fn check_position(&mut self, coins: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:256:76 [INFO] [stdout] | [INFO] [stdout] 256 | println!("{}", Colorize::bright_blue("#######################").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `print!` args [INFO] [stdout] --> src/main.rs:258:54 [INFO] [stdout] | [INFO] [stdout] 258 | print!("{}", Colorize::bright_blue("## ").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `print!` args [INFO] [stdout] --> src/main.rs:259:70 [INFO] [stdout] | [INFO] [stdout] 259 | print!("{}", Colorize::bright_yellow("Y O U - @ - W O N").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:260:56 [INFO] [stdout] | [INFO] [stdout] 260 | println!("{}", Colorize::bright_blue(" ##").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:262:72 [INFO] [stdout] | [INFO] [stdout] 262 | println!("{}", Colorize::bright_blue("#######################").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:270:64 [INFO] [stdout] | [INFO] [stdout] 270 | println!("{}", Colorize::red("#######################").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:271:51 [INFO] [stdout] | [INFO] [stdout] 271 | println!("{}", Colorize::red("Game over.").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `println!` args [INFO] [stdout] --> src/main.rs:272:64 [INFO] [stdout] | [INFO] [stdout] 272 | println!("{}", Colorize::red("#######################").to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 15.60s [INFO] running `Command { std: "docker" "inspect" "edd1f77100fd75830a1cfe3a9f21bfad82f132736f6c1d55a1e6973b6412bb42", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "edd1f77100fd75830a1cfe3a9f21bfad82f132736f6c1d55a1e6973b6412bb42", kill_on_drop: false }` [INFO] [stdout] edd1f77100fd75830a1cfe3a9f21bfad82f132736f6c1d55a1e6973b6412bb42