[INFO] cloning repository https://github.com/Hellyhoken/battlesnake-mas [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Hellyhoken/battlesnake-mas" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FHellyhoken%2Fbattlesnake-mas", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FHellyhoken%2Fbattlesnake-mas'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 70aad0ccab699dcd6189d89b156598a718e05b77 [INFO] linting Hellyhoken/battlesnake-mas against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FHellyhoken%2Fbattlesnake-mas" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Hellyhoken/battlesnake-mas [INFO] finished tweaking git repo https://github.com/Hellyhoken/battlesnake-mas [INFO] tweaked toml for git repo https://github.com/Hellyhoken/battlesnake-mas written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Hellyhoken/battlesnake-mas 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/Hellyhoken/battlesnake-mas 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 winnow v0.7.9 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 1f2ceaadf955f5e208e532d2d3d509075578444fd6137294353ea1db6853883b [INFO] running `Command { std: "docker" "start" "-a" "1f2ceaadf955f5e208e532d2d3d509075578444fd6137294353ea1db6853883b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "1f2ceaadf955f5e208e532d2d3d509075578444fd6137294353ea1db6853883b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1f2ceaadf955f5e208e532d2d3d509075578444fd6137294353ea1db6853883b", kill_on_drop: false }` [INFO] [stdout] 1f2ceaadf955f5e208e532d2d3d509075578444fd6137294353ea1db6853883b [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 1d05e30fe4521f717cfd530783f90c7b36e4b57d778f7ab5d69d8da2abbcf803 [INFO] running `Command { std: "docker" "start" "-a" "1d05e30fe4521f717cfd530783f90c7b36e4b57d778f7ab5d69d8da2abbcf803", kill_on_drop: false }` [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling pin-project-lite v0.2.16 [INFO] [stderr] Compiling futures-core v0.3.31 [INFO] [stderr] Compiling proc-macro2-diagnostics v0.10.1 [INFO] [stderr] Compiling futures-sink v0.3.31 [INFO] [stderr] Compiling bytes v1.10.1 [INFO] [stderr] Compiling itoa v1.0.15 [INFO] [stderr] Compiling time-core v0.1.4 [INFO] [stderr] Compiling uncased v0.9.10 [INFO] [stderr] Compiling syn v2.0.101 [INFO] [stderr] Compiling is-terminal v0.4.16 [INFO] [stderr] Checking socket2 v0.5.9 [INFO] [stderr] Checking mio v1.0.3 [INFO] [stderr] Compiling slab v0.4.9 [INFO] [stderr] Compiling signal-hook-registry v1.4.5 [INFO] [stderr] Compiling yansi v1.0.1 [INFO] [stderr] Compiling time-macros v0.2.22 [INFO] [stderr] Compiling cookie v0.18.1 [INFO] [stderr] Compiling futures-task v0.3.31 [INFO] [stderr] Compiling futures-channel v0.3.31 [INFO] [stderr] Compiling ref-cast v1.0.24 [INFO] [stderr] Compiling futures-io v0.3.31 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling tracing-core v0.1.33 [INFO] [stderr] Compiling powerfmt v0.2.0 [INFO] [stderr] Compiling hashbrown v0.15.3 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Compiling try-lock v0.2.5 [INFO] [stderr] Compiling bitflags v2.9.0 [INFO] [stderr] Compiling deranged v0.4.0 [INFO] [stderr] Compiling want v0.3.1 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Compiling httparse v1.10.1 [INFO] [stderr] Checking winnow v0.7.9 [INFO] [stderr] Checking toml_write v0.1.1 [INFO] [stderr] Compiling percent-encoding v2.3.1 [INFO] [stderr] Compiling httpdate v1.0.3 [INFO] [stderr] Checking inlinable_string v0.1.15 [INFO] [stderr] Compiling tower-service v0.3.3 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling stable-pattern v0.1.0 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling figment v0.10.19 [INFO] [stderr] Compiling multer v3.1.0 [INFO] [stderr] Compiling state v0.6.0 [INFO] [stderr] Compiling smallvec v1.15.0 [INFO] [stderr] Compiling either v1.15.0 [INFO] [stderr] Compiling log v0.4.27 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking getrandom v0.3.2 [INFO] [stderr] Checking http-body v0.4.6 [INFO] [stderr] Compiling rocket v0.5.1 [INFO] [stderr] Compiling glob v0.3.2 [INFO] [stderr] Checking spin v0.9.8 [INFO] [stderr] Checking tempfile v3.19.1 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking num_cpus v1.16.0 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking binascii v0.1.4 [INFO] [stderr] Checking humantime v2.2.0 [INFO] [stderr] Checking atomic v0.5.3 [INFO] [stderr] Compiling time v0.3.41 [INFO] [stderr] Checking ordered-float v5.0.0 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking env_logger v0.9.3 [INFO] [stderr] Compiling futures v0.3.31 [INFO] [stderr] Compiling devise_core v0.4.2 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling tracing-attributes v0.1.28 [INFO] [stderr] Compiling pear_codegen v0.2.9 [INFO] [stderr] Compiling ref-cast-impl v1.0.24 [INFO] [stderr] Compiling async-stream-impl v0.3.6 [INFO] [stderr] Compiling async-trait v0.1.88 [INFO] [stderr] Checking async-stream v0.3.6 [INFO] [stderr] Compiling devise_codegen v0.4.2 [INFO] [stderr] Checking tokio v1.44.2 [INFO] [stderr] Compiling pear v0.2.9 [INFO] [stderr] Compiling devise v0.4.2 [INFO] [stderr] Compiling tracing v0.1.41 [INFO] [stderr] Checking tokio-util v0.7.15 [INFO] [stderr] Checking tokio-stream v0.1.17 [INFO] [stderr] Checking indexmap v2.9.0 [INFO] [stderr] Checking toml_datetime v0.6.9 [INFO] [stderr] Checking serde_spanned v0.6.8 [INFO] [stderr] Checking ubyte v0.10.4 [INFO] [stderr] Checking serde_json v1.0.140 [INFO] [stderr] Checking toml_edit v0.22.26 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking toml v0.8.22 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking rocket_http v0.5.1 [INFO] [stderr] Compiling rocket_codegen v0.5.1 [INFO] [stderr] Checking starter-snake-rust v1.0.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/logic/simple.rs:615:13 [INFO] [stdout] | [INFO] [stdout] 615 | let mut any_collision = false; [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: variable does not need to be mutable [INFO] [stdout] --> src/logic/simple.rs:616:13 [INFO] [stdout] | [INFO] [stdout] 616 | let mut dead = false; [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `any_collision` [INFO] [stdout] --> src/logic/simple.rs:615:13 [INFO] [stdout] | [INFO] [stdout] 615 | let mut any_collision = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_any_collision` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dead` [INFO] [stdout] --> src/logic/simple.rs:616:13 [INFO] [stdout] | [INFO] [stdout] 616 | let mut dead = false; [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dead` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/logic/simple.rs:615:13 [INFO] [stdout] | [INFO] [stdout] 615 | let mut any_collision = false; [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: variable does not need to be mutable [INFO] [stdout] --> src/logic/simple.rs:616:13 [INFO] [stdout] | [INFO] [stdout] 616 | let mut dead = false; [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `any_collision` [INFO] [stdout] --> src/logic/simple.rs:615:13 [INFO] [stdout] | [INFO] [stdout] 615 | let mut any_collision = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_any_collision` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dead` [INFO] [stdout] --> src/logic/simple.rs:616:13 [INFO] [stdout] | [INFO] [stdout] 616 | let mut dead = false; [INFO] [stdout] | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dead` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/logic/simple.rs:770:13 [INFO] [stdout] | [INFO] [stdout] 770 | let mut snake = create_snake_at( [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> src/main.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 102 | pub struct GameInfo { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] 103 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `print` is never used [INFO] [stdout] --> src/logic/mm_search.rs:25:8 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 25 | fn print(&self, prefix: String, is_last: bool) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `flood_fill_heuristic` is never used [INFO] [stdout] --> src/logic/simple.rs:232:8 [INFO] [stdout] | [INFO] [stdout] 99 | impl SimpleBoard { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 232 | fn flood_fill_heuristic(&self) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `collision_with_body` is never used [INFO] [stdout] --> src/logic/simple.rs:557:8 [INFO] [stdout] | [INFO] [stdout] 495 | impl SimpleSnake { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 557 | fn collision_with_body(&self, movement: Movement) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/logic/mm_search.rs:62:13 [INFO] [stdout] | [INFO] [stdout] 62 | &next_board, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `next_board` [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: function call inside of `expect` [INFO] [stdout] --> src/logic/mm_search.rs:83:10 [INFO] [stdout] | [INFO] [stdout] 83 | .expect(&format!( [INFO] [stdout] | __________^ [INFO] [stdout] 84 | | "No best move found in values: {:?} for {} moves", [INFO] [stdout] 85 | | values, [INFO] [stdout] 86 | | simulations.len() [INFO] [stdout] 87 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 83 ~ .unwrap_or_else(|| panic!("No best move found in values: {:?} for {} moves", [INFO] [stdout] 84 + values, [INFO] [stdout] 85 ~ simulations.len())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/logic/mm_search.rs:91:1 [INFO] [stdout] | [INFO] [stdout] 91 | / fn minmax_simple( [INFO] [stdout] 92 | | board: &SimpleBoard, [INFO] [stdout] 93 | | depth: i32, [INFO] [stdout] 94 | | our_team: bool, [INFO] [stdout] ... | [INFO] [stdout] 100 | | parent: &mut TreeNode, [INFO] [stdout] 101 | | ) -> (i32, i32) { [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` 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/logic/mm_search.rs:146:13 [INFO] [stdout] | [INFO] [stdout] 146 | &next_board, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `next_board` [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: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/logic/simple.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | fn to_order(&self) -> u8 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/logic/simple.rs:163:9 [INFO] [stdout] | [INFO] [stdout] 163 | return fast_heuristic + flood_fill_heuristic; [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] 163 - return fast_heuristic + flood_fill_heuristic; [INFO] [stdout] 163 + fast_heuristic + flood_fill_heuristic [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/logic/simple.rs:167:12 [INFO] [stdout] | [INFO] [stdout] 167 | if self.snakes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.snakes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/logic/simple.rs:227:17 [INFO] [stdout] | [INFO] [stdout] 227 | let v = health_value * 1 + length_value * 8 + death_value * 20; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider reducing it to: `health_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/logic/simple.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | / match &self.snakes[f_idx] { [INFO] [stdout] 242 | | Some(snake) => { [INFO] [stdout] 243 | | let ff_size = flood_fill.get(&f_idx).unwrap().len() as i32; [INFO] [stdout] 244 | | sum_value += ff_size; [INFO] [stdout] ... | [INFO] [stdout] 249 | | None => {} [INFO] [stdout] 250 | | } [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] 241 ~ if let Some(snake) = &self.snakes[f_idx] { [INFO] [stdout] 242 + let ff_size = flood_fill.get(&f_idx).unwrap().len() as i32; [INFO] [stdout] 243 + sum_value += ff_size; [INFO] [stdout] 244 + if ff_size < snake.body.len() as i32 { [INFO] [stdout] 245 + danger_value -= snake.body.len() as i32 - ff_size; [INFO] [stdout] 246 + } [INFO] [stdout] 247 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> src/main.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 102 | pub struct GameInfo { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] 103 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `print` is never used [INFO] [stdout] --> src/logic/mm_search.rs:25:8 [INFO] [stdout] | [INFO] [stdout] 12 | impl TreeNode { [INFO] [stdout] | ------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 25 | fn print(&self, prefix: String, is_last: bool) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `flood_fill_heuristic` is never used [INFO] [stdout] --> src/logic/simple.rs:232:8 [INFO] [stdout] | [INFO] [stdout] 99 | impl SimpleBoard { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 232 | fn flood_fill_heuristic(&self) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `collision_with_body` is never used [INFO] [stdout] --> src/logic/simple.rs:557:8 [INFO] [stdout] | [INFO] [stdout] 495 | impl SimpleSnake { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 557 | fn collision_with_body(&self, movement: Movement) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [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/logic/simple.rs:257:13 [INFO] [stdout] | [INFO] [stdout] 257 | / match &self.snakes[e_idx] { [INFO] [stdout] 258 | | Some(snake) => { [INFO] [stdout] 259 | | let ff_size = flood_fill.get(&e_idx).unwrap().len() as i32; [INFO] [stdout] 260 | | sum_value -= ff_size; [INFO] [stdout] ... | [INFO] [stdout] 265 | | None => {} [INFO] [stdout] 266 | | } [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] help: try [INFO] [stdout] | [INFO] [stdout] 257 ~ if let Some(snake) = &self.snakes[e_idx] { [INFO] [stdout] 258 + let ff_size = flood_fill.get(&e_idx).unwrap().len() as i32; [INFO] [stdout] 259 + sum_value -= ff_size; [INFO] [stdout] 260 + if ff_size < snake.body.len() as i32 { [INFO] [stdout] 261 + danger_value += snake.body.len() as i32 - ff_size; [INFO] [stdout] 262 + } [INFO] [stdout] 263 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/logic/simple.rs:268:17 [INFO] [stdout] | [INFO] [stdout] 268 | let v = sum_value * 1 + danger_value * 4; [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider reducing it to: `sum_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/logic/simple.rs:301:42 [INFO] [stdout] | [INFO] [stdout] 301 | if nx >= 0 && nx < 11 && ny >= 0 && ny < 11 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..11).contains(&ny)` [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 `Range::contains` implementation [INFO] [stdout] --> src/logic/simple.rs:301:20 [INFO] [stdout] | [INFO] [stdout] 301 | if nx >= 0 && nx < 11 && ny >= 0 && ny < 11 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..11).contains(&nx)` [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: length comparison to zero [INFO] [stdout] --> src/logic/simple.rs:322:20 [INFO] [stdout] | [INFO] [stdout] 322 | if m.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `m.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/logic/simple.rs:404:12 [INFO] [stdout] | [INFO] [stdout] 404 | if simulations.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `simulations.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/logic/mm_search.rs:62:13 [INFO] [stdout] | [INFO] [stdout] 62 | &next_board, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `next_board` [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/logic/simple.rs:428:52 [INFO] [stdout] | [INFO] [stdout] 428 | || snake.collision_with_snakes(&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] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/logic/mm_search.rs:83:10 [INFO] [stdout] | [INFO] [stdout] 83 | .expect(&format!( [INFO] [stdout] | __________^ [INFO] [stdout] 84 | | "No best move found in values: {:?} for {} moves", [INFO] [stdout] 85 | | values, [INFO] [stdout] 86 | | simulations.len() [INFO] [stdout] 87 | | )); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 83 ~ .unwrap_or_else(|| panic!("No best move found in values: {:?} for {} moves", [INFO] [stdout] 84 + values, [INFO] [stdout] 85 ~ simulations.len())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/logic/simple.rs:448:24 [INFO] [stdout] | [INFO] [stdout] 448 | x: x as i32, [INFO] [stdout] | ^^^^^^^^ help: try: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/logic/simple.rs:449:24 [INFO] [stdout] | [INFO] [stdout] 449 | y: y as i32, [INFO] [stdout] | ^^^^^^^^ help: try: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/logic/mm_search.rs:91:1 [INFO] [stdout] | [INFO] [stdout] 91 | / fn minmax_simple( [INFO] [stdout] 92 | | board: &SimpleBoard, [INFO] [stdout] 93 | | depth: i32, [INFO] [stdout] 94 | | our_team: bool, [INFO] [stdout] ... | [INFO] [stdout] 100 | | parent: &mut TreeNode, [INFO] [stdout] 101 | | ) -> (i32, i32) { [INFO] [stdout] | |_______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` 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/logic/simple.rs:527:35 [INFO] [stdout] | [INFO] [stdout] 527 | !simple_out_of_bounds(&head, &m) [INFO] [stdout] | ^^^^^ help: change this to: `head` [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/logic/mm_search.rs:146:13 [INFO] [stdout] | [INFO] [stdout] 146 | &next_board, [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `next_board` [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: using `clone` on type `Coord` which implements the `Copy` trait [INFO] [stdout] --> src/logic/simple.rs:553:31 [INFO] [stdout] | [INFO] [stdout] 553 | Movement::None => head.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*head` [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: unneeded `return` statement [INFO] [stdout] --> src/logic/simple.rs:606:9 [INFO] [stdout] | [INFO] [stdout] 606 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 606 - return false; [INFO] [stdout] 606 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/logic/simple.rs:585:54 [INFO] [stdout] | [INFO] [stdout] 585 | ... if nx >= 0 && nx < 11 && ny >= 0 && ny < 11 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..11).contains(&ny)` [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: manual `Range::contains` implementation [INFO] [stdout] --> src/logic/simple.rs:585:32 [INFO] [stdout] | [INFO] [stdout] 585 | ... if nx >= 0 && nx < 11 && ny >= 0 && ny < 11 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..11).contains(&nx)` [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: this `map_or` can be simplified [INFO] [stdout] --> src/logic/simple.rs:599:29 [INFO] [stdout] | [INFO] [stdout] 599 | let collision = s [INFO] [stdout] | _____________________________^ [INFO] [stdout] 600 | | .as_ref() [INFO] [stdout] 601 | | .map_or(false, |snake| snake.body.contains(&next_pos)); [INFO] [stdout] | |______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 601 - .map_or(false, |snake| snake.body.contains(&next_pos)); [INFO] [stdout] 601 + .is_some_and(|snake| snake.body.contains(&next_pos)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/logic/simple.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | fn to_order(&self) -> u8 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/logic/simple.rs:642:9 [INFO] [stdout] | [INFO] [stdout] 642 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 642 - return false; [INFO] [stdout] 642 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/logic/simple.rs:627:29 [INFO] [stdout] | [INFO] [stdout] 627 | let collision = s [INFO] [stdout] | _____________________________^ [INFO] [stdout] 628 | | .as_ref() [INFO] [stdout] 629 | | .map_or(false, |snake| snake.body.contains(&next_pos)); [INFO] [stdout] | |______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 629 - .map_or(false, |snake| snake.body.contains(&next_pos)); [INFO] [stdout] 629 + .is_some_and(|snake| snake.body.contains(&next_pos)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/logic/simple.rs:672:9 [INFO] [stdout] | [INFO] [stdout] 672 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 672 - return false; [INFO] [stdout] 672 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/logic/simple.rs:652:29 [INFO] [stdout] | [INFO] [stdout] 652 | let collision = s [INFO] [stdout] | _____________________________^ [INFO] [stdout] 653 | | .as_ref() [INFO] [stdout] 654 | | .map_or(false, |snake| snake.body.contains(&head)); [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 654 - .map_or(false, |snake| snake.body.contains(&head)); [INFO] [stdout] 654 + .is_some_and(|snake| snake.body.contains(&head)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/logic/simple.rs:654:60 [INFO] [stdout] | [INFO] [stdout] 654 | .map_or(false, |snake| snake.body.contains(&head)); [INFO] [stdout] | ^^^^^ help: change this to: `head` [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: unneeded `return` statement [INFO] [stdout] --> src/logic.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | / return json!({ [INFO] [stdout] 33 | | "apiversion": "1", [INFO] [stdout] 34 | | "author": "Group 18", // TODO: Your Battlesnake Username [INFO] [stdout] 35 | | "color": "#e83d84", // TODO: Choose color [INFO] [stdout] 36 | | "head": "tiger-king", // TODO: Choose head [INFO] [stdout] 37 | | "tail": "coffee", // TODO: Choose tail [INFO] [stdout] 38 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 32 ~ json!({ [INFO] [stdout] 33 + "apiversion": "1", [INFO] [stdout] 34 + "author": "Group 18", // TODO: Your Battlesnake Username [INFO] [stdout] 35 + "color": "#e83d84", // TODO: Choose color [INFO] [stdout] 36 + "head": "tiger-king", // TODO: Choose head [INFO] [stdout] 37 + "tail": "coffee", // TODO: Choose tail [INFO] [stdout] 38 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/logic/simple.rs:163:9 [INFO] [stdout] | [INFO] [stdout] 163 | return fast_heuristic + flood_fill_heuristic; [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] 163 - return fast_heuristic + flood_fill_heuristic; [INFO] [stdout] 163 + fast_heuristic + flood_fill_heuristic [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/logic/simple.rs:167:12 [INFO] [stdout] | [INFO] [stdout] 167 | if self.snakes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.snakes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/logic.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | if !teammate_idx.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `teammate_idx.is_some()` [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: unneeded `return` statement [INFO] [stdout] --> src/logic.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | return json!({ "move": chosen }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 88 - return json!({ "move": chosen }); [INFO] [stdout] 88 + json!({ "move": chosen }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/logic.rs:74:32 [INFO] [stdout] | [INFO] [stdout] 74 | let moves = search(_board, &game_info); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `game_info` [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 operation has no effect [INFO] [stdout] --> src/logic/simple.rs:227:17 [INFO] [stdout] | [INFO] [stdout] 227 | let v = health_value * 1 + length_value * 8 + death_value * 20; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider reducing it to: `health_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/logic/simple.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | / match &self.snakes[f_idx] { [INFO] [stdout] 242 | | Some(snake) => { [INFO] [stdout] 243 | | let ff_size = flood_fill.get(&f_idx).unwrap().len() as i32; [INFO] [stdout] 244 | | sum_value += ff_size; [INFO] [stdout] ... | [INFO] [stdout] 249 | | None => {} [INFO] [stdout] 250 | | } [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] 241 ~ if let Some(snake) = &self.snakes[f_idx] { [INFO] [stdout] 242 + let ff_size = flood_fill.get(&f_idx).unwrap().len() as i32; [INFO] [stdout] 243 + sum_value += ff_size; [INFO] [stdout] 244 + if ff_size < snake.body.len() as i32 { [INFO] [stdout] 245 + danger_value -= snake.body.len() as i32 - ff_size; [INFO] [stdout] 246 + } [INFO] [stdout] 247 + } [INFO] [stdout] | [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/logic/simple.rs:257:13 [INFO] [stdout] | [INFO] [stdout] 257 | / match &self.snakes[e_idx] { [INFO] [stdout] 258 | | Some(snake) => { [INFO] [stdout] 259 | | let ff_size = flood_fill.get(&e_idx).unwrap().len() as i32; [INFO] [stdout] 260 | | sum_value -= ff_size; [INFO] [stdout] ... | [INFO] [stdout] 265 | | None => {} [INFO] [stdout] 266 | | } [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] help: try [INFO] [stdout] | [INFO] [stdout] 257 ~ if let Some(snake) = &self.snakes[e_idx] { [INFO] [stdout] 258 + let ff_size = flood_fill.get(&e_idx).unwrap().len() as i32; [INFO] [stdout] 259 + sum_value -= ff_size; [INFO] [stdout] 260 + if ff_size < snake.body.len() as i32 { [INFO] [stdout] 261 + danger_value += snake.body.len() as i32 - ff_size; [INFO] [stdout] 262 + } [INFO] [stdout] 263 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/logic/simple.rs:268:17 [INFO] [stdout] | [INFO] [stdout] 268 | let v = sum_value * 1 + danger_value * 4; [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider reducing it to: `sum_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/logic/simple.rs:301:42 [INFO] [stdout] | [INFO] [stdout] 301 | if nx >= 0 && nx < 11 && ny >= 0 && ny < 11 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..11).contains(&ny)` [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 `Range::contains` implementation [INFO] [stdout] --> src/logic/simple.rs:301:20 [INFO] [stdout] | [INFO] [stdout] 301 | if nx >= 0 && nx < 11 && ny >= 0 && ny < 11 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..11).contains(&nx)` [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: length comparison to zero [INFO] [stdout] --> src/logic/simple.rs:322:20 [INFO] [stdout] | [INFO] [stdout] 322 | if m.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `m.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/logic/simple.rs:404:12 [INFO] [stdout] | [INFO] [stdout] 404 | if simulations.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `simulations.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/logic/simple.rs:428:52 [INFO] [stdout] | [INFO] [stdout] 428 | || snake.collision_with_snakes(&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] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/logic/simple.rs:448:24 [INFO] [stdout] | [INFO] [stdout] 448 | x: x as i32, [INFO] [stdout] | ^^^^^^^^ help: try: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/logic/simple.rs:449:24 [INFO] [stdout] | [INFO] [stdout] 449 | y: y as i32, [INFO] [stdout] | ^^^^^^^^ help: try: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/main.rs:46:40 [INFO] [stdout] | [INFO] [stdout] 46 | let coord = Coord { x: x as i32, y: y as i32 }; [INFO] [stdout] | ^^^^^^^^ help: try: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/logic/simple.rs:527:35 [INFO] [stdout] | [INFO] [stdout] 527 | !simple_out_of_bounds(&head, &m) [INFO] [stdout] | ^^^^^ help: change this to: `head` [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: using `clone` on type `Coord` which implements the `Copy` trait [INFO] [stdout] --> src/logic/simple.rs:553:31 [INFO] [stdout] | [INFO] [stdout] 553 | Movement::None => head.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*head` [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: unneeded `return` statement [INFO] [stdout] --> src/logic/simple.rs:606:9 [INFO] [stdout] | [INFO] [stdout] 606 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 606 - return false; [INFO] [stdout] 606 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/logic/simple.rs:585:54 [INFO] [stdout] | [INFO] [stdout] 585 | ... if nx >= 0 && nx < 11 && ny >= 0 && ny < 11 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..11).contains(&ny)` [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: manual `Range::contains` implementation [INFO] [stdout] --> src/logic/simple.rs:585:32 [INFO] [stdout] | [INFO] [stdout] 585 | ... if nx >= 0 && nx < 11 && ny >= 0 && ny < 11 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..11).contains(&nx)` [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: this `map_or` can be simplified [INFO] [stdout] --> src/logic/simple.rs:599:29 [INFO] [stdout] | [INFO] [stdout] 599 | let collision = s [INFO] [stdout] | _____________________________^ [INFO] [stdout] 600 | | .as_ref() [INFO] [stdout] 601 | | .map_or(false, |snake| snake.body.contains(&next_pos)); [INFO] [stdout] | |______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 601 - .map_or(false, |snake| snake.body.contains(&next_pos)); [INFO] [stdout] 601 + .is_some_and(|snake| snake.body.contains(&next_pos)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/logic/simple.rs:642:9 [INFO] [stdout] | [INFO] [stdout] 642 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 642 - return false; [INFO] [stdout] 642 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/logic/simple.rs:627:29 [INFO] [stdout] | [INFO] [stdout] 627 | let collision = s [INFO] [stdout] | _____________________________^ [INFO] [stdout] 628 | | .as_ref() [INFO] [stdout] 629 | | .map_or(false, |snake| snake.body.contains(&next_pos)); [INFO] [stdout] | |______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 629 - .map_or(false, |snake| snake.body.contains(&next_pos)); [INFO] [stdout] 629 + .is_some_and(|snake| snake.body.contains(&next_pos)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/logic/simple.rs:672:9 [INFO] [stdout] | [INFO] [stdout] 672 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 672 - return false; [INFO] [stdout] 672 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/logic/simple.rs:652:29 [INFO] [stdout] | [INFO] [stdout] 652 | let collision = s [INFO] [stdout] | _____________________________^ [INFO] [stdout] 653 | | .as_ref() [INFO] [stdout] 654 | | .map_or(false, |snake| snake.body.contains(&head)); [INFO] [stdout] | |__________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 654 - .map_or(false, |snake| snake.body.contains(&head)); [INFO] [stdout] 654 + .is_some_and(|snake| snake.body.contains(&head)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/logic/simple.rs:654:60 [INFO] [stdout] | [INFO] [stdout] 654 | .map_or(false, |snake| snake.body.contains(&head)); [INFO] [stdout] | ^^^^^ help: change this to: `head` [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: unneeded `return` statement [INFO] [stdout] --> src/logic.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | / return json!({ [INFO] [stdout] 33 | | "apiversion": "1", [INFO] [stdout] 34 | | "author": "Group 18", // TODO: Your Battlesnake Username [INFO] [stdout] 35 | | "color": "#e83d84", // TODO: Choose color [INFO] [stdout] 36 | | "head": "tiger-king", // TODO: Choose head [INFO] [stdout] 37 | | "tail": "coffee", // TODO: Choose tail [INFO] [stdout] 38 | | }); [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 32 ~ json!({ [INFO] [stdout] 33 + "apiversion": "1", [INFO] [stdout] 34 + "author": "Group 18", // TODO: Your Battlesnake Username [INFO] [stdout] 35 + "color": "#e83d84", // TODO: Choose color [INFO] [stdout] 36 + "head": "tiger-king", // TODO: Choose head [INFO] [stdout] 37 + "tail": "coffee", // TODO: Choose tail [INFO] [stdout] 38 ~ }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/logic.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | if !teammate_idx.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `teammate_idx.is_some()` [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: unneeded `return` statement [INFO] [stdout] --> src/logic.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | return json!({ "move": chosen }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 88 - return json!({ "move": chosen }); [INFO] [stdout] 88 + json!({ "move": chosen }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/logic.rs:74:32 [INFO] [stdout] | [INFO] [stdout] 74 | let moves = search(_board, &game_info); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `game_info` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> src/main.rs:46:40 [INFO] [stdout] | [INFO] [stdout] 46 | let coord = Coord { x: x as i32, y: y as i32 }; [INFO] [stdout] | ^^^^^^^^ help: try: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 02s [INFO] running `Command { std: "docker" "inspect" "1d05e30fe4521f717cfd530783f90c7b36e4b57d778f7ab5d69d8da2abbcf803", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1d05e30fe4521f717cfd530783f90c7b36e4b57d778f7ab5d69d8da2abbcf803", kill_on_drop: false }` [INFO] [stdout] 1d05e30fe4521f717cfd530783f90c7b36e4b57d778f7ab5d69d8da2abbcf803