[INFO] cloning repository https://github.com/Kwarf/Allie-2017 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Kwarf/Allie-2017" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKwarf%2FAllie-2017", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKwarf%2FAllie-2017'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] bd2a1bc2b49e2c6bb8a7d7b20602219ef7f2b724 [INFO] linting Kwarf/Allie-2017 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKwarf%2FAllie-2017" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Kwarf/Allie-2017 [INFO] finished tweaking git repo https://github.com/Kwarf/Allie-2017 [INFO] tweaked toml for git repo https://github.com/Kwarf/Allie-2017 written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Kwarf/Allie-2017 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/Kwarf/Allie-2017 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] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded num-traits v0.1.37 [INFO] [stderr] Downloaded syn v0.11.9 [INFO] [stderr] Downloaded bitflags v0.8.0 [INFO] [stderr] Downloaded ansi_term v0.9.0 [INFO] [stderr] Downloaded atty v0.2.2 [INFO] [stderr] Downloaded either v1.1.0 [INFO] [stderr] Downloaded serde_json v0.9.9 [INFO] [stderr] Downloaded itertools v0.5.9 [INFO] [stderr] Downloaded libc v0.2.21 [INFO] [stderr] Downloaded unicode-segmentation v1.1.0 [INFO] [stderr] Downloaded dtoa v0.4.1 [INFO] [stderr] Downloaded itoa v0.3.1 [INFO] [stderr] Downloaded pathfinding v0.1.10 [INFO] [stderr] Downloaded serde_derive v0.9.11 [INFO] [stderr] Downloaded clap v2.21.1 [INFO] [stderr] Downloaded serde_codegen_internals v0.14.1 [INFO] [stderr] Downloaded strsim v0.6.0 [INFO] [stderr] Downloaded term_size v0.2.3 [INFO] [stderr] Downloaded vec_map v0.7.0 [INFO] [stderr] Downloaded serde v0.9.11 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 357c704b2799e6818bf3295c01db2fd3acbe10ccc709f2d8b679d9263c01195b [INFO] running `Command { std: "docker" "start" "-a" "357c704b2799e6818bf3295c01db2fd3acbe10ccc709f2d8b679d9263c01195b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "357c704b2799e6818bf3295c01db2fd3acbe10ccc709f2d8b679d9263c01195b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "357c704b2799e6818bf3295c01db2fd3acbe10ccc709f2d8b679d9263c01195b", kill_on_drop: false }` [INFO] [stdout] 357c704b2799e6818bf3295c01db2fd3acbe10ccc709f2d8b679d9263c01195b [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 1d0d4a96f6169994742b2b4536595ee8e23497de8a6cf619ab6b686c1606c0d4 [INFO] running `Command { std: "docker" "start" "-a" "1d0d4a96f6169994742b2b4536595ee8e23497de8a6cf619ab6b686c1606c0d4", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Compiling unicode-xid v0.0.4 [INFO] [stderr] Checking libc v0.2.21 [INFO] [stderr] Compiling quote v0.3.15 [INFO] [stderr] Checking num-traits v0.1.37 [INFO] [stderr] Checking vec_map v0.7.0 [INFO] [stderr] Checking either v1.1.0 [INFO] [stderr] Checking unicode-segmentation v1.1.0 [INFO] [stderr] Checking bitflags v0.8.0 [INFO] [stderr] Checking ansi_term v0.9.0 [INFO] [stderr] Compiling synom v0.11.3 [INFO] [stderr] Checking unicode-width v0.1.4 [INFO] [stderr] Checking itoa v0.3.1 [INFO] [stderr] Checking dtoa v0.4.1 [INFO] [stderr] Checking serde v0.9.11 [INFO] [stderr] Checking strsim v0.6.0 [INFO] [stderr] Checking term_size v0.2.3 [INFO] [stderr] Compiling syn v0.11.9 [INFO] [stderr] Checking atty v0.2.2 [INFO] [stderr] Checking itertools v0.5.9 [INFO] [stderr] Checking clap v2.21.1 [INFO] [stderr] Checking pathfinding v0.1.10 [INFO] [stderr] Compiling serde_codegen_internals v0.14.1 [INFO] [stderr] Compiling serde_derive v0.9.11 [INFO] [stderr] Checking serde_json v0.9.9 [INFO] [stderr] Checking allie v1.2.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `Instant` [INFO] [stdout] --> src/main.rs:15:27 [INFO] [stdout] | [INFO] [stdout] 15 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `self::killer::Killer` [INFO] [stdout] --> src/ai/strategies/mod.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | pub use self::killer::Killer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/common/mod.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/common/mod.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | y: y, [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/mod.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | y: y, [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/main.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | const ARG_IP: &'static str = "ip"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/main.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | const ARG_PORT: &'static str = "port"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Instant` [INFO] [stdout] --> src/main.rs:15:27 [INFO] [stdout] | [INFO] [stdout] 15 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/ai/pathfinder.rs:135:25 [INFO] [stdout] | [INFO] [stdout] 135 | const DEFAULT_MAP: &'static str = r#"{"content":["||||||||||||||||||||||||||||","|............||............|","|.||||.|||||.||... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/ai/strategies/avoidance.rs:103:23 [INFO] [stdout] | [INFO] [stdout] 103 | ... const STATE: &'static str = r#"{"gamestate":{"map":{"content":["||||||||||||||||||||||||||||","|____________||____________|",... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/ai/mod.rs:16:33 [INFO] [stdout] | [INFO] [stdout] 16 | strategies: Vec>>, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 16 | strategies: Vec>>, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `self::killer::Killer` [INFO] [stdout] --> src/ai/strategies/mod.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | pub use self::killer::Killer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/common/mod.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | x: x, [INFO] [stdout] | ^^^^ help: replace it with: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/common/mod.rs:56:13 [INFO] [stdout] | [INFO] [stdout] 56 | y: y, [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/common/mod.rs:153:25 [INFO] [stdout] | [INFO] [stdout] 153 | const DEFAULT_MAP: &'static str = r#"{"content":["||||||||||||||||||||||||||||","|............||............|","|.||||.|||||.||... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/mod.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | y: y, [INFO] [stdout] | ^^^^ help: replace it with: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:256:21 [INFO] [stdout] | [INFO] [stdout] 256 | const DEFAULT: &'static str = r#"{"content":["||||||||||||||||||||||||||||","|............||............|","|.||||.|||||.||.|||... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:257:23 [INFO] [stdout] | [INFO] [stdout] 257 | const MSPACMAN1: &'static str = r#"{"content":["||||||||||||||||||||||||||||","|......||..........||......|","|o||||.||.|||||||... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:258:23 [INFO] [stdout] | [INFO] [stdout] 258 | const MSPACMAN2: &'static str = r#"{"content":["||||||||||||||||||||||||||||","_______||..........||_______","||||||_||.|||||||... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:259:23 [INFO] [stdout] | [INFO] [stdout] 259 | const MSPACMAN3: &'static str = r#"{"content":["||||||||||||||||||||||||||||","|.........||....||.........|","|.|||||||.||.||.|... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:260:23 [INFO] [stdout] | [INFO] [stdout] 260 | const MSPACMAN4: &'static str = r#"{"content":["||||||||||||||||||||||||||||","|..........................|","|.||.||||.|||||||... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:261:20 [INFO] [stdout] | [INFO] [stdout] 261 | const PACMAN: &'static str = r#"{"content":["||||||||||||||||||||||||||||","|............||............|","|.||||.|||||.||.||||... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:282:37 [INFO] [stdout] | [INFO] [stdout] 282 | const SIMPLE_INTERSECTION: &'static str = r#" [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:307:40 [INFO] [stdout] | [INFO] [stdout] 307 | const THREE_WAY_INTERSECTION: &'static str = r#" [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:331:22 [INFO] [stdout] | [INFO] [stdout] 331 | const TURN: &'static str = r#" [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:353:26 [INFO] [stdout] | [INFO] [stdout] 353 | const STRAIGHT: &'static str = r#" [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:376:25 [INFO] [stdout] | [INFO] [stdout] 376 | const TESTMAP: &'static str = r#" [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/game/mod.rs:400:40 [INFO] [stdout] | [INFO] [stdout] 400 | const THREE_WAY_INTERSECTION: &'static str = r#" [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/protocol/json.rs:79:29 [INFO] [stdout] | [INFO] [stdout] 79 | const EXAMPLE_WELCOME: &'static str = r#"{"map":{"content":["||||||||||||||||||||||||||||","|............||............|","|.|||... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/protocol/json.rs:80:33 [INFO] [stdout] | [INFO] [stdout] 80 | const EXAMPLE_STATEUPDATE: &'static str = r#"{"gamestate":{"map":{"content":["||||||||||||||||||||||||||||","|............||....... [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/main.rs:27:16 [INFO] [stdout] | [INFO] [stdout] 27 | const ARG_IP: &'static str = "ip"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/main.rs:28:18 [INFO] [stdout] | [INFO] [stdout] 28 | const ARG_PORT: &'static str = "port"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/ai/mod.rs:16:33 [INFO] [stdout] | [INFO] [stdout] 16 | strategies: Vec>>, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 16 | strategies: Vec>>, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `duration_in_ms` is never used [INFO] [stdout] --> src/main.rs:111:4 [INFO] [stdout] | [INFO] [stdout] 111 | fn duration_in_ms(duration: &Duration) -> f32 { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Killer` is never constructed [INFO] [stdout] --> src/ai/strategies/mod.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 16 | pub enum StrategyType { [INFO] [stdout] | ------------ variant in this enum [INFO] [stdout] ... [INFO] [stdout] 19 | Killer, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `StrategyType` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Killer` is never constructed [INFO] [stdout] --> src/ai/strategies/killer.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct Killer; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `new` and `shortest_enemy_path_cost` are never used [INFO] [stdout] --> src/ai/strategies/killer.rs:13:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl Killer { [INFO] [stdout] | ----------- associated functions in this implementation [INFO] [stdout] 13 | pub fn new() -> Killer { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 17 | fn shortest_enemy_path_cost(map: &Map, enemies: &[Player], to: &Position) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_enemy_nearby` is never used [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:21:8 [INFO] [stdout] | [INFO] [stdout] 14 | impl PickPellets { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 21 | fn is_enemy_nearby(&self, bot: &Bot, state: &GameState) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_super_pellet` is never used [INFO] [stdout] --> src/game/mod.rs:32:12 [INFO] [stdout] | [INFO] [stdout] 17 | impl TileType { [INFO] [stdout] | ------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 32 | pub fn is_super_pellet(&self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `neighbours`, `pellets`, `super_pellets`, and `index_to_position` are never used [INFO] [stdout] --> src/game/mod.rs:56:12 [INFO] [stdout] | [INFO] [stdout] 47 | impl Map { [INFO] [stdout] | -------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 56 | pub fn neighbours(&self, position: &Position) -> Vec<(Direction, TileType)> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 71 | pub fn pellets(&self) -> HashSet { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 81 | pub fn super_pellets(&self) -> HashSet { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | fn index_to_position(&self, index: usize) -> Position { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `walkable_positions`, `closest_turning_points`, and `dead_ends` are never used [INFO] [stdout] --> src/game/mod.rs:207:12 [INFO] [stdout] | [INFO] [stdout] 132 | impl MapInformation { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 207 | pub fn walkable_positions(&self) -> &HashSet { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 211 | pub fn closest_turning_points(&self, limits: &T, position: &Position) -> HashSet { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 232 | pub fn dead_ends(&self) -> &HashSet { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `id` and `score` are never read [INFO] [stdout] --> src/protocol/mod.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 23 | pub struct Player { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 24 | id: u32, [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 30 | score: u32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Player` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/protocol/mod.rs:57:26 [INFO] [stdout] | [INFO] [stdout] 57 | DeserializationError(serde_json::error::Error), [INFO] [stdout] | -------------------- ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 57 - DeserializationError(serde_json::error::Error), [INFO] [stdout] 57 + DeserializationError(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `MessageType` is never used [INFO] [stdout] --> src/protocol/message_type.rs:4:10 [INFO] [stdout] | [INFO] [stdout] 4 | pub enum MessageType { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `MessageTypeError` is never used [INFO] [stdout] --> src/protocol/message_type.rs:13:10 [INFO] [stdout] | [INFO] [stdout] 13 | pub enum MessageTypeError { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/ai/pathfinder.rs:31:50 [INFO] [stdout] | [INFO] [stdout] 31 | frontier.push_back((my_position.clone(), 0 as usize)); [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/ai/pathfinder.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / self.nodes [INFO] [stdout] 53 | | .get(position) [INFO] [stdout] 54 | | .and_then(|n| Some(n.cost)) [INFO] [stdout] | |_______________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 52 ~ self.nodes [INFO] [stdout] 53 + .get(position).map(|n| n.cost) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/pathfinder.rs:64:44 [INFO] [stdout] | [INFO] [stdout] 64 | while let Some(n) = self.nodes.get(&path.last().unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `path.last().unwrap()` [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/ai/pathfinder.rs:79:68 [INFO] [stdout] | [INFO] [stdout] 79 | ... , |p| p.neighbours(map).into_iter().filter(|x| map.tile_at(&x).is_walkable() && enemies.iter().find(|e| e.position() == *x).is... [INFO] [stdout] | ^^ help: change this to: `x` [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/ai/pathfinder.rs:80:27 [INFO] [stdout] | [INFO] [stdout] 80 | , |p| map.tile_at(&p).is_pellet() && extra_filter(p)); [INFO] [stdout] | ^^ help: change this to: `p` [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: usage of a legacy numeric method [INFO] [stdout] --> src/ai/pathfinder.rs:97:20 [INFO] [stdout] | [INFO] [stdout] 97 | .unwrap_or(usize::max_value()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 97 - .unwrap_or(usize::max_value()) [INFO] [stdout] 97 + .unwrap_or(usize::MAX) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/pathfinder.rs:101:148 [INFO] [stdout] | [INFO] [stdout] 101 | ...()).map(|x| (x, 1)), |p| p.manhattan_distance_to(&to, map) as usize, |p| *p == *to); [INFO] [stdout] | ^^^ help: change this to: `to` [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/ai/pathfinder.rs:106:205 [INFO] [stdout] | [INFO] [stdout] 106 | ...()).map(|x| (x, 1)), |p| p.manhattan_distance_to(&to, map) as usize, |p| *p == *to); [INFO] [stdout] | ^^^ help: change this to: `to` [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: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/avoidance.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | .unwrap_or(usize::max_value()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 37 - .unwrap_or(usize::max_value()); [INFO] [stdout] 37 + .unwrap_or(usize::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/strategies/avoidance.rs:44:69 [INFO] [stdout] | [INFO] [stdout] 44 | return state.me.position().direction_to(&state.map, &path_to_exit.last().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `path_to_exit.last().unwrap()` [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 boolean expression can be simplified [INFO] [stdout] --> src/ai/strategies/avoidance.rs:54:25 [INFO] [stdout] | [INFO] [stdout] 54 | .filter(|e| !(bot.can_eat_others() && !e.is_dangerous)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!bot.can_eat_others() || e.is_dangerous` [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: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/avoidance.rs:55:71 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|e| (bot.path_graph.cost_to(&e.position()).unwrap_or(usize::max_value()), e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 55 - .map(|e| (bot.path_graph.cost_to(&e.position()).unwrap_or(usize::max_value()), e)) [INFO] [stdout] 55 + .map(|e| (bot.path_graph.cost_to(&e.position()).unwrap_or(usize::MAX), e)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ai/strategies/avoidance.rs:62:16 [INFO] [stdout] | [INFO] [stdout] 62 | if enemy_directions.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `enemy_directions.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/strategies/avoidance.rs:68:89 [INFO] [stdout] | [INFO] [stdout] 68 | .filter(|d| state.map.tile_at(&state.me.position().adjacent(&state.map, &d)).is_walkable()) [INFO] [stdout] | ^^ help: change this to: `d` [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/ai/strategies/avoidance.rs:69:161 [INFO] [stdout] | [INFO] [stdout] 69 | ...ead_end(&state.me.position().adjacent(&state.map, &d))) [INFO] [stdout] | ^^ help: change this to: `d` [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/ai/strategies/avoidance.rs:76:70 [INFO] [stdout] | [INFO] [stdout] 76 | let p = state.me.position().adjacent(&state.map, &d); [INFO] [stdout] | ^^ help: change this to: `d` [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: length comparison to zero [INFO] [stdout] --> src/ai/strategies/avoidance.rs:85:16 [INFO] [stdout] | [INFO] [stdout] 85 | if possible_directions.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!possible_directions.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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/ai/strategies/hunter.rs:30:14 [INFO] [stdout] | [INFO] [stdout] 30 | .filter(|path| path.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 31 | | .map(|path| path.unwrap()) [INFO] [stdout] | |______________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` 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/ai/strategies/hunter.rs:37:69 [INFO] [stdout] | [INFO] [stdout] 37 | Some(p) => state.me.position().direction_to(&state.map, &p.last().unwrap()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `p.last().unwrap()` [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 `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/ai/strategies/killer.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | / enemies [INFO] [stdout] 19 | | .iter() [INFO] [stdout] 20 | | .map(|e| pathfinder::get_shortest(map, &e.position(), to)) [INFO] [stdout] 21 | | .filter(|path| path.is_some()) [INFO] [stdout] ... | [INFO] [stdout] 26 | | Some(d) [INFO] [stdout] 27 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 24 ~ .map(|d| { [INFO] [stdout] 25 | println!("Closest enemy distance to {} is {}", to, d); [INFO] [stdout] 26 ~ d [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/killer.rs:28:24 [INFO] [stdout] | [INFO] [stdout] 28 | .unwrap_or(usize::max_value()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 28 - .unwrap_or(usize::max_value()) [INFO] [stdout] 28 + .unwrap_or(usize::MAX) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ai/strategies/killer.rs:39:37 [INFO] [stdout] | [INFO] [stdout] 39 | if !bot.can_eat_others() && remaining_super_pellets.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `remaining_super_pellets.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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/ai/strategies/killer.rs:47:14 [INFO] [stdout] | [INFO] [stdout] 47 | .filter(|path| path.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 48 | | .map(|path| path.unwrap()) [INFO] [stdout] | |______________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/ai/strategies/killer.rs:54:50 [INFO] [stdout] | [INFO] [stdout] 54 | let distance_to_closest_eatable_player = path [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 55 | | .as_ref() [INFO] [stdout] 56 | | .and_then(|x| Some(x.len() as u32)) [INFO] [stdout] | |_______________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 ~ let distance_to_closest_eatable_player = path [INFO] [stdout] 55 + .as_ref().map(|x| x.len() as u32) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/killer.rs:57:24 [INFO] [stdout] | [INFO] [stdout] 57 | .unwrap_or(u32::max_value()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 57 - .unwrap_or(u32::max_value()); [INFO] [stdout] 57 + .unwrap_or(u32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/strategies/killer.rs:64:52 [INFO] [stdout] | [INFO] [stdout] 64 | .map(|pos| (bot.path_graph.cost_to(&pos), pos)) [INFO] [stdout] | ^^^^ help: change this to: `pos` [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/ai/strategies/killer.rs:70:61 [INFO] [stdout] | [INFO] [stdout] 70 | .and_then(|(_, pos)| bot.path_graph.path_to(&pos)); [INFO] [stdout] | ^^^^ help: change this to: `pos` [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/ai/strategies/killer.rs:76:66 [INFO] [stdout] | [INFO] [stdout] 76 | state.me.position().direction_to(&state.map, &path.last().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `path.last().unwrap()` [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/ai/strategies/killer.rs:82:69 [INFO] [stdout] | [INFO] [stdout] 82 | Some(p) => state.me.position().direction_to(&state.map, &p.last().unwrap()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `p.last().unwrap()` [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: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:25:71 [INFO] [stdout] | [INFO] [stdout] 25 | .find(|e| bot.path_graph.cost_to(&e.position()).unwrap_or(usize::max_value()) <= 3) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 25 - .find(|e| bot.path_graph.cost_to(&e.position()).unwrap_or(usize::max_value()) <= 3) [INFO] [stdout] 25 + .find(|e| bot.path_graph.cost_to(&e.position()).unwrap_or(usize::MAX) <= 3) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:56:14 [INFO] [stdout] | [INFO] [stdout] 56 | .filter(|path| path.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 57 | | .map(|path| path.unwrap()) [INFO] [stdout] | |______________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:54:14 [INFO] [stdout] | [INFO] [stdout] 54 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:58:28 [INFO] [stdout] | [INFO] [stdout] 58 | .filter(|path| path.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!path.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/ai/strategies/pick_pellets.rs:59:116 [INFO] [stdout] | [INFO] [stdout] 59 | .filter(|path| !path.iter().any(|pos| enemy_positions.contains(pos) || bot.map_information.is_dead_end(&pos))) [INFO] [stdout] | ^^^^ help: change this to: `pos` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:77:16 [INFO] [stdout] | [INFO] [stdout] 77 | if let &Some(ref pos) = &self.target_pellet { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 77 - if let &Some(ref pos) = &self.target_pellet { [INFO] [stdout] 77 + if let Some(pos) = &self.target_pellet { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:78:20 [INFO] [stdout] | [INFO] [stdout] 78 | return pathfinder::get_shortest_no_enemies(&state.map, &state.me.position(), &pos, &state.enemies) [INFO] [stdout] | ____________________^ [INFO] [stdout] 79 | | .and_then(|path| Some(path.last().unwrap().clone())) [INFO] [stdout] | |____________________________________________________________________^ help: try: `pathfinder::get_shortest_no_enemies(&state.map, &state.me.position(), &pos, &state.enemies).map(|path| path.last().unwrap().clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:78:90 [INFO] [stdout] | [INFO] [stdout] 78 | return pathfinder::get_shortest_no_enemies(&state.map, &state.me.position(), &pos, &state.enemies) [INFO] [stdout] | ^^^^ help: change this to: `pos` [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/ai/mod.rs:70:45 [INFO] [stdout] | [INFO] [stdout] 70 | .map(|x| (x.borrow_mut().action(&self, &state), x)) [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/ai/mod.rs:71:20 [INFO] [stdout] | [INFO] [stdout] 71 | .find(|&(ref d, _)| d.is_some()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 71 - .find(|&(ref d, _)| d.is_some()); [INFO] [stdout] 71 + .find(|(d, _)| d.is_some()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/client/tcp.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / stream.ok().and_then(|x| { [INFO] [stdout] 42 | | x.set_nodelay(true).ok(); [INFO] [stdout] 43 | | [INFO] [stdout] 44 | | let input_stream = x.try_clone().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 49 | | }) [INFO] [stdout] 50 | | }) [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 41 ~ stream.ok().map(|x| { [INFO] [stdout] 42 | x.set_nodelay(true).ok(); [INFO] [stdout] 43 | [INFO] [stdout] 44 | let input_stream = x.try_clone().unwrap(); [INFO] [stdout] 45 ~ TcpClient { [INFO] [stdout] 46 + stream: x, [INFO] [stdout] 47 + reader: BufReader::new(input_stream), [INFO] [stdout] 48 + last_response: String::new(), [INFO] [stdout] 49 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/game/mod.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | / match *self { [INFO] [stdout] 20 | | TileType::Floor | TileType::Door | TileType::Pellet | TileType::SuperPellet => true, [INFO] [stdout] 21 | | _ => false, [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 19 - match *self { [INFO] [stdout] 20 - TileType::Floor | TileType::Door | TileType::Pellet | TileType::SuperPellet => true, [INFO] [stdout] 21 - _ => false, [INFO] [stdout] 22 - } [INFO] [stdout] 19 + matches!(*self, TileType::Floor | TileType::Door | TileType::Pellet | TileType::SuperPellet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/game/mod.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | / match *self { [INFO] [stdout] 27 | | TileType::Pellet | TileType::SuperPellet => true, [INFO] [stdout] 28 | | _ => false, [INFO] [stdout] 29 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 26 - match *self { [INFO] [stdout] 27 - TileType::Pellet | TileType::SuperPellet => true, [INFO] [stdout] 28 - _ => false, [INFO] [stdout] 29 - } [INFO] [stdout] 26 + matches!(*self, TileType::Pellet | TileType::SuperPellet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/game/mod.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | / match *self { [INFO] [stdout] 34 | | TileType::SuperPellet => true, [INFO] [stdout] 35 | | _ => false, [INFO] [stdout] 36 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 33 - match *self { [INFO] [stdout] 34 - TileType::SuperPellet => true, [INFO] [stdout] 35 - _ => false, [INFO] [stdout] 36 - } [INFO] [stdout] 33 + matches!(*self, TileType::SuperPellet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/game/mod.rs:65:40 [INFO] [stdout] | [INFO] [stdout] 65 | pub fn points_in_path(&self, path: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 65 - pub fn points_in_path(&self, path: &Vec) -> usize { [INFO] [stdout] 65 + pub fn points_in_path(&self, path: &[Position]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/game/mod.rs:135:9 [INFO] [stdout] | [INFO] [stdout] 135 | map_information.size = (map.width(), map.height()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `game::MapInformation { size: (map.width(), map.height()), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/game/mod.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | let mut map_information = MapInformation::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` 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/game/mod.rs:182:33 [INFO] [stdout] | [INFO] [stdout] 182 | map.tile_at(&p).is_walkable() && [INFO] [stdout] | ^^ help: change this to: `p` [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/game/mod.rs:184:70 [INFO] [stdout] | [INFO] [stdout] 184 | ... p.neighbours(map).iter().filter(|pn| map.tile_at(&pn).is_walkable() && !map_information.dead_ends.contains(pn)).count() < 2 [INFO] [stdout] | ^^^ help: change this to: `pn` [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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/game/mod.rs:227:14 [INFO] [stdout] | [INFO] [stdout] 227 | .filter(|x| x.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 228 | | .map(|x| x.unwrap()) [INFO] [stdout] | |________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game/mod.rs:218:44 [INFO] [stdout] | [INFO] [stdout] 218 | p = p.adjacent(limits, &d); [INFO] [stdout] | ^^ help: change this to: `d` [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 `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/game/mod.rs:241:9 [INFO] [stdout] | [INFO] [stdout] 241 | / ... pathfinding::bfs(position, |p| p.neighbours(self).into_iter().filter(|c| self.walkable_positions.contains(&c)), |p| !self.d... [INFO] [stdout] 242 | | ... .and_then(|path| Some(path [INFO] [stdout] 243 | | ... .into_iter() [INFO] [stdout] 244 | | ... .skip(1) [INFO] [stdout] 245 | | ... .rev() [INFO] [stdout] 246 | | ... .collect())) [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 241 ~ pathfinding::bfs(position, |p| p.neighbours(self).into_iter().filter(|c| self.walkable_positions.contains(&c)), |p| !self.dead_ends.contains(&p)).map(|path| path [INFO] [stdout] 242 + .into_iter() [INFO] [stdout] 243 + .skip(1) [INFO] [stdout] 244 + .rev() [INFO] [stdout] 245 + .collect()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game/mod.rs:241:115 [INFO] [stdout] | [INFO] [stdout] 241 | ...ter().filter(|c| self.walkable_positions.contains(&c)), |p| !self.dead_ends.contains(&p)) [INFO] [stdout] | ^^ help: change this to: `c` [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/game/mod.rs:241:150 [INFO] [stdout] | [INFO] [stdout] 241 | ...tions.contains(&c)), |p| !self.dead_ends.contains(&p)) [INFO] [stdout] | ^^ help: change this to: `p` [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: useless conversion to the same type: `protocol::GameState` [INFO] [stdout] --> src/protocol/json.rs:54:69 [INFO] [stdout] | [INFO] [stdout] 54 | Ok(x) => Ok(protocol::Message::Welcome { state: x.into() }), [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `x` [INFO] [stdout] | [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] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `protocol::GameState` [INFO] [stdout] --> src/protocol/json.rs:61:68 [INFO] [stdout] | [INFO] [stdout] 61 | Ok(x) => Ok(protocol::Message::Update { state: x.gamestate.into() }), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `x.gamestate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/protocol/mod.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | DeserializationError(serde_json::error::Error), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/game/mod.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | #[derive(Debug, Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `Map` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_Map` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: `#[warn(non_local_definitions)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/protocol/mod.rs:10:17 [INFO] [stdout] | [INFO] [stdout] 10 | #[derive(Debug, Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `GameState` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_GameState` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/protocol/mod.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | #[derive(Debug, Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `Player` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_Player` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/protocol/json.rs:8:17 [INFO] [stdout] | [INFO] [stdout] 8 | #[derive(Debug, Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `BaseMessage` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_BaseMessage` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/protocol/json.rs:13:10 [INFO] [stdout] | [INFO] [stdout] 13 | #[derive(Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `StateUpdateMessage` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_StateUpdateMessage` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Killer` is never constructed [INFO] [stdout] --> src/ai/strategies/mod.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 16 | pub enum StrategyType { [INFO] [stdout] | ------------ variant in this enum [INFO] [stdout] ... [INFO] [stdout] 19 | Killer, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `StrategyType` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Killer` is never constructed [INFO] [stdout] --> src/ai/strategies/killer.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct Killer; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `new` and `shortest_enemy_path_cost` are never used [INFO] [stdout] --> src/ai/strategies/killer.rs:13:12 [INFO] [stdout] | [INFO] [stdout] 12 | impl Killer { [INFO] [stdout] | ----------- associated functions in this implementation [INFO] [stdout] 13 | pub fn new() -> Killer { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 17 | fn shortest_enemy_path_cost(map: &Map, enemies: &[Player], to: &Position) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_enemy_nearby` is never used [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:21:8 [INFO] [stdout] | [INFO] [stdout] 14 | impl PickPellets { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 21 | fn is_enemy_nearby(&self, bot: &Bot, state: &GameState) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_super_pellet` is never used [INFO] [stdout] --> src/game/mod.rs:32:12 [INFO] [stdout] | [INFO] [stdout] 17 | impl TileType { [INFO] [stdout] | ------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 32 | pub fn is_super_pellet(&self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `neighbours` and `super_pellets` are never used [INFO] [stdout] --> src/game/mod.rs:56:12 [INFO] [stdout] | [INFO] [stdout] 47 | impl Map { [INFO] [stdout] | -------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 56 | pub fn neighbours(&self, position: &Position) -> Vec<(Direction, TileType)> { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 81 | pub fn super_pellets(&self) -> HashSet { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `walkable_positions` and `closest_turning_points` are never used [INFO] [stdout] --> src/game/mod.rs:207:12 [INFO] [stdout] | [INFO] [stdout] 132 | impl MapInformation { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 207 | pub fn walkable_positions(&self) -> &HashSet { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 211 | pub fn closest_turning_points(&self, limits: &T, position: &Position) -> HashSet { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/protocol/mod.rs:57:26 [INFO] [stdout] | [INFO] [stdout] 57 | DeserializationError(serde_json::error::Error), [INFO] [stdout] | -------------------- ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 57 - DeserializationError(serde_json::error::Error), [INFO] [stdout] 57 + DeserializationError(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/ai/pathfinder.rs:31:50 [INFO] [stdout] | [INFO] [stdout] 31 | frontier.push_back((my_position.clone(), 0 as usize)); [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [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: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/ai/pathfinder.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | / self.nodes [INFO] [stdout] 53 | | .get(position) [INFO] [stdout] 54 | | .and_then(|n| Some(n.cost)) [INFO] [stdout] | |_______________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 52 ~ self.nodes [INFO] [stdout] 53 + .get(position).map(|n| n.cost) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/pathfinder.rs:64:44 [INFO] [stdout] | [INFO] [stdout] 64 | while let Some(n) = self.nodes.get(&path.last().unwrap()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `path.last().unwrap()` [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/ai/pathfinder.rs:79:68 [INFO] [stdout] | [INFO] [stdout] 79 | ... , |p| p.neighbours(map).into_iter().filter(|x| map.tile_at(&x).is_walkable() && enemies.iter().find(|e| e.position() == *x).is... [INFO] [stdout] | ^^ help: change this to: `x` [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/ai/pathfinder.rs:80:27 [INFO] [stdout] | [INFO] [stdout] 80 | , |p| map.tile_at(&p).is_pellet() && extra_filter(p)); [INFO] [stdout] | ^^ help: change this to: `p` [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: usage of a legacy numeric method [INFO] [stdout] --> src/ai/pathfinder.rs:97:20 [INFO] [stdout] | [INFO] [stdout] 97 | .unwrap_or(usize::max_value()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 97 - .unwrap_or(usize::max_value()) [INFO] [stdout] 97 + .unwrap_or(usize::MAX) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/pathfinder.rs:101:148 [INFO] [stdout] | [INFO] [stdout] 101 | ...()).map(|x| (x, 1)), |p| p.manhattan_distance_to(&to, map) as usize, |p| *p == *to); [INFO] [stdout] | ^^^ help: change this to: `to` [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/ai/pathfinder.rs:106:205 [INFO] [stdout] | [INFO] [stdout] 106 | ...()).map(|x| (x, 1)), |p| p.manhattan_distance_to(&to, map) as usize, |p| *p == *to); [INFO] [stdout] | ^^^ help: change this to: `to` [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/ai/pathfinder.rs:174:45 [INFO] [stdout] | [INFO] [stdout] 174 | let mut graph = LocalPathGraph::new(&map); [INFO] [stdout] | ^^^^ help: change this to: `map` [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/ai/pathfinder.rs:175:31 [INFO] [stdout] | [INFO] [stdout] 175 | graph.update_from_map(&map, from); [INFO] [stdout] | ^^^^ help: change this to: `map` [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/ai/pathfinder.rs:180:45 [INFO] [stdout] | [INFO] [stdout] 180 | let mut graph = LocalPathGraph::new(&map); [INFO] [stdout] | ^^^^ help: change this to: `map` [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/ai/pathfinder.rs:181:31 [INFO] [stdout] | [INFO] [stdout] 181 | graph.update_from_map(&map, from); [INFO] [stdout] | ^^^^ help: change this to: `map` [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/ai/pathfinder.rs:186:158 [INFO] [stdout] | [INFO] [stdout] 186 | ...()).map(|x| (x, 1)), |p| p.manhattan_distance_to(&to, map) as usize, |p| *p == *to)).unwrap() [INFO] [stdout] | ^^^ help: change this to: `to` [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: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/avoidance.rs:37:28 [INFO] [stdout] | [INFO] [stdout] 37 | .unwrap_or(usize::max_value()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 37 - .unwrap_or(usize::max_value()); [INFO] [stdout] 37 + .unwrap_or(usize::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/strategies/avoidance.rs:44:69 [INFO] [stdout] | [INFO] [stdout] 44 | return state.me.position().direction_to(&state.map, &path_to_exit.last().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `path_to_exit.last().unwrap()` [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 boolean expression can be simplified [INFO] [stdout] --> src/ai/strategies/avoidance.rs:54:25 [INFO] [stdout] | [INFO] [stdout] 54 | .filter(|e| !(bot.can_eat_others() && !e.is_dangerous)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!bot.can_eat_others() || e.is_dangerous` [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: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/avoidance.rs:55:71 [INFO] [stdout] | [INFO] [stdout] 55 | .map(|e| (bot.path_graph.cost_to(&e.position()).unwrap_or(usize::max_value()), e)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 55 - .map(|e| (bot.path_graph.cost_to(&e.position()).unwrap_or(usize::max_value()), e)) [INFO] [stdout] 55 + .map(|e| (bot.path_graph.cost_to(&e.position()).unwrap_or(usize::MAX), e)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ai/strategies/avoidance.rs:62:16 [INFO] [stdout] | [INFO] [stdout] 62 | if enemy_directions.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `enemy_directions.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/strategies/avoidance.rs:68:89 [INFO] [stdout] | [INFO] [stdout] 68 | .filter(|d| state.map.tile_at(&state.me.position().adjacent(&state.map, &d)).is_walkable()) [INFO] [stdout] | ^^ help: change this to: `d` [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/ai/strategies/avoidance.rs:69:161 [INFO] [stdout] | [INFO] [stdout] 69 | ...ead_end(&state.me.position().adjacent(&state.map, &d))) [INFO] [stdout] | ^^ help: change this to: `d` [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/ai/strategies/avoidance.rs:76:70 [INFO] [stdout] | [INFO] [stdout] 76 | let p = state.me.position().adjacent(&state.map, &d); [INFO] [stdout] | ^^ help: change this to: `d` [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: length comparison to zero [INFO] [stdout] --> src/ai/strategies/avoidance.rs:85:16 [INFO] [stdout] | [INFO] [stdout] 85 | if possible_directions.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!possible_directions.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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/ai/strategies/hunter.rs:30:14 [INFO] [stdout] | [INFO] [stdout] 30 | .filter(|path| path.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 31 | | .map(|path| path.unwrap()) [INFO] [stdout] | |______________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` 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/ai/strategies/hunter.rs:37:69 [INFO] [stdout] | [INFO] [stdout] 37 | Some(p) => state.me.position().direction_to(&state.map, &p.last().unwrap()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `p.last().unwrap()` [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 `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/ai/strategies/killer.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | / enemies [INFO] [stdout] 19 | | .iter() [INFO] [stdout] 20 | | .map(|e| pathfinder::get_shortest(map, &e.position(), to)) [INFO] [stdout] 21 | | .filter(|path| path.is_some()) [INFO] [stdout] ... | [INFO] [stdout] 26 | | Some(d) [INFO] [stdout] 27 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 24 ~ .map(|d| { [INFO] [stdout] 25 | println!("Closest enemy distance to {} is {}", to, d); [INFO] [stdout] 26 ~ d [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/killer.rs:28:24 [INFO] [stdout] | [INFO] [stdout] 28 | .unwrap_or(usize::max_value()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 28 - .unwrap_or(usize::max_value()) [INFO] [stdout] 28 + .unwrap_or(usize::MAX) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ai/strategies/killer.rs:39:37 [INFO] [stdout] | [INFO] [stdout] 39 | if !bot.can_eat_others() && remaining_super_pellets.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `remaining_super_pellets.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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/ai/strategies/killer.rs:47:14 [INFO] [stdout] | [INFO] [stdout] 47 | .filter(|path| path.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 48 | | .map(|path| path.unwrap()) [INFO] [stdout] | |______________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/ai/strategies/killer.rs:54:50 [INFO] [stdout] | [INFO] [stdout] 54 | let distance_to_closest_eatable_player = path [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 55 | | .as_ref() [INFO] [stdout] 56 | | .and_then(|x| Some(x.len() as u32)) [INFO] [stdout] | |_______________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 54 ~ let distance_to_closest_eatable_player = path [INFO] [stdout] 55 + .as_ref().map(|x| x.len() as u32) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/killer.rs:57:24 [INFO] [stdout] | [INFO] [stdout] 57 | .unwrap_or(u32::max_value()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 57 - .unwrap_or(u32::max_value()); [INFO] [stdout] 57 + .unwrap_or(u32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/strategies/killer.rs:64:52 [INFO] [stdout] | [INFO] [stdout] 64 | .map(|pos| (bot.path_graph.cost_to(&pos), pos)) [INFO] [stdout] | ^^^^ help: change this to: `pos` [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/ai/strategies/killer.rs:70:61 [INFO] [stdout] | [INFO] [stdout] 70 | .and_then(|(_, pos)| bot.path_graph.path_to(&pos)); [INFO] [stdout] | ^^^^ help: change this to: `pos` [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/ai/strategies/killer.rs:76:66 [INFO] [stdout] | [INFO] [stdout] 76 | state.me.position().direction_to(&state.map, &path.last().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `path.last().unwrap()` [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/ai/strategies/killer.rs:82:69 [INFO] [stdout] | [INFO] [stdout] 82 | Some(p) => state.me.position().direction_to(&state.map, &p.last().unwrap()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `p.last().unwrap()` [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: usage of a legacy numeric method [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:25:71 [INFO] [stdout] | [INFO] [stdout] 25 | .find(|e| bot.path_graph.cost_to(&e.position()).unwrap_or(usize::max_value()) <= 3) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 25 - .find(|e| bot.path_graph.cost_to(&e.position()).unwrap_or(usize::max_value()) <= 3) [INFO] [stdout] 25 + .find(|e| bot.path_graph.cost_to(&e.position()).unwrap_or(usize::MAX) <= 3) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:56:14 [INFO] [stdout] | [INFO] [stdout] 56 | .filter(|path| path.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 57 | | .map(|path| path.unwrap()) [INFO] [stdout] | |______________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `HashSet` [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:54:14 [INFO] [stdout] | [INFO] [stdout] 54 | .into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:58:28 [INFO] [stdout] | [INFO] [stdout] 58 | .filter(|path| path.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!path.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/ai/strategies/pick_pellets.rs:59:116 [INFO] [stdout] | [INFO] [stdout] 59 | .filter(|path| !path.iter().any(|pos| enemy_positions.contains(pos) || bot.map_information.is_dead_end(&pos))) [INFO] [stdout] | ^^^^ help: change this to: `pos` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:77:16 [INFO] [stdout] | [INFO] [stdout] 77 | if let &Some(ref pos) = &self.target_pellet { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 77 - if let &Some(ref pos) = &self.target_pellet { [INFO] [stdout] 77 + if let Some(pos) = &self.target_pellet { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:78:20 [INFO] [stdout] | [INFO] [stdout] 78 | return pathfinder::get_shortest_no_enemies(&state.map, &state.me.position(), &pos, &state.enemies) [INFO] [stdout] | ____________________^ [INFO] [stdout] 79 | | .and_then(|path| Some(path.last().unwrap().clone())) [INFO] [stdout] | |____________________________________________________________________^ help: try: `pathfinder::get_shortest_no_enemies(&state.map, &state.me.position(), &pos, &state.enemies).map(|path| path.last().unwrap().clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ai/strategies/pick_pellets.rs:78:90 [INFO] [stdout] | [INFO] [stdout] 78 | return pathfinder::get_shortest_no_enemies(&state.map, &state.me.position(), &pos, &state.enemies) [INFO] [stdout] | ^^^^ help: change this to: `pos` [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/ai/mod.rs:70:45 [INFO] [stdout] | [INFO] [stdout] 70 | .map(|x| (x.borrow_mut().action(&self, &state), x)) [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/ai/mod.rs:71:20 [INFO] [stdout] | [INFO] [stdout] 71 | .find(|&(ref d, _)| d.is_some()); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 71 - .find(|&(ref d, _)| d.is_some()); [INFO] [stdout] 71 + .find(|(d, _)| d.is_some()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/client/tcp.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / stream.ok().and_then(|x| { [INFO] [stdout] 42 | | x.set_nodelay(true).ok(); [INFO] [stdout] 43 | | [INFO] [stdout] 44 | | let input_stream = x.try_clone().unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 49 | | }) [INFO] [stdout] 50 | | }) [INFO] [stdout] | |______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: use `map` instead [INFO] [stdout] | [INFO] [stdout] 41 ~ stream.ok().map(|x| { [INFO] [stdout] 42 | x.set_nodelay(true).ok(); [INFO] [stdout] 43 | [INFO] [stdout] 44 | let input_stream = x.try_clone().unwrap(); [INFO] [stdout] 45 ~ TcpClient { [INFO] [stdout] 46 + stream: x, [INFO] [stdout] 47 + reader: BufReader::new(input_stream), [INFO] [stdout] 48 + last_response: String::new(), [INFO] [stdout] 49 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/game/mod.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | / match *self { [INFO] [stdout] 20 | | TileType::Floor | TileType::Door | TileType::Pellet | TileType::SuperPellet => true, [INFO] [stdout] 21 | | _ => false, [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 19 - match *self { [INFO] [stdout] 20 - TileType::Floor | TileType::Door | TileType::Pellet | TileType::SuperPellet => true, [INFO] [stdout] 21 - _ => false, [INFO] [stdout] 22 - } [INFO] [stdout] 19 + matches!(*self, TileType::Floor | TileType::Door | TileType::Pellet | TileType::SuperPellet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/game/mod.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | / match *self { [INFO] [stdout] 27 | | TileType::Pellet | TileType::SuperPellet => true, [INFO] [stdout] 28 | | _ => false, [INFO] [stdout] 29 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 26 - match *self { [INFO] [stdout] 27 - TileType::Pellet | TileType::SuperPellet => true, [INFO] [stdout] 28 - _ => false, [INFO] [stdout] 29 - } [INFO] [stdout] 26 + matches!(*self, TileType::Pellet | TileType::SuperPellet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/game/mod.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | / match *self { [INFO] [stdout] 34 | | TileType::SuperPellet => true, [INFO] [stdout] 35 | | _ => false, [INFO] [stdout] 36 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 33 - match *self { [INFO] [stdout] 34 - TileType::SuperPellet => true, [INFO] [stdout] 35 - _ => false, [INFO] [stdout] 36 - } [INFO] [stdout] 33 + matches!(*self, TileType::SuperPellet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/game/mod.rs:65:40 [INFO] [stdout] | [INFO] [stdout] 65 | pub fn points_in_path(&self, path: &Vec) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 65 - pub fn points_in_path(&self, path: &Vec) -> usize { [INFO] [stdout] 65 + pub fn points_in_path(&self, path: &[Position]) -> usize { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/game/mod.rs:135:9 [INFO] [stdout] | [INFO] [stdout] 135 | map_information.size = (map.width(), map.height()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `game::MapInformation { size: (map.width(), map.height()), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/game/mod.rs:134:9 [INFO] [stdout] | [INFO] [stdout] 134 | let mut map_information = MapInformation::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` 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/game/mod.rs:182:33 [INFO] [stdout] | [INFO] [stdout] 182 | map.tile_at(&p).is_walkable() && [INFO] [stdout] | ^^ help: change this to: `p` [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/game/mod.rs:184:70 [INFO] [stdout] | [INFO] [stdout] 184 | ... p.neighbours(map).iter().filter(|pn| map.tile_at(&pn).is_walkable() && !map_information.dead_ends.contains(pn)).count() < 2 [INFO] [stdout] | ^^^ help: change this to: `pn` [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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/game/mod.rs:227:14 [INFO] [stdout] | [INFO] [stdout] 227 | .filter(|x| x.is_some()) [INFO] [stdout] | ______________^ [INFO] [stdout] 228 | | .map(|x| x.unwrap()) [INFO] [stdout] | |________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game/mod.rs:218:44 [INFO] [stdout] | [INFO] [stdout] 218 | p = p.adjacent(limits, &d); [INFO] [stdout] | ^^ help: change this to: `d` [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 `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/game/mod.rs:241:9 [INFO] [stdout] | [INFO] [stdout] 241 | / ... pathfinding::bfs(position, |p| p.neighbours(self).into_iter().filter(|c| self.walkable_positions.contains(&c)), |p| !self.d... [INFO] [stdout] 242 | | ... .and_then(|path| Some(path [INFO] [stdout] 243 | | ... .into_iter() [INFO] [stdout] 244 | | ... .skip(1) [INFO] [stdout] 245 | | ... .rev() [INFO] [stdout] 246 | | ... .collect())) [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 241 ~ pathfinding::bfs(position, |p| p.neighbours(self).into_iter().filter(|c| self.walkable_positions.contains(&c)), |p| !self.dead_ends.contains(&p)).map(|path| path [INFO] [stdout] 242 + .into_iter() [INFO] [stdout] 243 + .skip(1) [INFO] [stdout] 244 + .rev() [INFO] [stdout] 245 + .collect()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game/mod.rs:241:115 [INFO] [stdout] | [INFO] [stdout] 241 | ...ter().filter(|c| self.walkable_positions.contains(&c)), |p| !self.dead_ends.contains(&p)) [INFO] [stdout] | ^^ help: change this to: `c` [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/game/mod.rs:241:150 [INFO] [stdout] | [INFO] [stdout] 241 | ...tions.contains(&c)), |p| !self.dead_ends.contains(&p)) [INFO] [stdout] | ^^ help: change this to: `p` [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: useless conversion to the same type: `protocol::GameState` [INFO] [stdout] --> src/protocol/json.rs:54:69 [INFO] [stdout] | [INFO] [stdout] 54 | Ok(x) => Ok(protocol::Message::Welcome { state: x.into() }), [INFO] [stdout] | ^^^^^^^^ help: consider removing `.into()`: `x` [INFO] [stdout] | [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] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `protocol::GameState` [INFO] [stdout] --> src/protocol/json.rs:61:68 [INFO] [stdout] | [INFO] [stdout] 61 | Ok(x) => Ok(protocol::Message::Update { state: x.gamestate.into() }), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `x.gamestate` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/protocol/json.rs:90:20 [INFO] [stdout] | [INFO] [stdout] 90 | _ => { assert!(false, "Incorrect type returned") }, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/protocol/json.rs:105:17 [INFO] [stdout] | [INFO] [stdout] 105 | assert_eq!(true, state.me.is_dangerous); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 105 - assert_eq!(true, state.me.is_dangerous); [INFO] [stdout] 105 + assert!(state.me.is_dangerous); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this assertion is always `false` [INFO] [stdout] --> src/protocol/json.rs:107:20 [INFO] [stdout] | [INFO] [stdout] 107 | _ => { assert!(false, "Incorrect type returned") }, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant name ends with the enum's name [INFO] [stdout] --> src/protocol/mod.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | DeserializationError(serde_json::error::Error), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names [INFO] [stdout] = note: `#[warn(clippy::enum_variant_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/game/mod.rs:40:17 [INFO] [stdout] | [INFO] [stdout] 40 | #[derive(Debug, Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `Map` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_Map` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: `#[warn(non_local_definitions)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/protocol/mod.rs:10:17 [INFO] [stdout] | [INFO] [stdout] 10 | #[derive(Debug, Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `GameState` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_GameState` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/protocol/mod.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | #[derive(Debug, Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `Player` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_Player` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/protocol/json.rs:8:17 [INFO] [stdout] | [INFO] [stdout] 8 | #[derive(Debug, Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `BaseMessage` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_BaseMessage` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> src/protocol/json.rs:13:10 [INFO] [stdout] | [INFO] [stdout] 13 | #[derive(Deserialize)] [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | `StateUpdateMessage` is not local [INFO] [stdout] | `Deserialize` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_IMPL_DESERIALIZE_FOR_StateUpdateMessage` [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Deserialize` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Deserialize` may come from an old version of the `serde_derive` crate, try updating your dependency with `cargo update -p serde_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.74s [INFO] [stderr] warning: the following packages contain code that will be rejected by a future version of Rust: bitflags v0.8.0 [INFO] [stderr] note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 2` [INFO] running `Command { std: "docker" "inspect" "1d0d4a96f6169994742b2b4536595ee8e23497de8a6cf619ab6b686c1606c0d4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1d0d4a96f6169994742b2b4536595ee8e23497de8a6cf619ab6b686c1606c0d4", kill_on_drop: false }` [INFO] [stdout] 1d0d4a96f6169994742b2b4536595ee8e23497de8a6cf619ab6b686c1606c0d4