[INFO] cloning repository https://github.com/parkab/Battlesnake [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/parkab/Battlesnake" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fparkab%2FBattlesnake", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fparkab%2FBattlesnake'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 33c1f0df4f41c794fd3c52e22e93e5bea3a4cc76 [INFO] linting parkab/Battlesnake against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fparkab%2FBattlesnake" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] [stderr] Updating files: 33% (1442/4345) Updating files: 34% (1478/4345) Updating files: 35% (1521/4345) Updating files: 36% (1565/4345) Updating files: 37% (1608/4345) Updating files: 38% (1652/4345) Updating files: 38% (1664/4345) Updating files: 39% (1695/4345) Updating files: 40% (1738/4345) Updating files: 41% (1782/4345) Updating files: 42% (1825/4345) Updating files: 42% (1830/4345) Updating files: 43% (1869/4345) Updating files: 44% (1912/4345) Updating files: 45% (1956/4345) Updating files: 46% (1999/4345) Updating files: 46% (2022/4345) Updating files: 47% (2043/4345) Updating files: 48% (2086/4345) Updating files: 49% (2130/4345) Updating files: 49% (2139/4345) Updating files: 50% (2173/4345) Updating files: 51% (2216/4345) Updating files: 52% (2260/4345) Updating files: 53% (2303/4345) Updating files: 54% (2347/4345) Updating files: 55% (2390/4345) Updating files: 55% (2403/4345) Updating files: 56% (2434/4345) Updating files: 57% (2477/4345) Updating files: 58% (2521/4345) Updating files: 59% (2564/4345) Updating files: 60% (2607/4345) Updating files: 61% (2651/4345) Updating files: 62% (2694/4345) Updating files: 63% (2738/4345) Updating files: 64% (2781/4345) Updating files: 65% (2825/4345) Updating files: 66% (2868/4345) Updating files: 66% (2891/4345) Updating files: 67% (2912/4345) Updating files: 68% (2955/4345) Updating files: 69% (2999/4345) Updating files: 70% (3042/4345) Updating files: 71% (3085/4345) Updating files: 72% (3129/4345) Updating files: 73% (3172/4345) Updating files: 74% (3216/4345) Updating files: 75% (3259/4345) Updating files: 76% (3303/4345) Updating files: 77% (3346/4345) Updating files: 78% (3390/4345) Updating files: 79% (3433/4345) Updating files: 80% (3476/4345) Updating files: 81% (3520/4345) Updating files: 82% (3563/4345) Updating files: 83% (3607/4345) Updating files: 84% (3650/4345) Updating files: 85% (3694/4345) Updating files: 86% (3737/4345) Updating files: 87% (3781/4345) Updating files: 88% (3824/4345) Updating files: 89% (3868/4345) Updating files: 90% (3911/4345) Updating files: 91% (3954/4345) Updating files: 92% (3998/4345) Updating files: 92% (4001/4345) Updating files: 93% (4041/4345) Updating files: 94% (4085/4345) Updating files: 95% (4128/4345) Updating files: 96% (4172/4345) Updating files: 97% (4215/4345) Updating files: 98% (4259/4345) Updating files: 98% (4268/4345) Updating files: 99% (4302/4345) Updating files: 100% (4345/4345) Updating files: 100% (4345/4345), done. [INFO] started tweaking git repo https://github.com/parkab/Battlesnake [INFO] finished tweaking git repo https://github.com/parkab/Battlesnake [INFO] tweaked toml for git repo https://github.com/parkab/Battlesnake written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/parkab/Battlesnake 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/parkab/Battlesnake 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 regex-lite v0.1.9 [INFO] [stderr] Downloaded zerocopy-derive v0.8.40 [INFO] [stderr] Downloaded actix-router v0.5.4 [INFO] [stderr] Downloaded cc v1.2.56 [INFO] [stderr] Downloaded actix-http v3.12.0 [INFO] [stderr] Downloaded actix-web v4.13.0 [INFO] [stderr] Downloaded zerocopy v0.8.40 [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] ce02fb2aefc679c07e9a1cf3f8b420570e35154a062a8d3c1440b5a56c268666 [INFO] running `Command { std: "docker" "start" "-a" "ce02fb2aefc679c07e9a1cf3f8b420570e35154a062a8d3c1440b5a56c268666", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "ce02fb2aefc679c07e9a1cf3f8b420570e35154a062a8d3c1440b5a56c268666", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ce02fb2aefc679c07e9a1cf3f8b420570e35154a062a8d3c1440b5a56c268666", kill_on_drop: false }` [INFO] [stdout] ce02fb2aefc679c07e9a1cf3f8b420570e35154a062a8d3c1440b5a56c268666 [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] 291fee40901e86ed96fd9b052591cde3c89aa2010223009a0822bf8c29abd6dd [INFO] running `Command { std: "docker" "start" "-a" "291fee40901e86ed96fd9b052591cde3c89aa2010223009a0822bf8c29abd6dd", kill_on_drop: false }` [INFO] [stderr] Compiling unicode-ident v1.0.24 [INFO] [stderr] Compiling quote v1.0.45 [INFO] [stderr] Checking cfg-if v1.0.4 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Checking stable_deref_trait v1.2.1 [INFO] [stderr] Checking pin-project-lite v0.2.17 [INFO] [stderr] Checking bytes v1.11.1 [INFO] [stderr] Checking log v0.4.29 [INFO] [stderr] Compiling parking_lot_core v0.9.12 [INFO] [stderr] Checking futures-core v0.3.32 [INFO] [stderr] Checking lock_api v0.4.14 [INFO] [stderr] Compiling zerocopy v0.8.40 [INFO] [stderr] Compiling typenum v1.19.0 [INFO] [stderr] Compiling libc v0.2.182 [INFO] [stderr] Compiling find-msvc-tools v0.1.9 [INFO] [stderr] Checking socket2 v0.6.3 [INFO] [stderr] Checking memchr v2.8.0 [INFO] [stderr] Compiling proc-macro2 v1.0.106 [INFO] [stderr] Checking litemap v0.8.1 [INFO] [stderr] Checking writeable v0.6.2 [INFO] [stderr] Checking tracing-core v0.1.36 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling icu_normalizer_data v2.1.1 [INFO] [stderr] Compiling icu_properties_data v2.1.2 [INFO] [stderr] Compiling getrandom v0.3.4 [INFO] [stderr] Checking futures-sink v0.3.32 [INFO] [stderr] Checking percent-encoding v2.3.2 [INFO] [stderr] Checking local-waker v0.1.4 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Checking futures-task v0.3.32 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Compiling crc32fast v1.5.0 [INFO] [stderr] Compiling unicode-segmentation v1.12.0 [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Checking slab v0.4.12 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Checking aho-corasick v1.1.4 [INFO] [stderr] Checking futures-util v0.3.32 [INFO] [stderr] Checking simd-adler32 v0.3.8 [INFO] [stderr] Compiling num-conv v0.2.0 [INFO] [stderr] Checking rand_core v0.9.5 [INFO] [stderr] Compiling jobserver v0.1.34 [INFO] [stderr] Checking hashbrown v0.16.1 [INFO] [stderr] Checking regex-syntax v0.8.10 [INFO] [stderr] Compiling time-core v0.1.8 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Compiling syn v2.0.117 [INFO] [stderr] Compiling convert_case v0.10.0 [INFO] [stderr] Compiling tracing v0.1.44 [INFO] [stderr] Compiling time-macros v0.2.27 [INFO] [stderr] Checking deranged v0.5.8 [INFO] [stderr] Checking form_urlencoded v1.2.2 [INFO] [stderr] Checking actix-utils v3.0.1 [INFO] [stderr] Checking bytestring v1.5.0 [INFO] [stderr] Checking actix-service v2.0.3 [INFO] [stderr] Checking getrandom v0.2.17 [INFO] [stderr] Compiling cc v1.2.56 [INFO] [stderr] Checking indexmap v2.13.0 [INFO] [stderr] Compiling cookie v0.16.2 [INFO] [stderr] Checking bitflags v2.11.0 [INFO] [stderr] Compiling regex-lite v0.1.9 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking flate2 v1.1.9 [INFO] [stderr] Checking brotli v8.0.2 [INFO] [stderr] Checking local-channel v0.1.5 [INFO] [stderr] Checking encoding_rs v0.8.35 [INFO] [stderr] Checking socket2 v0.5.10 [INFO] [stderr] Checking foldhash v0.1.5 [INFO] [stderr] Checking language-tags v0.3.2 [INFO] [stderr] Checking base64 v0.22.1 [INFO] [stderr] Checking ryu v1.0.23 [INFO] [stderr] Checking crypto-common v0.1.7 [INFO] [stderr] Checking block-buffer v0.10.4 [INFO] [stderr] Checking serde_json v1.0.149 [INFO] [stderr] Checking impl-more v0.1.9 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking time v0.3.47 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking regex-automata v0.4.14 [INFO] [stderr] Compiling zstd-sys v2.0.16+zstd.1.5.7 [INFO] [stderr] Compiling actix-router v0.5.4 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking regex v1.12.3 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling tokio-macros v2.6.1 [INFO] [stderr] Compiling tracing-attributes v0.1.31 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling derive_more-impl v2.1.1 [INFO] [stderr] Compiling actix-web-codegen v4.3.0 [INFO] [stderr] Compiling actix-macros v0.2.4 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Checking tokio v1.50.0 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Checking derive_more v2.1.1 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking icu_properties v2.1.2 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking url v2.5.8 [INFO] [stderr] Checking tokio-util v0.7.18 [INFO] [stderr] Checking actix-rt v2.11.0 [INFO] [stderr] Checking actix-server v2.6.0 [INFO] [stderr] Checking h2 v0.3.27 [INFO] [stderr] Checking actix-codec v0.5.2 [INFO] [stderr] Checking actix-http v3.12.0 [INFO] [stderr] Checking actix-web v4.13.0 [INFO] [stderr] Checking apex-predator v2.0.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the loop variable `i` is only used to index `owned` [INFO] [stdout] --> src/heuristic.rs:123:22 [INFO] [stdout] | [INFO] [stdout] 123 | for i in 0..num { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 123 - for i in 0..num { [INFO] [stdout] 123 + for in owned.iter_mut().take(num) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/minimax.rs:317:17 [INFO] [stdout] | [INFO] [stdout] 317 | / if depth <= 0 { [INFO] [stdout] 318 | | if self.timed_out() || !self.is_noisy(&next) || depth <= -2 { [INFO] [stdout] 319 | | return heuristic::evaluate(&next); [INFO] [stdout] 320 | | } [INFO] [stdout] 321 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 317 ~ if depth <= 0 [INFO] [stdout] 318 ~ && (self.timed_out() || !self.is_noisy(&next) || depth <= -2) { [INFO] [stdout] 319 | return heuristic::evaluate(&next); [INFO] [stdout] 320 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/minimax.rs:329:33 [INFO] [stdout] | [INFO] [stdout] 329 | / ... if entry.score >= beta { [INFO] [stdout] 330 | | ... return entry.score; [INFO] [stdout] 331 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 328 ~ 1 [INFO] [stdout] 329 ~ if entry.score >= beta => { [INFO] [stdout] 330 | return entry.score; [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/minimax.rs:334:33 [INFO] [stdout] | [INFO] [stdout] 334 | / ... if entry.score <= alpha { [INFO] [stdout] 335 | | ... return entry.score; [INFO] [stdout] 336 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 333 ~ 2 [INFO] [stdout] 334 ~ if entry.score <= alpha => { [INFO] [stdout] 335 | return entry.score; [INFO] [stdout] 336 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/minimax.rs:464:9 [INFO] [stdout] | [INFO] [stdout] 464 | scored.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 464 - scored.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 464 + scored.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `eliminate` [INFO] [stdout] --> src/simulator.rs:487:18 [INFO] [stdout] | [INFO] [stdout] 487 | for i in 0..next.num_snakes as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 487 - for i in 0..next.num_snakes as usize { [INFO] [stdout] 487 + for (i, ) in eliminate.iter().enumerate().take(next.num_snakes as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/strategy.rs:198:20 [INFO] [stdout] | [INFO] [stdout] 198 | if board.is_in_bounds(ax, ay) && !board.is_safe(ax, ay) [INFO] [stdout] | ____________________^ [INFO] [stdout] 199 | | && !board.is_tail_freeing(ax, ay) [INFO] [stdout] 200 | | && !(ax == head.x && ay == head.y) [INFO] [stdout] | |______________________________________________________^ help: try: `!(!board.is_in_bounds(ax, ay) || board.is_safe(ax, ay) || board.is_tail_freeing(ax, ay) || ax == head.x && ay == head.y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/strategy.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | / if board.is_enemy_reachable(cand.x, cand.y) && !board.is_in_danger_zone(cand.x, cand.y) { [INFO] [stdout] 213 | | if enemies.len() >= 2 { [INFO] [stdout] 214 | | cand.score -= 1.0; [INFO] [stdout] 215 | | } [INFO] [stdout] 216 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 212 ~ if board.is_enemy_reachable(cand.x, cand.y) && !board.is_in_danger_zone(cand.x, cand.y) [INFO] [stdout] 213 ~ && enemies.len() >= 2 { [INFO] [stdout] 214 | cand.score -= 1.0; [INFO] [stdout] 215 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/strategy.rs:443:12 [INFO] [stdout] | [INFO] [stdout] 443 | if tracker.map_or(false, |t| t.is_territory_collapsing()) { [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] 443 - if tracker.map_or(false, |t| t.is_territory_collapsing()) { [INFO] [stdout] 443 + if tracker.is_some_and(|t| t.is_territory_collapsing()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/strategy.rs:547:1 [INFO] [stdout] | [INFO] [stdout] 547 | / fn determine_aggression_mode( [INFO] [stdout] 548 | | my_len: i32, [INFO] [stdout] 549 | | max_enemy_len: i32, [INFO] [stdout] 550 | | my_health: i32, [INFO] [stdout] ... | [INFO] [stdout] 555 | | tracker: Option<&GameTracker>, [INFO] [stdout] 556 | | ) -> AggressionMode { [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 `map_or` can be simplified [INFO] [stdout] --> src/strategy.rs:576:8 [INFO] [stdout] | [INFO] [stdout] 576 | if tracker.map_or(false, |t| t.is_territory_collapsing()) && my_len >= max_enemy_len { [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] 576 - if tracker.map_or(false, |t| t.is_territory_collapsing()) && my_len >= max_enemy_len { [INFO] [stdout] 576 + if tracker.is_some_and(|t| t.is_territory_collapsing()) && my_len >= max_enemy_len { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `moves` [INFO] [stdout] --> src/strategy.rs:610:14 [INFO] [stdout] | [INFO] [stdout] 610 | for i in 0..sim.num_snakes as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 610 - for i in 0..sim.num_snakes as usize { [INFO] [stdout] 610 + for (i, ) in moves.iter_mut().enumerate().take(sim.num_snakes as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `moves` [INFO] [stdout] --> src/strategy.rs:626:18 [INFO] [stdout] | [INFO] [stdout] 626 | for i in 0..sim.num_snakes as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 626 - for i in 0..sim.num_snakes as usize { [INFO] [stdout] 626 + for (i, ) in moves.iter_mut().enumerate().take(sim.num_snakes as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `owned` [INFO] [stdout] --> src/heuristic.rs:123:22 [INFO] [stdout] | [INFO] [stdout] 123 | for i in 0..num { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 123 - for i in 0..num { [INFO] [stdout] 123 + for in owned.iter_mut().take(num) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/minimax.rs:317:17 [INFO] [stdout] | [INFO] [stdout] 317 | / if depth <= 0 { [INFO] [stdout] 318 | | if self.timed_out() || !self.is_noisy(&next) || depth <= -2 { [INFO] [stdout] 319 | | return heuristic::evaluate(&next); [INFO] [stdout] 320 | | } [INFO] [stdout] 321 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 317 ~ if depth <= 0 [INFO] [stdout] 318 ~ && (self.timed_out() || !self.is_noisy(&next) || depth <= -2) { [INFO] [stdout] 319 | return heuristic::evaluate(&next); [INFO] [stdout] 320 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/minimax.rs:329:33 [INFO] [stdout] | [INFO] [stdout] 329 | / ... if entry.score >= beta { [INFO] [stdout] 330 | | ... return entry.score; [INFO] [stdout] 331 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 328 ~ 1 [INFO] [stdout] 329 ~ if entry.score >= beta => { [INFO] [stdout] 330 | return entry.score; [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/minimax.rs:334:33 [INFO] [stdout] | [INFO] [stdout] 334 | / ... if entry.score <= alpha { [INFO] [stdout] 335 | | ... return entry.score; [INFO] [stdout] 336 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 333 ~ 2 [INFO] [stdout] 334 ~ if entry.score <= alpha => { [INFO] [stdout] 335 | return entry.score; [INFO] [stdout] 336 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/minimax.rs:464:9 [INFO] [stdout] | [INFO] [stdout] 464 | scored.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 464 - scored.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 464 + scored.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `eliminate` [INFO] [stdout] --> src/simulator.rs:487:18 [INFO] [stdout] | [INFO] [stdout] 487 | for i in 0..next.num_snakes as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 487 - for i in 0..next.num_snakes as usize { [INFO] [stdout] 487 + for (i, ) in eliminate.iter().enumerate().take(next.num_snakes as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/strategy.rs:198:20 [INFO] [stdout] | [INFO] [stdout] 198 | if board.is_in_bounds(ax, ay) && !board.is_safe(ax, ay) [INFO] [stdout] | ____________________^ [INFO] [stdout] 199 | | && !board.is_tail_freeing(ax, ay) [INFO] [stdout] 200 | | && !(ax == head.x && ay == head.y) [INFO] [stdout] | |______________________________________________________^ help: try: `!(!board.is_in_bounds(ax, ay) || board.is_safe(ax, ay) || board.is_tail_freeing(ax, ay) || ax == head.x && ay == head.y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/strategy.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | / if board.is_enemy_reachable(cand.x, cand.y) && !board.is_in_danger_zone(cand.x, cand.y) { [INFO] [stdout] 213 | | if enemies.len() >= 2 { [INFO] [stdout] 214 | | cand.score -= 1.0; [INFO] [stdout] 215 | | } [INFO] [stdout] 216 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 212 ~ if board.is_enemy_reachable(cand.x, cand.y) && !board.is_in_danger_zone(cand.x, cand.y) [INFO] [stdout] 213 ~ && enemies.len() >= 2 { [INFO] [stdout] 214 | cand.score -= 1.0; [INFO] [stdout] 215 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/strategy.rs:443:12 [INFO] [stdout] | [INFO] [stdout] 443 | if tracker.map_or(false, |t| t.is_territory_collapsing()) { [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] 443 - if tracker.map_or(false, |t| t.is_territory_collapsing()) { [INFO] [stdout] 443 + if tracker.is_some_and(|t| t.is_territory_collapsing()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/strategy.rs:547:1 [INFO] [stdout] | [INFO] [stdout] 547 | / fn determine_aggression_mode( [INFO] [stdout] 548 | | my_len: i32, [INFO] [stdout] 549 | | max_enemy_len: i32, [INFO] [stdout] 550 | | my_health: i32, [INFO] [stdout] ... | [INFO] [stdout] 555 | | tracker: Option<&GameTracker>, [INFO] [stdout] 556 | | ) -> AggressionMode { [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 `map_or` can be simplified [INFO] [stdout] --> src/strategy.rs:576:8 [INFO] [stdout] | [INFO] [stdout] 576 | if tracker.map_or(false, |t| t.is_territory_collapsing()) && my_len >= max_enemy_len { [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] 576 - if tracker.map_or(false, |t| t.is_territory_collapsing()) && my_len >= max_enemy_len { [INFO] [stdout] 576 + if tracker.is_some_and(|t| t.is_territory_collapsing()) && my_len >= max_enemy_len { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `moves` [INFO] [stdout] --> src/strategy.rs:610:14 [INFO] [stdout] | [INFO] [stdout] 610 | for i in 0..sim.num_snakes as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 610 - for i in 0..sim.num_snakes as usize { [INFO] [stdout] 610 + for (i, ) in moves.iter_mut().enumerate().take(sim.num_snakes as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `moves` [INFO] [stdout] --> src/strategy.rs:626:18 [INFO] [stdout] | [INFO] [stdout] 626 | for i in 0..sim.num_snakes as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 626 - for i in 0..sim.num_snakes as usize { [INFO] [stdout] 626 + for (i, ) in moves.iter_mut().enumerate().take(sim.num_snakes as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 45.07s [INFO] running `Command { std: "docker" "inspect" "291fee40901e86ed96fd9b052591cde3c89aa2010223009a0822bf8c29abd6dd", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "291fee40901e86ed96fd9b052591cde3c89aa2010223009a0822bf8c29abd6dd", kill_on_drop: false }` [INFO] [stdout] 291fee40901e86ed96fd9b052591cde3c89aa2010223009a0822bf8c29abd6dd