[INFO] cloning repository https://github.com/OrangIPA/snake-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/OrangIPA/snake-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FOrangIPA%2Fsnake-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FOrangIPA%2Fsnake-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 6b674545b0e00cdfacd17454a3d3df429eafd30b [INFO] linting OrangIPA/snake-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FOrangIPA%2Fsnake-rust" "/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/OrangIPA/snake-rust [INFO] finished tweaking git repo https://github.com/OrangIPA/snake-rust [INFO] tweaked toml for git repo https://github.com/OrangIPA/snake-rust written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/OrangIPA/snake-rust on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/OrangIPA/snake-rust already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded getrandom v0.2.4 [INFO] [stderr] Downloaded piston2d-graphics v0.41.0 [INFO] [stderr] Downloaded piston v0.53.1 [INFO] [stderr] Downloaded crossbeam-epoch v0.9.7 [INFO] [stderr] Downloaded dirs v3.0.2 [INFO] [stderr] Downloaded xdg v2.4.0 [INFO] [stderr] Downloaded piston2d-opengl_graphics v0.79.0 [INFO] [stderr] Downloaded piston-viewport v1.0.1 [INFO] [stderr] Downloaded crossbeam-channel v0.5.2 [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] f3e543cf688bc95536b79761fc6b818df2fc7db890f8f97a67738a3ddf8dac15 [INFO] running `Command { std: "docker" "start" "-a" "f3e543cf688bc95536b79761fc6b818df2fc7db890f8f97a67738a3ddf8dac15", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "f3e543cf688bc95536b79761fc6b818df2fc7db890f8f97a67738a3ddf8dac15", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f3e543cf688bc95536b79761fc6b818df2fc7db890f8f97a67738a3ddf8dac15", kill_on_drop: false }` [INFO] [stdout] f3e543cf688bc95536b79761fc6b818df2fc7db890f8f97a67738a3ddf8dac15 [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] e5f3fa630ea670e58011079cc1afcfcdc9a9a007273c4ae9656e1560a909362b [INFO] running `Command { std: "docker" "start" "-a" "e5f3fa630ea670e58011079cc1afcfcdc9a9a007273c4ae9656e1560a909362b", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.117 [INFO] [stderr] Compiling proc-macro2 v1.0.36 [INFO] [stderr] Compiling pkg-config v0.3.24 [INFO] [stderr] Compiling log v0.4.14 [INFO] [stderr] Compiling crossbeam-utils v0.8.7 [INFO] [stderr] Checking smallvec v1.8.0 [INFO] [stderr] Checking once_cell v1.9.0 [INFO] [stderr] Compiling crossbeam-epoch v0.9.7 [INFO] [stderr] Checking ttf-parser v0.6.2 [INFO] [stderr] Checking piston-float v1.0.1 [INFO] [stderr] Compiling memchr v2.4.1 [INFO] [stderr] Compiling gl_generator v0.14.0 [INFO] [stderr] Compiling nom v7.1.0 [INFO] [stderr] Compiling syn v1.0.86 [INFO] [stderr] Compiling wayland-sys v0.28.6 [INFO] [stderr] Compiling rayon-core v1.9.1 [INFO] [stderr] Checking piston-viewport v1.0.1 [INFO] [stderr] Compiling num-traits v0.2.14 [INFO] [stderr] Compiling quote v1.0.15 [INFO] [stderr] Compiling nix v0.18.0 [INFO] [stderr] Compiling serde v1.0.136 [INFO] [stderr] Compiling wayland-scanner v0.28.6 [INFO] [stderr] Compiling serde_derive v1.0.136 [INFO] [stderr] Checking crossbeam-deque v0.8.1 [INFO] [stderr] Checking crossbeam-channel v0.5.2 [INFO] [stderr] Checking owned_ttf_parser v0.6.0 [INFO] [stderr] Compiling x11-dl v2.19.1 [INFO] [stderr] Checking rusttype v0.9.2 [INFO] [stderr] Compiling num-integer v0.1.44 [INFO] [stderr] Compiling rayon v1.5.1 [INFO] [stderr] Checking piston-graphics_api_version v1.0.1 [INFO] [stderr] Checking nix v0.20.0 [INFO] [stderr] Checking dirs-sys v0.3.6 [INFO] [stderr] Checking num_cpus v1.13.1 [INFO] [stderr] Checking dirs v3.0.2 [INFO] [stderr] Checking xdg v2.4.0 [INFO] [stderr] Checking iovec v0.1.4 [INFO] [stderr] Checking net2 v0.2.37 [INFO] [stderr] Compiling wayland-client v0.28.6 [INFO] [stderr] Compiling wayland-protocols v0.28.6 [INFO] [stderr] Compiling gl_generator v0.13.1 [INFO] [stderr] Checking xcursor v0.3.4 [INFO] [stderr] Checking libloading v0.6.7 [INFO] [stderr] Checking either v1.6.1 [INFO] [stderr] Checking xml-rs v0.8.4 [INFO] [stderr] Checking mio v0.6.23 [INFO] [stderr] Checking andrew v0.3.1 [INFO] [stderr] Checking raw-window-handle v0.4.2 [INFO] [stderr] Compiling gl v0.13.0 [INFO] [stderr] Checking dlib v0.4.2 [INFO] [stderr] Checking parking_lot_core v0.8.5 [INFO] [stderr] Checking memmap2 v0.1.0 [INFO] [stderr] Compiling glutin_glx_sys v0.1.7 [INFO] [stderr] Compiling glutin_egl_sys v0.1.5 [INFO] [stderr] Checking wayland-commons v0.28.6 [INFO] [stderr] Checking lock_api v0.4.6 [INFO] [stderr] Checking calloop v0.6.5 [INFO] [stderr] Compiling num-iter v0.1.42 [INFO] [stderr] Checking weezl v0.1.5 [INFO] [stderr] Checking mio-extras v2.0.6 [INFO] [stderr] Checking parking_lot v0.11.2 [INFO] [stderr] Checking jpeg-decoder v0.1.22 [INFO] [stderr] Checking raw-window-handle v0.3.4 [INFO] [stderr] Checking getrandom v0.2.4 [INFO] [stderr] Checking shared_library v0.1.9 [INFO] [stderr] Checking gif v0.11.3 [INFO] [stderr] Checking rand_core v0.6.3 [INFO] [stderr] Checking tiff v0.6.1 [INFO] [stderr] Checking osmesa-sys v0.1.2 [INFO] [stderr] Checking num-rational v0.3.2 [INFO] [stderr] Checking shader_version v0.7.0 [INFO] [stderr] Checking vecmath v1.0.0 [INFO] [stderr] Checking wayland-cursor v0.28.6 [INFO] [stderr] Checking wayland-egl v0.28.6 [INFO] [stderr] Checking spin_sleep v1.0.0 [INFO] [stderr] Checking read_color v1.0.0 [INFO] [stderr] Checking bytemuck v1.7.3 [INFO] [stderr] Checking piston-texture v0.8.0 [INFO] [stderr] Checking interpolation v0.2.0 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking piston-shaders_graphics2d v0.4.0 [INFO] [stderr] Checking piston2d-graphics v0.41.0 [INFO] [stderr] Checking image v0.23.14 [INFO] [stderr] Checking rand v0.8.4 [INFO] [stderr] Checking pistoncore-input v1.0.1 [INFO] [stderr] Checking pistoncore-window v0.47.1 [INFO] [stderr] Checking pistoncore-event_loop v0.53.1 [INFO] [stderr] Checking piston v0.53.1 [INFO] [stderr] Checking piston2d-opengl_graphics v0.79.0 [INFO] [stderr] Checking smithay-client-toolkit v0.12.3 [INFO] [stderr] Checking winit v0.24.0 [INFO] [stderr] Checking glutin v0.26.0 [INFO] [stderr] Checking pistoncore-glutin_window v0.69.0 [INFO] [stderr] Checking snake v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | if (btn == &Button::Keyboard(Key::P)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 64 - if (btn == &Button::Keyboard(Key::P)) { [INFO] [stdout] 64 + if btn == &Button::Keyboard(Key::P) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:68:12 [INFO] [stdout] | [INFO] [stdout] 68 | if (btn == &Button::Keyboard(Key::R)){ [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 68 - if (btn == &Button::Keyboard(Key::R)){ [INFO] [stdout] 68 + if btn == &Button::Keyboard(Key::R) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:156:13 [INFO] [stdout] | [INFO] [stdout] 156 | let mut food_before = self.food.clone(); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `food_after` is never read [INFO] [stdout] --> src/main.rs:157:30 [INFO] [stdout] | [INFO] [stdout] 157 | let mut food_after = food_before; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> src/main.rs:213:21 [INFO] [stdout] | [INFO] [stdout] 213 | if let Some(u) = e.update_args() { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `isEaten` is never read [INFO] [stdout] --> src/main.rs:151:5 [INFO] [stdout] | [INFO] [stdout] 149 | struct Food{ [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 150 | food: (i32, i32), [INFO] [stdout] 151 | isEaten: bool, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/main.rs:49:26 [INFO] [stdout] | [INFO] [stdout] 49 | self.snake.dir = match btn { [INFO] [stdout] | __________________________^ [INFO] [stdout] 50 | | &Button::Keyboard(Key::Up) [INFO] [stdout] 51 | | if last_direction != Direction::Down => Direction::Up, [INFO] [stdout] 52 | | &Button::Keyboard(Key::Down) [INFO] [stdout] ... | [INFO] [stdout] 58 | | _ => last_direction, [INFO] [stdout] 59 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 49 ~ self.snake.dir = match *btn { [INFO] [stdout] 50 ~ Button::Keyboard(Key::Up) [INFO] [stdout] 51 | if last_direction != Direction::Down => Direction::Up, [INFO] [stdout] 52 ~ Button::Keyboard(Key::Down) [INFO] [stdout] 53 | if last_direction != Direction::Up => Direction::Down, [INFO] [stdout] 54 ~ Button::Keyboard(Key::Right) [INFO] [stdout] 55 | if last_direction != Direction::Left => Direction::Right, [INFO] [stdout] 56 ~ Button::Keyboard(Key::Left) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/main.rs:60:55 [INFO] [stdout] | [INFO] [stdout] 60 | if (btn == &Button::Keyboard(Key::Space)) && (self.snake.alive == false){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!self.snake.alive` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the method `genFood` doesn't need a mutable reference [INFO] [stdout] --> src/main.rs:62:31 [INFO] [stdout] | [INFO] [stdout] 62 | self.food.genFood(&mut self.snake); [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] 62 - self.food.genFood(&mut self.snake); [INFO] [stdout] 62 + self.food.genFood(&self.snake); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:117:12 [INFO] [stdout] | [INFO] [stdout] 117 | if !(new_head == food.food) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(new_head != food.food)` [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: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:107:28 [INFO] [stdout] | [INFO] [stdout] 107 | let mut new_head = (*self.body.front().expect("snake have no body")).clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `(*self.body.front().expect("snake have no body"))` [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/main.rs:120:26 [INFO] [stdout] | [INFO] [stdout] 120 | food.genFood(&self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [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: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:137:21 [INFO] [stdout] | [INFO] [stdout] 137 | let (x,y) = (*self.body.front().expect("snake have no body")).clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `(*self.body.front().expect("snake have no body"))` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/main.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | y >= 0 && y <= 14 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(0..=14).contains(&y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/main.rs:138:9 [INFO] [stdout] | [INFO] [stdout] 138 | x >= 0 && x <= 14 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(0..=14).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/main.rs:143:43 [INFO] [stdout] | [INFO] [stdout] 143 | self.body = LinkedList::from_iter((vec![(1,0),(0,0)]).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 143 - self.body = LinkedList::from_iter((vec![(1,0),(0,0)]).into_iter()); [INFO] [stdout] 143 + self.body = LinkedList::from_iter((vec![(1,0),(0,0)]); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:156:31 [INFO] [stdout] | [INFO] [stdout] 156 | let mut food_before = self.food.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.food` [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: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/main.rs:197:41 [INFO] [stdout] | [INFO] [stdout] 197 | body: LinkedList::from_iter((vec![(1,0),(0,0)]).into_iter()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 197 - body: LinkedList::from_iter((vec![(1,0),(0,0)]).into_iter()), [INFO] [stdout] 197 + body: LinkedList::from_iter((vec![(1,0),(0,0)]), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `GRAY` should have a snake case name [INFO] [stdout] --> src/main.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | let GRAY: [f32; 4] = [0.2, 0.2, 0.2, 1.0]; [INFO] [stdout] | ^^^^ help: convert the identifier to snake case: `gray` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `RED` should have a snake case name [INFO] [stdout] --> src/main.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | let RED: [f32; 4] = [1.0, 0.0, 0.0, 1.0]; [INFO] [stdout] | ^^^ help: convert the identifier to snake case: `red` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `isInside` should have a snake case name [INFO] [stdout] --> src/main.rs:136:8 [INFO] [stdout] | [INFO] [stdout] 136 | fn isInside(&self) -> bool{ [INFO] [stdout] | ^^^^^^^^ help: convert the identifier to snake case: `is_inside` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: structure field `isEaten` should have a snake case name [INFO] [stdout] --> src/main.rs:151:5 [INFO] [stdout] | [INFO] [stdout] 151 | isEaten: bool, [INFO] [stdout] | ^^^^^^^ help: convert the identifier to snake case: `is_eaten` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `genFood` should have a snake case name [INFO] [stdout] --> src/main.rs:155:8 [INFO] [stdout] | [INFO] [stdout] 155 | fn genFood(&mut self, snake: &Snake){ [INFO] [stdout] | ^^^^^^^ help: convert the identifier to snake case: `gen_food` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `YELLOW` should have a snake case name [INFO] [stdout] --> src/main.rs:168:13 [INFO] [stdout] | [INFO] [stdout] 168 | let YELLOW: [f32; 4] = [1.0, 1.0, 0.0, 1.0]; [INFO] [stdout] | ^^^^^^ help: convert the identifier to snake case: `yellow` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 64 | if (btn == &Button::Keyboard(Key::P)) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 64 - if (btn == &Button::Keyboard(Key::P)) { [INFO] [stdout] 64 + if btn == &Button::Keyboard(Key::P) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:68:12 [INFO] [stdout] | [INFO] [stdout] 68 | if (btn == &Button::Keyboard(Key::R)){ [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 68 - if (btn == &Button::Keyboard(Key::R)){ [INFO] [stdout] 68 + if btn == &Button::Keyboard(Key::R) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:156:13 [INFO] [stdout] | [INFO] [stdout] 156 | let mut food_before = self.food.clone(); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `food_after` is never read [INFO] [stdout] --> src/main.rs:157:30 [INFO] [stdout] | [INFO] [stdout] 157 | let mut food_after = food_before; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> src/main.rs:213:21 [INFO] [stdout] | [INFO] [stdout] 213 | if let Some(u) = e.update_args() { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `isEaten` is never read [INFO] [stdout] --> src/main.rs:151:5 [INFO] [stdout] | [INFO] [stdout] 149 | struct Food{ [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 150 | food: (i32, i32), [INFO] [stdout] 151 | isEaten: bool, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/main.rs:49:26 [INFO] [stdout] | [INFO] [stdout] 49 | self.snake.dir = match btn { [INFO] [stdout] | __________________________^ [INFO] [stdout] 50 | | &Button::Keyboard(Key::Up) [INFO] [stdout] 51 | | if last_direction != Direction::Down => Direction::Up, [INFO] [stdout] 52 | | &Button::Keyboard(Key::Down) [INFO] [stdout] ... | [INFO] [stdout] 58 | | _ => last_direction, [INFO] [stdout] 59 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 49 ~ self.snake.dir = match *btn { [INFO] [stdout] 50 ~ Button::Keyboard(Key::Up) [INFO] [stdout] 51 | if last_direction != Direction::Down => Direction::Up, [INFO] [stdout] 52 ~ Button::Keyboard(Key::Down) [INFO] [stdout] 53 | if last_direction != Direction::Up => Direction::Down, [INFO] [stdout] 54 ~ Button::Keyboard(Key::Right) [INFO] [stdout] 55 | if last_direction != Direction::Left => Direction::Right, [INFO] [stdout] 56 ~ Button::Keyboard(Key::Left) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/main.rs:60:55 [INFO] [stdout] | [INFO] [stdout] 60 | if (btn == &Button::Keyboard(Key::Space)) && (self.snake.alive == false){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!self.snake.alive` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the method `genFood` doesn't need a mutable reference [INFO] [stdout] --> src/main.rs:62:31 [INFO] [stdout] | [INFO] [stdout] 62 | self.food.genFood(&mut self.snake); [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] 62 - self.food.genFood(&mut self.snake); [INFO] [stdout] 62 + self.food.genFood(&self.snake); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:117:12 [INFO] [stdout] | [INFO] [stdout] 117 | if !(new_head == food.food) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(new_head != food.food)` [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: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:107:28 [INFO] [stdout] | [INFO] [stdout] 107 | let mut new_head = (*self.body.front().expect("snake have no body")).clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `(*self.body.front().expect("snake have no body"))` [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/main.rs:120:26 [INFO] [stdout] | [INFO] [stdout] 120 | food.genFood(&self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [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: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:137:21 [INFO] [stdout] | [INFO] [stdout] 137 | let (x,y) = (*self.body.front().expect("snake have no body")).clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `(*self.body.front().expect("snake have no body"))` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/main.rs:139:9 [INFO] [stdout] | [INFO] [stdout] 139 | y >= 0 && y <= 14 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(0..=14).contains(&y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/main.rs:138:9 [INFO] [stdout] | [INFO] [stdout] 138 | x >= 0 && x <= 14 && [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `(0..=14).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/main.rs:143:43 [INFO] [stdout] | [INFO] [stdout] 143 | self.body = LinkedList::from_iter((vec![(1,0),(0,0)]).into_iter()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 143 - self.body = LinkedList::from_iter((vec![(1,0),(0,0)]).into_iter()); [INFO] [stdout] 143 + self.body = LinkedList::from_iter((vec![(1,0),(0,0)]); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `(i32, i32)` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:156:31 [INFO] [stdout] | [INFO] [stdout] 156 | let mut food_before = self.food.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.food` [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: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> src/main.rs:197:41 [INFO] [stdout] | [INFO] [stdout] 197 | body: LinkedList::from_iter((vec![(1,0),(0,0)]).into_iter()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/collect.rs:152:20 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 197 - body: LinkedList::from_iter((vec![(1,0),(0,0)]).into_iter()), [INFO] [stdout] 197 + body: LinkedList::from_iter((vec![(1,0),(0,0)]), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `GRAY` should have a snake case name [INFO] [stdout] --> src/main.rs:33:13 [INFO] [stdout] | [INFO] [stdout] 33 | let GRAY: [f32; 4] = [0.2, 0.2, 0.2, 1.0]; [INFO] [stdout] | ^^^^ help: convert the identifier to snake case: `gray` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `RED` should have a snake case name [INFO] [stdout] --> src/main.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | let RED: [f32; 4] = [1.0, 0.0, 0.0, 1.0]; [INFO] [stdout] | ^^^ help: convert the identifier to snake case: `red` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `isInside` should have a snake case name [INFO] [stdout] --> src/main.rs:136:8 [INFO] [stdout] | [INFO] [stdout] 136 | fn isInside(&self) -> bool{ [INFO] [stdout] | ^^^^^^^^ help: convert the identifier to snake case: `is_inside` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: structure field `isEaten` should have a snake case name [INFO] [stdout] --> src/main.rs:151:5 [INFO] [stdout] | [INFO] [stdout] 151 | isEaten: bool, [INFO] [stdout] | ^^^^^^^ help: convert the identifier to snake case: `is_eaten` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `genFood` should have a snake case name [INFO] [stdout] --> src/main.rs:155:8 [INFO] [stdout] | [INFO] [stdout] 155 | fn genFood(&mut self, snake: &Snake){ [INFO] [stdout] | ^^^^^^^ help: convert the identifier to snake case: `gen_food` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `YELLOW` should have a snake case name [INFO] [stdout] --> src/main.rs:168:13 [INFO] [stdout] | [INFO] [stdout] 168 | let YELLOW: [f32; 4] = [1.0, 1.0, 0.0, 1.0]; [INFO] [stdout] | ^^^^^^ help: convert the identifier to snake case: `yellow` [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 06s [INFO] running `Command { std: "docker" "inspect" "e5f3fa630ea670e58011079cc1afcfcdc9a9a007273c4ae9656e1560a909362b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e5f3fa630ea670e58011079cc1afcfcdc9a9a007273c4ae9656e1560a909362b", kill_on_drop: false }` [INFO] [stdout] e5f3fa630ea670e58011079cc1afcfcdc9a9a007273c4ae9656e1560a909362b