[INFO] cloning repository https://github.com/maratkanov-a/snake [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/maratkanov-a/snake" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmaratkanov-a%2Fsnake", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmaratkanov-a%2Fsnake'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 492dc43d3998c357e8cc9b8d5b66c73b9cdd39d3 [INFO] linting maratkanov-a/snake against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmaratkanov-a%2Fsnake" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/maratkanov-a/snake [INFO] finished tweaking git repo https://github.com/maratkanov-a/snake [INFO] tweaked toml for git repo https://github.com/maratkanov-a/snake written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/maratkanov-a/snake 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/maratkanov-a/snake 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 termion v2.0.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 7b2f4e4ff35cefe943f8a95be1f7b69c7747aa685c1dcf75c8a3c83cc1bdb585 [INFO] running `Command { std: "docker" "start" "-a" "7b2f4e4ff35cefe943f8a95be1f7b69c7747aa685c1dcf75c8a3c83cc1bdb585", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "7b2f4e4ff35cefe943f8a95be1f7b69c7747aa685c1dcf75c8a3c83cc1bdb585", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7b2f4e4ff35cefe943f8a95be1f7b69c7747aa685c1dcf75c8a3c83cc1bdb585", kill_on_drop: false }` [INFO] [stdout] 7b2f4e4ff35cefe943f8a95be1f7b69c7747aa685c1dcf75c8a3c83cc1bdb585 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 1c8b086dcb9e542de8eda7fc926d7e6f0be599eb14ef501f667595d7b40b1192 [INFO] running `Command { std: "docker" "start" "-a" "1c8b086dcb9e542de8eda7fc926d7e6f0be599eb14ef501f667595d7b40b1192", kill_on_drop: false }` [INFO] [stderr] Checking getrandom v0.2.8 [INFO] [stderr] Checking numtoa v0.1.0 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking termion v2.0.1 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking snake_game v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::vec` [INFO] [stdout] --> src/apple/mod.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::vec; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/messages.rs:1:29 [INFO] [stdout] | [INFO] [stdout] 1 | pub(crate) const WELCOME: [&'static str; 6] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/messages.rs:10:28 [INFO] [stdout] | [INFO] [stdout] 10 | pub(crate) const PAUSED: [&'static str; 3] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/messages.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | pub(crate) const BYE: [&'static str; 3] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/messages.rs:22:27 [INFO] [stdout] | [INFO] [stdout] 22 | pub(crate) const DEATH: [&'static str; 3] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/messages.rs:1:29 [INFO] [stdout] | [INFO] [stdout] 1 | pub(crate) const WELCOME: [&'static str; 6] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/messages.rs:10:28 [INFO] [stdout] | [INFO] [stdout] 10 | pub(crate) const PAUSED: [&'static str; 3] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/messages.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | pub(crate) const BYE: [&'static str; 3] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/messages.rs:22:27 [INFO] [stdout] | [INFO] [stdout] 22 | pub(crate) const DEATH: [&'static str; 3] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/apple/mod.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | / let mut v = Vec::with_capacity(1); [INFO] [stdout] 56 | | v.push((self.x, self.y, '•')); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let v = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/cage/mod.rs:25:20 [INFO] [stdout] | [INFO] [stdout] 25 | if (i > 0 && j == 0) || (i > 0 && j == self.y - 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] 25 - if (i > 0 && j == 0) || (i > 0 && j == self.y - 1) { [INFO] [stdout] 25 + if !(i <= 0 || j != 0 && j != self.y - 1) { [INFO] [stdout] | [INFO] [stdout] 25 - if (i > 0 && j == 0) || (i > 0 && j == self.y - 1) { [INFO] [stdout] 25 + if (j == self.y - 1 || j == 0) && i > 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/field/mod.rs:34:29 [INFO] [stdout] | [INFO] [stdout] 34 | result.push_str(&*v.iter().collect::()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&v.iter().collect::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/field/mod.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | result.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `result.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.snake.get_positions().get(0)` [INFO] [stdout] --> src/game/mod.rs:67:25 [INFO] [stdout] | [INFO] [stdout] 67 | let (x, y, _) = self.snake.get_positions().get(0).cloned().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.snake.get_positions().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: deref which would be done by auto-deref [INFO] [stdout] --> src/game/mod.rs:94:29 [INFO] [stdout] | [INFO] [stdout] 94 | result.push_str(*m); [INFO] [stdout] | ^^ help: try: `m` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/game/mod.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | result.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `result.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game/mod.rs:150:17 [INFO] [stdout] | [INFO] [stdout] 150 | / match self.status { [INFO] [stdout] 151 | | Status::Ended => { [INFO] [stdout] 152 | | self.message(&mut stdout, messages::DEATH.to_vec()); [INFO] [stdout] 153 | | ms.send(Status::Ended).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 156 | | _ => {} [INFO] [stdout] 157 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 ~ if let Status::Ended = self.status { [INFO] [stdout] 151 + self.message(&mut stdout, messages::DEATH.to_vec()); [INFO] [stdout] 152 + ms.send(Status::Ended).unwrap(); [INFO] [stdout] 153 + break; [INFO] [stdout] 154 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.positions.get(0)` [INFO] [stdout] --> src/snake/mod.rs:35:25 [INFO] [stdout] | [INFO] [stdout] 35 | let (x, y, d) = self.positions.get(0).cloned().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.positions.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: this boolean expression can be simplified [INFO] [stdout] --> src/snake/mod.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | if !np.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `np.is_none()` [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: accessing first element with `self.positions.get(0)` [INFO] [stdout] --> src/snake/mod.rs:51:28 [INFO] [stdout] | [INFO] [stdout] 51 | let (px, py, pd) = self.positions.get(0).cloned().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.positions.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: unneeded `return` statement [INFO] [stdout] --> src/snake/mod.rs:96:9 [INFO] [stdout] | [INFO] [stdout] 96 | return Box::new(pos); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 96 - return Box::new(pos); [INFO] [stdout] 96 + Box::new(pos) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize, Direction)` which implements the `Copy` trait [INFO] [stdout] --> src/snake/mod.rs:85:25 [INFO] [stdout] | [INFO] [stdout] 85 | let (x, y, d) = p.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*p` [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: calls to `push` immediately after creation [INFO] [stdout] --> src/apple/mod.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | / let mut v = Vec::with_capacity(1); [INFO] [stdout] 56 | | v.push((self.x, self.y, '•')); [INFO] [stdout] | |______________________________________^ help: consider using the `vec![]` macro: `let v = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/cage/mod.rs:25:20 [INFO] [stdout] | [INFO] [stdout] 25 | if (i > 0 && j == 0) || (i > 0 && j == self.y - 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] 25 - if (i > 0 && j == 0) || (i > 0 && j == self.y - 1) { [INFO] [stdout] 25 + if !(i <= 0 || j != 0 && j != self.y - 1) { [INFO] [stdout] | [INFO] [stdout] 25 - if (i > 0 && j == 0) || (i > 0 && j == self.y - 1) { [INFO] [stdout] 25 + if (j == self.y - 1 || j == 0) && i > 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/field/mod.rs:34:29 [INFO] [stdout] | [INFO] [stdout] 34 | result.push_str(&*v.iter().collect::()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&v.iter().collect::()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/field/mod.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | result.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `result.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.snake.get_positions().get(0)` [INFO] [stdout] --> src/game/mod.rs:67:25 [INFO] [stdout] | [INFO] [stdout] 67 | let (x, y, _) = self.snake.get_positions().get(0).cloned().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.snake.get_positions().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: deref which would be done by auto-deref [INFO] [stdout] --> src/game/mod.rs:94:29 [INFO] [stdout] | [INFO] [stdout] 94 | result.push_str(*m); [INFO] [stdout] | ^^ help: try: `m` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/game/mod.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | result.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `result.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game/mod.rs:150:17 [INFO] [stdout] | [INFO] [stdout] 150 | / match self.status { [INFO] [stdout] 151 | | Status::Ended => { [INFO] [stdout] 152 | | self.message(&mut stdout, messages::DEATH.to_vec()); [INFO] [stdout] 153 | | ms.send(Status::Ended).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 156 | | _ => {} [INFO] [stdout] 157 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 150 ~ if let Status::Ended = self.status { [INFO] [stdout] 151 + self.message(&mut stdout, messages::DEATH.to_vec()); [INFO] [stdout] 152 + ms.send(Status::Ended).unwrap(); [INFO] [stdout] 153 + break; [INFO] [stdout] 154 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.positions.get(0)` [INFO] [stdout] --> src/snake/mod.rs:35:25 [INFO] [stdout] | [INFO] [stdout] 35 | let (x, y, d) = self.positions.get(0).cloned().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.positions.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: this boolean expression can be simplified [INFO] [stdout] --> src/snake/mod.rs:76:12 [INFO] [stdout] | [INFO] [stdout] 76 | if !np.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `np.is_none()` [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: accessing first element with `self.positions.get(0)` [INFO] [stdout] --> src/snake/mod.rs:51:28 [INFO] [stdout] | [INFO] [stdout] 51 | let (px, py, pd) = self.positions.get(0).cloned().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.positions.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: unneeded `return` statement [INFO] [stdout] --> src/snake/mod.rs:96:9 [INFO] [stdout] | [INFO] [stdout] 96 | return Box::new(pos); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 96 - return Box::new(pos); [INFO] [stdout] 96 + Box::new(pos) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(usize, usize, Direction)` which implements the `Copy` trait [INFO] [stdout] --> src/snake/mod.rs:85:25 [INFO] [stdout] | [INFO] [stdout] 85 | let (x, y, d) = p.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*p` [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: useless use of `vec!` [INFO] [stdout] --> src/snake/snake_test.rs:19:18 [INFO] [stdout] | [INFO] [stdout] 19 | for d in vec![ [INFO] [stdout] | __________________^ [INFO] [stdout] 20 | | Direction::Up, [INFO] [stdout] 21 | | Direction::Right, [INFO] [stdout] 22 | | Direction::Down, [INFO] [stdout] 23 | | Direction::Left, [INFO] [stdout] 24 | | ] [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 19 ~ for d in [Direction::Up, [INFO] [stdout] 20 + Direction::Right, [INFO] [stdout] 21 + Direction::Down, [INFO] [stdout] 22 + Direction::Left] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/snake/snake_test.rs:40:18 [INFO] [stdout] | [INFO] [stdout] 40 | for t in vec![ [INFO] [stdout] | __________________^ [INFO] [stdout] 41 | | Tc { [INFO] [stdout] 42 | | current_direction: Direction::Up, [INFO] [stdout] 43 | | new_direction: Direction::Up, [INFO] [stdout] ... | [INFO] [stdout] 80 | | }, [INFO] [stdout] 81 | | ] { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 40 ~ for t in [Tc { [INFO] [stdout] 41 + current_direction: Direction::Up, [INFO] [stdout] 42 + new_direction: Direction::Up, [INFO] [stdout] 43 + expected: Direction::Up, [INFO] [stdout] 44 + }, [INFO] [stdout] 45 + Tc { [INFO] [stdout] 46 + current_direction: Direction::Up, [INFO] [stdout] 47 + new_direction: Direction::Down, [INFO] [stdout] 48 + expected: Direction::Up, [INFO] [stdout] 49 + }, [INFO] [stdout] 50 + Tc { [INFO] [stdout] 51 + current_direction: Direction::Right, [INFO] [stdout] 52 + new_direction: Direction::Right, [INFO] [stdout] 53 + expected: Direction::Right, [INFO] [stdout] 54 + }, [INFO] [stdout] 55 + Tc { [INFO] [stdout] 56 + current_direction: Direction::Right, [INFO] [stdout] 57 + new_direction: Direction::Left, [INFO] [stdout] 58 + expected: Direction::Right, [INFO] [stdout] 59 + }, [INFO] [stdout] 60 + Tc { [INFO] [stdout] 61 + current_direction: Direction::Down, [INFO] [stdout] 62 + new_direction: Direction::Down, [INFO] [stdout] 63 + expected: Direction::Down, [INFO] [stdout] 64 + }, [INFO] [stdout] 65 + Tc { [INFO] [stdout] 66 + current_direction: Direction::Down, [INFO] [stdout] 67 + new_direction: Direction::Up, [INFO] [stdout] 68 + expected: Direction::Down, [INFO] [stdout] 69 + }, [INFO] [stdout] 70 + Tc { [INFO] [stdout] 71 + current_direction: Direction::Left, [INFO] [stdout] 72 + new_direction: Direction::Left, [INFO] [stdout] 73 + expected: Direction::Left, [INFO] [stdout] 74 + }, [INFO] [stdout] 75 + Tc { [INFO] [stdout] 76 + current_direction: Direction::Left, [INFO] [stdout] 77 + new_direction: Direction::Right, [INFO] [stdout] 78 + expected: Direction::Left, [INFO] [stdout] 79 ~ }] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/snake/snake_test.rs:92:18 [INFO] [stdout] | [INFO] [stdout] 92 | for t in vec![ [INFO] [stdout] | __________________^ [INFO] [stdout] 93 | | Tc { [INFO] [stdout] 94 | | current_direction: Direction::Up, [INFO] [stdout] 95 | | new_direction: Direction::Right, [INFO] [stdout] ... | [INFO] [stdout] 132 | | }, [INFO] [stdout] 133 | | ] { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 92 ~ for t in [Tc { [INFO] [stdout] 93 + current_direction: Direction::Up, [INFO] [stdout] 94 + new_direction: Direction::Right, [INFO] [stdout] 95 + expected: Direction::Right, [INFO] [stdout] 96 + }, [INFO] [stdout] 97 + Tc { [INFO] [stdout] 98 + current_direction: Direction::Up, [INFO] [stdout] 99 + new_direction: Direction::Left, [INFO] [stdout] 100 + expected: Direction::Left, [INFO] [stdout] 101 + }, [INFO] [stdout] 102 + Tc { [INFO] [stdout] 103 + current_direction: Direction::Right, [INFO] [stdout] 104 + new_direction: Direction::Up, [INFO] [stdout] 105 + expected: Direction::Up, [INFO] [stdout] 106 + }, [INFO] [stdout] 107 + Tc { [INFO] [stdout] 108 + current_direction: Direction::Right, [INFO] [stdout] 109 + new_direction: Direction::Down, [INFO] [stdout] 110 + expected: Direction::Down, [INFO] [stdout] 111 + }, [INFO] [stdout] 112 + Tc { [INFO] [stdout] 113 + current_direction: Direction::Down, [INFO] [stdout] 114 + new_direction: Direction::Right, [INFO] [stdout] 115 + expected: Direction::Right, [INFO] [stdout] 116 + }, [INFO] [stdout] 117 + Tc { [INFO] [stdout] 118 + current_direction: Direction::Down, [INFO] [stdout] 119 + new_direction: Direction::Left, [INFO] [stdout] 120 + expected: Direction::Left, [INFO] [stdout] 121 + }, [INFO] [stdout] 122 + Tc { [INFO] [stdout] 123 + current_direction: Direction::Left, [INFO] [stdout] 124 + new_direction: Direction::Up, [INFO] [stdout] 125 + expected: Direction::Up, [INFO] [stdout] 126 + }, [INFO] [stdout] 127 + Tc { [INFO] [stdout] 128 + current_direction: Direction::Left, [INFO] [stdout] 129 + new_direction: Direction::Down, [INFO] [stdout] 130 + expected: Direction::Down, [INFO] [stdout] 131 ~ }] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.22s [INFO] running `Command { std: "docker" "inspect" "1c8b086dcb9e542de8eda7fc926d7e6f0be599eb14ef501f667595d7b40b1192", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1c8b086dcb9e542de8eda7fc926d7e6f0be599eb14ef501f667595d7b40b1192", kill_on_drop: false }` [INFO] [stdout] 1c8b086dcb9e542de8eda7fc926d7e6f0be599eb14ef501f667595d7b40b1192