[INFO] cloning repository https://github.com/LinusCDE/remarkable-chess [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/LinusCDE/remarkable-chess" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLinusCDE%2Fremarkable-chess", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLinusCDE%2Fremarkable-chess'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 5aff8725fa6cdc47ef1c6c8ff6116d1dc4c81478 [INFO] linting LinusCDE/remarkable-chess against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLinusCDE%2Fremarkable-chess" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/LinusCDE/remarkable-chess [INFO] finished tweaking git repo https://github.com/LinusCDE/remarkable-chess [INFO] tweaked toml for git repo https://github.com/LinusCDE/remarkable-chess written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/LinusCDE/remarkable-chess 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/LinusCDE/remarkable-chess 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] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded line_drawing v1.0.1 [INFO] [stderr] Downloaded tokio-stream v0.1.8 [INFO] [stderr] Downloaded ioctl-gen v0.1.1 [INFO] [stderr] Downloaded mucow v0.1.0 [INFO] [stderr] Downloaded aabb-quadtree v0.1.0 [INFO] [stderr] Downloaded epoll v4.4.0 [INFO] [stderr] Downloaded thiserror-impl v1.0.31 [INFO] [stderr] Downloaded num-complex v0.4.1 [INFO] [stderr] Downloaded peggler v0.1.0 [INFO] [stderr] Downloaded wyz v0.5.0 [INFO] [stderr] Downloaded pleco v0.5.0 [INFO] [stderr] Downloaded cgmath v0.18.0 [INFO] [stderr] Downloaded thiserror v1.0.31 [INFO] [stderr] Downloaded evdev v0.12.2 [INFO] [stderr] Downloaded hlua v0.4.3 [INFO] [stderr] Downloaded syn v1.0.95 [INFO] [stderr] Downloaded crossbeam-channel v0.5.4 [INFO] [stderr] Downloaded unicode-ident v1.0.0 [INFO] [stderr] Downloaded bitvec v1.0.0 [INFO] [stderr] Downloaded nix v0.23.1 [INFO] [stderr] Downloaded lua52-sys v0.1.3 [INFO] [stderr] Downloaded libremarkable v0.7.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] b4f3190f1033a4208b1bb43868fabcfee1081eb5af5dfbcfff6a5119893c44f5 [INFO] running `Command { std: "docker" "start" "-a" "b4f3190f1033a4208b1bb43868fabcfee1081eb5af5dfbcfff6a5119893c44f5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "b4f3190f1033a4208b1bb43868fabcfee1081eb5af5dfbcfff6a5119893c44f5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b4f3190f1033a4208b1bb43868fabcfee1081eb5af5dfbcfff6a5119893c44f5", kill_on_drop: false }` [INFO] [stdout] b4f3190f1033a4208b1bb43868fabcfee1081eb5af5dfbcfff6a5119893c44f5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] eb484ee5a47c350b0230d5ea073e81426633bd9c7e4a48932a7d614eed57aee5 [INFO] running `Command { std: "docker" "start" "-a" "eb484ee5a47c350b0230d5ea073e81426633bd9c7e4a48932a7d614eed57aee5", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.175 [INFO] [stderr] Compiling libm v0.2.15 [INFO] [stderr] Compiling num-traits v0.2.15 [INFO] [stderr] Compiling proc-macro2 v1.0.101 [INFO] [stderr] Compiling unicode-ident v1.0.0 [INFO] [stderr] Compiling autocfg v0.1.8 [INFO] [stderr] Compiling syn v1.0.95 [INFO] [stderr] Checking crossbeam-utils v0.8.8 [INFO] [stderr] Checking memchr v2.7.5 [INFO] [stderr] Compiling radium v0.7.0 [INFO] [stderr] Compiling rayon-core v1.9.3 [INFO] [stderr] Checking crc32fast v1.5.0 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Compiling num-iter v0.1.43 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Checking regex-syntax v0.8.6 [INFO] [stderr] Compiling rand_pcg v0.1.2 [INFO] [stderr] Compiling rand_chacha v0.1.1 [INFO] [stderr] Checking anstyle-query v1.1.4 [INFO] [stderr] Checking anstyle v1.0.11 [INFO] [stderr] Checking tap v1.0.1 [INFO] [stderr] Compiling rand v0.6.5 [INFO] [stderr] Checking fdeflate v0.3.7 [INFO] [stderr] Checking wyz v0.5.0 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Compiling rayon v1.5.3 [INFO] [stderr] Checking funty v2.0.0 [INFO] [stderr] Checking flate2 v1.1.2 [INFO] [stderr] Checking ttf-parser v0.15.2 [INFO] [stderr] Checking anstream v0.6.20 [INFO] [stderr] Checking zune-core v0.4.12 [INFO] [stderr] Checking quick-error v2.0.1 [INFO] [stderr] Compiling cgmath v0.18.0 [INFO] [stderr] Checking crossbeam-epoch v0.9.8 [INFO] [stderr] Checking crossbeam-channel v0.5.4 [INFO] [stderr] Compiling futures-core v0.3.21 [INFO] [stderr] Checking log v0.4.28 [INFO] [stderr] Checking weezl v0.1.10 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Checking image-webp v0.2.4 [INFO] [stderr] Checking zune-jpeg v0.4.21 [INFO] [stderr] Checking gif v0.13.3 [INFO] [stderr] Checking crossbeam-deque v0.8.1 [INFO] [stderr] Checking png v0.18.0 [INFO] [stderr] Checking clap_lex v0.7.5 [INFO] [stderr] Compiling thiserror v2.0.16 [INFO] [stderr] Checking hashbrown v0.15.5 [INFO] [stderr] Checking ab_glyph_rasterizer v0.1.10 [INFO] [stderr] Checking bitvec v1.0.0 [INFO] [stderr] Checking bytemuck v1.23.2 [INFO] [stderr] Compiling anyhow v1.0.99 [INFO] [stderr] Checking aabb-quadtree v0.1.0 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Checking fxhash v0.2.1 [INFO] [stderr] Checking num-integer v0.1.45 [INFO] [stderr] Checking pxfm v0.1.23 [INFO] [stderr] Checking num-traits v0.1.43 [INFO] [stderr] Checking approx v0.4.0 [INFO] [stderr] Checking num-complex v0.4.1 [INFO] [stderr] Checking enum_primitive v0.1.1 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Checking num-bigint v0.4.3 [INFO] [stderr] Checking line_drawing v1.0.1 [INFO] [stderr] Checking clap_builder v4.5.47 [INFO] [stderr] Checking tokio v1.47.1 [INFO] [stderr] Checking peggler v0.1.0 [INFO] [stderr] Checking indexmap v2.11.1 [INFO] [stderr] Checking ioctl-gen v0.1.1 [INFO] [stderr] Checking ryu v1.0.10 [INFO] [stderr] Checking mucow v0.1.0 [INFO] [stderr] Checking num_cpus v1.13.1 [INFO] [stderr] Checking nix v0.23.1 [INFO] [stderr] Checking rand_os v0.1.3 [INFO] [stderr] Checking regex-automata v0.4.10 [INFO] [stderr] Checking epoll v4.4.0 [INFO] [stderr] Checking memmap2 v0.9.8 [INFO] [stderr] Checking jiff v0.2.15 [INFO] [stderr] Compiling jobserver v0.1.34 [INFO] [stderr] Compiling cc v1.0.73 [INFO] [stderr] Checking num-rational v0.4.0 [INFO] [stderr] Checking owned_ttf_parser v0.15.2 [INFO] [stderr] Checking rusttype v0.9.3 [INFO] [stderr] Checking downcast-rs v2.0.2 [INFO] [stderr] Checking glob v0.3.3 [INFO] [stderr] Compiling thiserror-impl v1.0.31 [INFO] [stderr] Compiling serde_string_derive v0.1.0 (/opt/rustwide/workdir/serde_string_derive) [INFO] [stderr] Checking regex v1.11.2 [INFO] [stderr] Checking num v0.4.0 [INFO] [stderr] Compiling zstd-sys v2.0.16+zstd.1.5.7 [INFO] [stderr] Compiling lua52-sys v0.1.3 [INFO] [stderr] Checking chess_pgn_parser v0.1.2 (/opt/rustwide/workdir/chess_pgn_parser) [INFO] [stderr] Checking env_filter v0.1.3 [INFO] [stderr] Checking moxcms v0.7.5 [INFO] [stderr] Checking thiserror v1.0.31 [INFO] [stderr] Checking tokio-stream v0.1.8 [INFO] [stderr] Checking pleco v0.5.0 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling thiserror-impl v2.0.16 [INFO] [stderr] Compiling clap_derive v4.5.47 [INFO] [stderr] Checking env_logger v0.11.8 [INFO] [stderr] Checking evdev v0.12.2 [INFO] [stderr] Checking hlua v0.4.3 [INFO] [stderr] Checking clap v4.5.47 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stderr] Checking image v0.25.8 [INFO] [stderr] Checking libremarkable v0.7.0 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking chessmarkable v0.8.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/lib.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / /// Intended to be a seperatable lib (and support interop with other langs later). [INFO] [stdout] 3 | | [INFO] [stdout] | |_^ [INFO] [stdout] 4 | #[macro_use] [INFO] [stdout] 5 | extern crate anyhow; [INFO] [stdout] | ------------------- the comment documents this extern crate [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the crate use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 ~ //! The chess logic [INFO] [stdout] 2 ~ //! Intended to be a seperatable lib (and support interop with other langs later). [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/lib.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / /// Intended to be a seperatable lib (and support interop with other langs later). [INFO] [stdout] 3 | | [INFO] [stdout] | |_^ [INFO] [stdout] 4 | #[macro_use] [INFO] [stdout] 5 | extern crate anyhow; [INFO] [stdout] | ------------------- the comment documents this extern crate [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the crate use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 ~ //! The chess logic [INFO] [stdout] 2 ~ //! Intended to be a seperatable lib (and support interop with other langs later). [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/replay.rs:57:12 [INFO] [stdout] | [INFO] [stdout] 57 | if self.replay_moves_played_offset + 1 <= self.replay_info.moves.len() && self.player_moves_played_offset == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `self.replay_moves_played_offset < self.replay_info.moves.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> src/replay.rs:57:12 [INFO] [stdout] | [INFO] [stdout] 57 | if self.replay_moves_played_offset + 1 <= self.replay_info.moves.len() && self.player_moves_played_offset == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `self.replay_moves_played_offset < self.replay_info.moves.len()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/player.rs:30:1 [INFO] [stdout] | [INFO] [stdout] 30 | impl Into for Player { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 30 ~ impl From for PlecoPlayer { [INFO] [stdout] 31 ~ fn from(val: Player) -> Self { [INFO] [stdout] 32 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/square.rs:73:1 [INFO] [stdout] | [INFO] [stdout] 73 | impl Into for Square { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 73 ~ impl From for SQ { [INFO] [stdout] 74 ~ fn from(val: Square) -> Self { [INFO] [stdout] 75 ~ *val.clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/square.rs:75:10 [INFO] [stdout] | [INFO] [stdout] 75 | *self.clone() [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/game.rs:23:1 [INFO] [stdout] | [INFO] [stdout] 23 | / impl Default for ChessGame { [INFO] [stdout] 24 | | fn default() -> Self { [INFO] [stdout] 25 | | Self { [INFO] [stdout] 26 | | board: Board::default(), [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 17 + #[derive(Default)] [INFO] [stdout] 18 | pub struct ChessGame { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BitMove` which implements the `Copy` trait [INFO] [stdout] --> src/game.rs:143:38 [INFO] [stdout] | [INFO] [stdout] 143 | candidate_moves.push(legal_move.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*legal_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BitMove` which implements the `Copy` trait [INFO] [stdout] --> src/game.rs:193:38 [INFO] [stdout] | [INFO] [stdout] 193 | selected_move = Some(legal_move.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*legal_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/proto.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | / match self { [INFO] [stdout] 36 | | ChessRequest::CurrentBoard | ChessRequest::CurrentTotalMoves => true, [INFO] [stdout] 37 | | _ => false, [INFO] [stdout] 38 | | } [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] 35 - match self { [INFO] [stdout] 36 - ChessRequest::CurrentBoard | ChessRequest::CurrentTotalMoves => true, [INFO] [stdout] 37 - _ => false, [INFO] [stdout] 38 - } [INFO] [stdout] 35 + matches!(self, ChessRequest::CurrentBoard | ChessRequest::CurrentTotalMoves) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/player.rs:30:1 [INFO] [stdout] | [INFO] [stdout] 30 | impl Into for Player { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 30 ~ impl From for PlecoPlayer { [INFO] [stdout] 31 ~ fn from(val: Player) -> Self { [INFO] [stdout] 32 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/square.rs:73:1 [INFO] [stdout] | [INFO] [stdout] 73 | impl Into for Square { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 73 ~ impl From for SQ { [INFO] [stdout] 74 ~ fn from(val: Square) -> Self { [INFO] [stdout] 75 ~ *val.clone() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/square.rs:75:10 [INFO] [stdout] | [INFO] [stdout] 75 | *self.clone() [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/game.rs:23:1 [INFO] [stdout] | [INFO] [stdout] 23 | / impl Default for ChessGame { [INFO] [stdout] 24 | | fn default() -> Self { [INFO] [stdout] 25 | | Self { [INFO] [stdout] 26 | | board: Board::default(), [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 17 + #[derive(Default)] [INFO] [stdout] 18 | pub struct ChessGame { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BitMove` which implements the `Copy` trait [INFO] [stdout] --> src/game.rs:143:38 [INFO] [stdout] | [INFO] [stdout] 143 | candidate_moves.push(legal_move.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*legal_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/proto.rs:140:20 [INFO] [stdout] | [INFO] [stdout] 140 | if let Err(_) = combined_white_tx.send((player, update)).await { [INFO] [stdout] | -------^^^^^^------------------------------------------------- help: try: `if combined_white_tx.send((player, update)).await.is_err()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/proto.rs:152:20 [INFO] [stdout] | [INFO] [stdout] 152 | if let Err(_) = combined_black_tx.send((Some(Player::Black), update)).await { [INFO] [stdout] | -------^^^^^^-------------------------------------------------------------- help: try: `if combined_black_tx.send((Some(Player::Black), update)).await.is_err()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/proto.rs:164:20 [INFO] [stdout] | [INFO] [stdout] 164 | if let Err(_) = combined_spectators_tx.send((None, update)).await { [INFO] [stdout] | -------^^^^^^---------------------------------------------------- help: try: `if combined_spectators_tx.send((None, update)).await.is_err()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BitMove` which implements the `Copy` trait [INFO] [stdout] --> src/game.rs:193:38 [INFO] [stdout] | [INFO] [stdout] 193 | selected_move = Some(legal_move.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*legal_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/proto.rs:192:5 [INFO] [stdout] | [INFO] [stdout] 192 | / loop { [INFO] [stdout] 193 | | let (sender, request): (Option, ChessRequest) = match combined_rx.next().await { [INFO] [stdout] 194 | | Some(res) => res, [INFO] [stdout] 195 | | None => { [INFO] [stdout] ... | [INFO] [stdout] 367 | | }; [INFO] [stdout] 368 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 192 ~ while let Some(res) = combined_rx.next().await { [INFO] [stdout] 193 + let (sender, request): (Option, ChessRequest) = res; [INFO] [stdout] 194 + .. [INFO] [stdout] 195 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/proto.rs:35:9 [INFO] [stdout] | [INFO] [stdout] 35 | / match self { [INFO] [stdout] 36 | | ChessRequest::CurrentBoard | ChessRequest::CurrentTotalMoves => true, [INFO] [stdout] 37 | | _ => false, [INFO] [stdout] 38 | | } [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] 35 - match self { [INFO] [stdout] 36 - ChessRequest::CurrentBoard | ChessRequest::CurrentTotalMoves => true, [INFO] [stdout] 37 - _ => false, [INFO] [stdout] 38 - } [INFO] [stdout] 35 + matches!(self, ChessRequest::CurrentBoard | ChessRequest::CurrentTotalMoves) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/proto.rs:389:21 [INFO] [stdout] | [INFO] [stdout] 389 | / if player == me && current_outcome.is_none() { [INFO] [stdout] 390 | | let board = pleco::Board::from_fen(fen) [INFO] [stdout] 391 | | .expect("Bot failed to parse the provided fen"); [INFO] [stdout] ... | [INFO] [stdout] 415 | | .expect("Bot failed to send move"); [INFO] [stdout] 416 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 388 ~ ChessUpdate::PlayerSwitch { player, ref fen } [INFO] [stdout] 389 ~ if player == me && current_outcome.is_none() => { [INFO] [stdout] 390 | let board = pleco::Board::from_fen(fen) [INFO] [stdout] ... [INFO] [stdout] 415 | .expect("Bot failed to send move"); [INFO] [stdout] 416 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/replay.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | return ReplayResponse { fen: self.active_game.fen(), comment, last_move_from, last_move_to }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 95 - return ReplayResponse { fen: self.active_game.fen(), comment, last_move_from, last_move_to }; [INFO] [stdout] 95 + ReplayResponse { fen: self.active_game.fen(), comment, last_move_from, last_move_to } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/replay.rs:80:21 [INFO] [stdout] | [INFO] [stdout] 80 | self.replay_moves_played_offset = self.replay_moves_played_offset + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.replay_moves_played_offset += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/replay.rs:99:9 [INFO] [stdout] | [INFO] [stdout] 99 | / match self.active_game.move_piece(source, destination) { [INFO] [stdout] 100 | | Ok(_) => { [INFO] [stdout] 101 | | self.player_moves_played_offset = self.player_moves_played_offset + 1; [INFO] [stdout] ... | [INFO] [stdout] 104 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 99 ~ if let Ok(_) = self.active_game.move_piece(source, destination) { [INFO] [stdout] 100 + self.player_moves_played_offset = self.player_moves_played_offset + 1; [INFO] [stdout] 101 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/replay.rs:101:17 [INFO] [stdout] | [INFO] [stdout] 101 | self.player_moves_played_offset = self.player_moves_played_offset + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.player_moves_played_offset += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/replay.rs:117:9 [INFO] [stdout] | [INFO] [stdout] 117 | return ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 117 - return ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None }; [INFO] [stdout] 117 + ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/replay.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | self.player_moves_played_offset = self.player_moves_played_offset - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.player_moves_played_offset -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/replay.rs:114:13 [INFO] [stdout] | [INFO] [stdout] 114 | self.replay_moves_played_offset = self.replay_moves_played_offset - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.replay_moves_played_offset -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/replay.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | return ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 125 - return ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None }; [INFO] [stdout] 125 + ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/proto.rs:140:20 [INFO] [stdout] | [INFO] [stdout] 140 | if let Err(_) = combined_white_tx.send((player, update)).await { [INFO] [stdout] | -------^^^^^^------------------------------------------------- help: try: `if combined_white_tx.send((player, update)).await.is_err()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/proto.rs:152:20 [INFO] [stdout] | [INFO] [stdout] 152 | if let Err(_) = combined_black_tx.send((Some(Player::Black), update)).await { [INFO] [stdout] | -------^^^^^^-------------------------------------------------------------- help: try: `if combined_black_tx.send((Some(Player::Black), update)).await.is_err()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_err()` [INFO] [stdout] --> src/proto.rs:164:20 [INFO] [stdout] | [INFO] [stdout] 164 | if let Err(_) = combined_spectators_tx.send((None, update)).await { [INFO] [stdout] | -------^^^^^^---------------------------------------------------- help: try: `if combined_spectators_tx.send((None, update)).await.is_err()` [INFO] [stdout] | [INFO] [stdout] = note: this will change drop order of the result, as well as all temporaries [INFO] [stdout] = note: add `#[allow(clippy::redundant_pattern_matching)]` if this is important [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/proto.rs:192:5 [INFO] [stdout] | [INFO] [stdout] 192 | / loop { [INFO] [stdout] 193 | | let (sender, request): (Option, ChessRequest) = match combined_rx.next().await { [INFO] [stdout] 194 | | Some(res) => res, [INFO] [stdout] 195 | | None => { [INFO] [stdout] ... | [INFO] [stdout] 367 | | }; [INFO] [stdout] 368 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 192 ~ while let Some(res) = combined_rx.next().await { [INFO] [stdout] 193 + let (sender, request): (Option, ChessRequest) = res; [INFO] [stdout] 194 + .. [INFO] [stdout] 195 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/proto.rs:389:21 [INFO] [stdout] | [INFO] [stdout] 389 | / if player == me && current_outcome.is_none() { [INFO] [stdout] 390 | | let board = pleco::Board::from_fen(fen) [INFO] [stdout] 391 | | .expect("Bot failed to parse the provided fen"); [INFO] [stdout] ... | [INFO] [stdout] 415 | | .expect("Bot failed to send move"); [INFO] [stdout] 416 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 388 ~ ChessUpdate::PlayerSwitch { player, ref fen } [INFO] [stdout] 389 ~ if player == me && current_outcome.is_none() => { [INFO] [stdout] 390 | let board = pleco::Board::from_fen(fen) [INFO] [stdout] ... [INFO] [stdout] 415 | .expect("Bot failed to send move"); [INFO] [stdout] 416 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/replay.rs:95:9 [INFO] [stdout] | [INFO] [stdout] 95 | return ReplayResponse { fen: self.active_game.fen(), comment, last_move_from, last_move_to }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 95 - return ReplayResponse { fen: self.active_game.fen(), comment, last_move_from, last_move_to }; [INFO] [stdout] 95 + ReplayResponse { fen: self.active_game.fen(), comment, last_move_from, last_move_to } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/replay.rs:80:21 [INFO] [stdout] | [INFO] [stdout] 80 | self.replay_moves_played_offset = self.replay_moves_played_offset + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.replay_moves_played_offset += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/replay.rs:99:9 [INFO] [stdout] | [INFO] [stdout] 99 | / match self.active_game.move_piece(source, destination) { [INFO] [stdout] 100 | | Ok(_) => { [INFO] [stdout] 101 | | self.player_moves_played_offset = self.player_moves_played_offset + 1; [INFO] [stdout] ... | [INFO] [stdout] 104 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 99 ~ if let Ok(_) = self.active_game.move_piece(source, destination) { [INFO] [stdout] 100 + self.player_moves_played_offset = self.player_moves_played_offset + 1; [INFO] [stdout] 101 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/replay.rs:101:17 [INFO] [stdout] | [INFO] [stdout] 101 | self.player_moves_played_offset = self.player_moves_played_offset + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.player_moves_played_offset += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/replay.rs:117:9 [INFO] [stdout] | [INFO] [stdout] 117 | return ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 117 - return ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None }; [INFO] [stdout] 117 + ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/replay.rs:111:13 [INFO] [stdout] | [INFO] [stdout] 111 | self.player_moves_played_offset = self.player_moves_played_offset - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.player_moves_played_offset -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/replay.rs:114:13 [INFO] [stdout] | [INFO] [stdout] 114 | self.replay_moves_played_offset = self.replay_moves_played_offset - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.replay_moves_played_offset -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/replay.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | return ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 125 - return ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None }; [INFO] [stdout] 125 + ReplayResponse { fen: self.active_game.fen(), comment: None, last_move_from: None, last_move_to: None } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/bin/chessmarkable/canvas.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | / pub fn draw_multi_line_text( [INFO] [stdout] 51 | | &mut self, [INFO] [stdout] 52 | | x_pos: Option, [INFO] [stdout] 53 | | y_pos: i32, [INFO] [stdout] ... | [INFO] [stdout] 58 | | line_spacing: f32, [INFO] [stdout] 59 | | ) -> mxcfb_rect { [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/chessmarkable/canvas.rs:91:21 [INFO] [stdout] | [INFO] [stdout] 91 | chars_taken_so_far = chars_taken_so_far + chars_to_take; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `chars_taken_so_far += chars_to_take` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/bin/chessmarkable/savestates.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / impl Default for Savestates { [INFO] [stdout] 12 | | fn default() -> Self { [INFO] [stdout] 13 | | Self { [INFO] [stdout] 14 | | slot_1: None, [INFO] [stdout] ... | [INFO] [stdout] 19 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 5 + #[derive(Default)] [INFO] [stdout] 6 | pub struct Savestates { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead [INFO] [stdout] --> src/bin/chessmarkable/savestates.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | let ref file_path = crate::CLI_OPTS.savestates_file; [INFO] [stdout] | ----^^^^^^^^^^^^^----------------------------------- help: try: `let file_path = &crate::CLI_OPTS.savestates_file;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg [INFO] [stdout] = note: `#[warn(clippy::toplevel_ref_arg)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/board_select_scene.rs:207:13 [INFO] [stdout] | [INFO] [stdout] 207 | / if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] 208 | | let position = finger.pos; [INFO] [stdout] 209 | | if self.select_slot_1_button_hitbox.is_some() [INFO] [stdout] 210 | | && Canvas::is_hitting(position, self.select_slot_1_button_hitbox.unwrap()) [INFO] [stdout] ... | [INFO] [stdout] 244 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/bin/chessmarkable/scene/board_select_scene.rs:206:46 [INFO] [stdout] | [INFO] [stdout] 206 | if let InputEvent::MultitouchEvent { event } = event { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 207 | if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `event: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:163:39 [INFO] [stdout] | [INFO] [stdout] 163 | img_pieces_rotated.insert(piece.clone(), img.rotate180()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*piece` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:356:13 [INFO] [stdout] | [INFO] [stdout] 356 | / show_after [INFO] [stdout] 357 | | .and_then(|delay| Some(SystemTime::now() + delay)) [INFO] [stdout] | |__________________________________________________________________^ help: try: `show_after.map(|delay| SystemTime::now() + delay)` [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] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:362:13 [INFO] [stdout] | [INFO] [stdout] 362 | clear_after.and_then(|delay| Some(SystemTime::now() + delay)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `clear_after.map(|delay| SystemTime::now() + delay)` [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/bin/chessmarkable/scene/game_scene.rs:430:25 [INFO] [stdout] | [INFO] [stdout] 430 | &piece_img, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `piece_img` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `mxcfb_rect` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:465:38 [INFO] [stdout] | [INFO] [stdout] 465 | updated_regions.push(bounds.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try dereferencing it: `*bounds` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:509:40 [INFO] [stdout] | [INFO] [stdout] 509 | self.redraw_squares.insert(last_move_hint.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*last_move_hint` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:569:40 [INFO] [stdout] | [INFO] [stdout] 569 | self.redraw_squares.insert(last_move_hint.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*last_move_hint` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:643:47 [INFO] [stdout] | [INFO] [stdout] 643 | GameBottomInfo::Error(format!("{}", message)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `message.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:683:25 [INFO] [stdout] | [INFO] [stdout] 683 | / if self.is_local_user(player) { [INFO] [stdout] 684 | | if self.pvp_piece_rotation_enabled { [INFO] [stdout] 685 | | // Rotate when local player black plays [INFO] [stdout] 686 | | let should_rotate_pieces = player == Player::Black; [INFO] [stdout] ... | [INFO] [stdout] 694 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 683 ~ if self.is_local_user(player) [INFO] [stdout] 684 ~ && self.pvp_piece_rotation_enabled { [INFO] [stdout] 685 | // Rotate when local player black plays [INFO] [stdout] ... [INFO] [stdout] 692 | } [INFO] [stdout] 693 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sender` after checking its variant with `is_none` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:793:46 [INFO] [stdout] | [INFO] [stdout] 785 | ... if sender.is_none() { [INFO] [stdout] | ------------------- help: try: `if let Some() = sender` [INFO] [stdout] ... [INFO] [stdout] 793 | ... let sender = sender.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:718:9 [INFO] [stdout] | [INFO] [stdout] 718 | / match event { [INFO] [stdout] 719 | | InputEvent::MultitouchEvent { event } => { [INFO] [stdout] 720 | | // Taps and buttons [INFO] [stdout] 721 | | match event { [INFO] [stdout] ... | [INFO] [stdout] 886 | | _ => {} [INFO] [stdout] 887 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 718 ~ if let InputEvent::MultitouchEvent { event } = event { [INFO] [stdout] 719 + // Taps and buttons [INFO] [stdout] 720 + match event { [INFO] [stdout] 721 + MultitouchEvent::Press { finger } => { [INFO] [stdout] 722 + for x in 0..8 { [INFO] [stdout] 723 + for y in 0..8 { [INFO] [stdout] 724 + if Canvas::is_hitting(finger.pos, self.piece_hitboxes[x][y]) { [INFO] [stdout] 725 + self.finger_down_square = Some(to_square(x, y)); [INFO] [stdout] 726 + } [INFO] [stdout] 727 + } [INFO] [stdout] 728 + } [INFO] [stdout] 729 + } [INFO] [stdout] 730 + MultitouchEvent::Release { finger } => { [INFO] [stdout] 731 + if self.back_button_hitbox.is_some() [INFO] [stdout] 732 + && Canvas::is_hitting(finger.pos, self.back_button_hitbox.unwrap()) [INFO] [stdout] 733 + { [INFO] [stdout] 734 + // Save game [INFO] [stdout] 735 + let fen = self.board.fen(); [INFO] [stdout] 736 + let mut savesstates = crate::SAVESTATES.lock().unwrap(); [INFO] [stdout] 737 + match self.savestate_slot { [INFO] [stdout] 738 + SavestateSlot::First => savesstates.slot_1 = Some(fen), [INFO] [stdout] 739 + SavestateSlot::Second => savesstates.slot_2 = Some(fen), [INFO] [stdout] 740 + SavestateSlot::Third => savesstates.slot_3 = Some(fen), [INFO] [stdout] 741 + } [INFO] [stdout] 742 + if let Err(err) = crate::savestates::write(&savesstates) { [INFO] [stdout] 743 + error!("Failed to write savestates file!"); [INFO] [stdout] 744 + self.show_bottom_game_info( [INFO] [stdout] 745 + GameBottomInfo::Error(format!("{}", err)), [INFO] [stdout] 746 + None, [INFO] [stdout] 747 + Some(Duration::from_secs(10)), [INFO] [stdout] 748 + ); [INFO] [stdout] 749 + } else { [INFO] [stdout] 750 + info!("Saved game to selected savestate slot"); [INFO] [stdout] 751 + self.back_button_pressed = true; [INFO] [stdout] 752 + } [INFO] [stdout] 753 + } [INFO] [stdout] 754 + if self.undo_button_hitbox.is_some() [INFO] [stdout] 755 + && Canvas::is_hitting(finger.pos, self.undo_button_hitbox.unwrap()) [INFO] [stdout] 756 + { [INFO] [stdout] 757 + let undo_count: u16 = if self.game_mode == GameMode::PvP { [INFO] [stdout] 758 + 1 [INFO] [stdout] 759 + } else { [INFO] [stdout] 760 + if let Player::Black = self.board.turn().into() { [INFO] [stdout] 761 + 1 [INFO] [stdout] 762 + } else { [INFO] [stdout] 763 + 2 [INFO] [stdout] 764 + } [INFO] [stdout] 765 + }; [INFO] [stdout] 766 + let sender = if self.is_game_over { [INFO] [stdout] 767 + // Find any player to send the event on [INFO] [stdout] 768 + if let Some(ref sender) = self.black_request_sender { [INFO] [stdout] 769 + Some(sender.clone()) [INFO] [stdout] 770 + } else { [INFO] [stdout] 771 + if let Some(ref sender) = self.white_request_sender { [INFO] [stdout] 772 + Some(sender.clone()) [INFO] [stdout] 773 + } else { [INFO] [stdout] 774 + None [INFO] [stdout] 775 + } [INFO] [stdout] 776 + } [INFO] [stdout] 777 + } else { [INFO] [stdout] 778 + // Only undo when own turn [INFO] [stdout] 779 + match self.board.turn().into() { [INFO] [stdout] 780 + Player::Black => self.black_request_sender.clone(), [INFO] [stdout] 781 + Player::White => self.white_request_sender.clone(), [INFO] [stdout] 782 + } [INFO] [stdout] 783 + }; [INFO] [stdout] 784 + if sender.is_none() { [INFO] [stdout] 785 + error!("Undo failed because it cant be sent (not any local players turn)."); [INFO] [stdout] 786 + self.show_bottom_game_info( [INFO] [stdout] 787 + GameBottomInfo::Info("You can't undo right now.".to_owned()), [INFO] [stdout] 788 + None, [INFO] [stdout] 789 + Some(Duration::from_secs(3)), [INFO] [stdout] 790 + ); [INFO] [stdout] 791 + } else { [INFO] [stdout] 792 + let sender = sender.unwrap(); [INFO] [stdout] 793 + self.runtime.spawn(async move { [INFO] [stdout] 794 + sender [INFO] [stdout] 795 + .send(ChessRequest::UndoMoves { moves: undo_count }) [INFO] [stdout] 796 + .await [INFO] [stdout] 797 + .ok(); [INFO] [stdout] 798 + }); [INFO] [stdout] 799 + } [INFO] [stdout] 800 + } [INFO] [stdout] 801 + if self.full_refresh_button_hitbox.is_some() [INFO] [stdout] 802 + && Canvas::is_hitting( [INFO] [stdout] 803 + finger.pos, [INFO] [stdout] 804 + self.full_refresh_button_hitbox.unwrap(), [INFO] [stdout] 805 + ) [INFO] [stdout] 806 + { [INFO] [stdout] 807 + self.force_full_refresh = Some(SystemTime::now()); [INFO] [stdout] 808 + } else if !self.is_game_over { [INFO] [stdout] 809 + for x in 0..8 { [INFO] [stdout] 810 + for y in 0..8 { [INFO] [stdout] 811 + if Canvas::is_hitting(finger.pos, self.piece_hitboxes[x][y]) { [INFO] [stdout] 812 + let new_square = to_square(x, y); [INFO] [stdout] 813 + if let Some(last_selected_square) = self.selected_square { [INFO] [stdout] 814 + self.redraw_squares [INFO] [stdout] 815 + .insert(last_selected_square.clone()); [INFO] [stdout] 816 + [INFO] [stdout] 817 + if last_selected_square == new_square { [INFO] [stdout] 818 + // Cancel move [INFO] [stdout] 819 + self.selected_square = None; [INFO] [stdout] 820 + self.clear_move_hints(); [INFO] [stdout] 821 + } else { [INFO] [stdout] 822 + // Attempt to move from last_selected_square to new_square if move is [INFO] [stdout] 823 + // in self.possible_moves. Otherwise just select the piece on new_square. [INFO] [stdout] 824 + // See https://github.com/LinusCDE/chessmarkable/issues/14 [INFO] [stdout] 825 + let is_possible_move = self [INFO] [stdout] 826 + .possible_moves [INFO] [stdout] 827 + .iter() [INFO] [stdout] 828 + .any(|(possible_src, possible_dest)| { [INFO] [stdout] 829 + possible_src == &last_selected_square [INFO] [stdout] 830 + && possible_dest == &new_square [INFO] [stdout] 831 + }); [INFO] [stdout] 832 + if is_possible_move { [INFO] [stdout] 833 + // Move [INFO] [stdout] 834 + self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] 835 + self.on_user_move( [INFO] [stdout] 836 + last_selected_square, [INFO] [stdout] 837 + new_square, [INFO] [stdout] 838 + ); [INFO] [stdout] 839 + } else { [INFO] [stdout] 840 + // Select new_square as new selected piece [INFO] [stdout] 841 + if self.board.piece_at_sq(*new_square) [INFO] [stdout] 842 + != Piece::None [INFO] [stdout] 843 + { [INFO] [stdout] 844 + self.selected_square = Some(new_square); [INFO] [stdout] 845 + self.redraw_squares [INFO] [stdout] 846 + .insert(new_square.clone()); [INFO] [stdout] 847 + self.set_move_hints(new_square); [INFO] [stdout] 848 + } else { [INFO] [stdout] 849 + // Clear selection [INFO] [stdout] 850 + self.selected_square = None; [INFO] [stdout] 851 + self.clear_move_hints(); [INFO] [stdout] 852 + } [INFO] [stdout] 853 + } [INFO] [stdout] 854 + } [INFO] [stdout] 855 + } else { [INFO] [stdout] 856 + let finger_down_square = self [INFO] [stdout] 857 + .finger_down_square [INFO] [stdout] 858 + .unwrap_or(new_square.clone()); [INFO] [stdout] 859 + if finger_down_square.0 != new_square.0 { [INFO] [stdout] 860 + // Do immeate move (swiped) without highlighting [INFO] [stdout] 861 + [INFO] [stdout] 862 + self.redraw_squares [INFO] [stdout] 863 + .insert(finger_down_square.clone()); [INFO] [stdout] 864 + self.on_user_move(finger_down_square, new_square); [INFO] [stdout] 865 + } else { [INFO] [stdout] 866 + // Mark square [INFO] [stdout] 867 + if self.board.piece_at_sq(*new_square) [INFO] [stdout] 868 + != Piece::None [INFO] [stdout] 869 + { [INFO] [stdout] 870 + self.selected_square = Some(new_square); [INFO] [stdout] 871 + self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] 872 + self.set_move_hints(new_square); [INFO] [stdout] 873 + } [INFO] [stdout] 874 + } [INFO] [stdout] 875 + }; [INFO] [stdout] 876 + } [INFO] [stdout] 877 + } [INFO] [stdout] 878 + } [INFO] [stdout] 879 + } [INFO] [stdout] 880 + self.finger_down_square = None; [INFO] [stdout] 881 + } [INFO] [stdout] 882 + _ => {} [INFO] [stdout] 883 + } [INFO] [stdout] 884 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:772:37 [INFO] [stdout] | [INFO] [stdout] 772 | / ... if let Some(ref sender) = self.white_request_sender { [INFO] [stdout] 773 | | ... Some(sender.clone()) [INFO] [stdout] 774 | | ... } else { [INFO] [stdout] 775 | | ... None [INFO] [stdout] 776 | | ... } [INFO] [stdout] | |_______________________^ help: try: `self.white_request_sender.as_ref().map(|sender| sender.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:816:57 [INFO] [stdout] | [INFO] [stdout] 816 | ... .insert(last_selected_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `last_selected_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:835:80 [INFO] [stdout] | [INFO] [stdout] 835 | ... self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:847:69 [INFO] [stdout] | [INFO] [stdout] 847 | ... .insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:859:60 [INFO] [stdout] | [INFO] [stdout] 859 | ... .unwrap_or(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:864:61 [INFO] [stdout] | [INFO] [stdout] 864 | ... .insert(finger_down_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `finger_down_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:872:80 [INFO] [stdout] | [INFO] [stdout] 872 | ... self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:987:39 [INFO] [stdout] | [INFO] [stdout] 987 | if self.redraw_all_squares || self.redraw_squares.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.redraw_squares.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: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/main_menu_scene.rs:104:30 [INFO] [stdout] | [INFO] [stdout] 104 | let mut ext_hitbox = self.pvp_toggle_piece_rotation_hitbox.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.pvp_toggle_piece_rotation_hitbox` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/main_menu_scene.rs:244:13 [INFO] [stdout] | [INFO] [stdout] 244 | / if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] 245 | | let position = finger.pos; [INFO] [stdout] 246 | | if self.play_pvp_button_hitbox.is_some() [INFO] [stdout] 247 | | && Canvas::is_hitting(position, self.play_pvp_button_hitbox.unwrap()) [INFO] [stdout] ... | [INFO] [stdout] 281 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/bin/chessmarkable/scene/main_menu_scene.rs:243:46 [INFO] [stdout] | [INFO] [stdout] 243 | if let InputEvent::MultitouchEvent { event } = event { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 244 | if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `event: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:54:36 [INFO] [stdout] | [INFO] [stdout] 54 | let selected_pgn_changed = if selected_pgn.is_some() {true} else {false}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `selected_pgn.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:108:31 [INFO] [stdout] | [INFO] [stdout] 108 | let choose_pgn_mode = !self.selected_pgn.is_some(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.selected_pgn.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:114:28 [INFO] [stdout] | [INFO] [stdout] 114 | self.pgn_vec = match crate::pgns::read((self.current_page_number * REPLAYS_PER_PAGE) as usize, ((self.current_page_nu... [INFO] [stdout] | ____________________________^ [INFO] [stdout] 115 | | Ok(vec) => vec, [INFO] [stdout] 116 | | Err(_) => Vec::new() [INFO] [stdout] 117 | | }; [INFO] [stdout] | |_____________^ help: replace it with: `crate::pgns::read((self.current_page_number * REPLAYS_PER_PAGE) as usize, ((self.current_page_number + 1) * REPLAYS_PER_PAGE - 1) as usize).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:120:16 [INFO] [stdout] | [INFO] [stdout] 120 | if self.pgn_vec.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.pgn_vec.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: accessing first element with `self.pgn_vec.get(0)` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:140:64 [INFO] [stdout] | [INFO] [stdout] 140 | self.button_1_hitbox = draw_button_for_pgn(canvas, self.pgn_vec.get(0), FIRST_BOX_Y_POS, 50.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `self.pgn_vec.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:169:16 [INFO] [stdout] | [INFO] [stdout] 169 | if self.game_vec.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.game_vec.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 `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:248:13 [INFO] [stdout] | [INFO] [stdout] 248 | / if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] 249 | | let position = finger.pos; [INFO] [stdout] 250 | | if self.selected_pgn.is_some() { [INFO] [stdout] 251 | | if self.back_button_hitbox.is_some() [INFO] [stdout] ... | [INFO] [stdout] 326 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:247:46 [INFO] [stdout] | [INFO] [stdout] 247 | if let InputEvent::MultitouchEvent { event } = event { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 248 | if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `event: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:335:13 [INFO] [stdout] | [INFO] [stdout] 335 | self.current_page_number = self.current_page_number + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.current_page_number += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:342:13 [INFO] [stdout] | [INFO] [stdout] 342 | self.current_page_number = self.current_page_number - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.current_page_number -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:371:5 [INFO] [stdout] | [INFO] [stdout] 371 | replay_text.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `replay_text.push(' ')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:377:5 [INFO] [stdout] | [INFO] [stdout] 377 | / match maybe_pgn_ref { [INFO] [stdout] 378 | | Some(pgn_ref) => Some(canvas.draw_box_button(y_pos, BOX_HEIGHT as u32, &pgn_ref.path.file_name().unwrap().to_owned().into... [INFO] [stdout] 379 | | None => None [INFO] [stdout] 380 | | } [INFO] [stdout] | |_____^ help: try: `maybe_pgn_ref.map(|pgn_ref| canvas.draw_box_button(y_pos, BOX_HEIGHT as u32, &pgn_ref.path.file_name().unwrap().to_owned().into_string().unwrap_or("Can't read file name".to_string()), font_size))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:384:5 [INFO] [stdout] | [INFO] [stdout] 384 | / match maybe_game_ref { [INFO] [stdout] 385 | | Some(game_ref) => Some(canvas.draw_box_button(y_pos, BOX_HEIGHT as u32, &construct_text_for_replay(game_ref), font_size)), [INFO] [stdout] 386 | | None => None [INFO] [stdout] 387 | | } [INFO] [stdout] | |_____^ help: try: `maybe_game_ref.map(|game_ref| canvas.draw_box_button(y_pos, BOX_HEIGHT as u32, &construct_text_for_replay(game_ref), font_size))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:212:25 [INFO] [stdout] | [INFO] [stdout] 212 | &piece_img, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `piece_img` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `mxcfb_rect` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:247:38 [INFO] [stdout] | [INFO] [stdout] 247 | updated_regions.push(bounds.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try dereferencing it: `*bounds` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:291:40 [INFO] [stdout] | [INFO] [stdout] 291 | self.redraw_squares.insert(last_move_hint.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*last_move_hint` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:324:40 [INFO] [stdout] | [INFO] [stdout] 324 | self.redraw_squares.insert(last_move_hint.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*last_move_hint` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:373:17 [INFO] [stdout] | [INFO] [stdout] 373 | / match event { [INFO] [stdout] 374 | | GPIOEvent::Press { button } => { [INFO] [stdout] 375 | | match button { [INFO] [stdout] 376 | | PhysicalButton::RIGHT => { [INFO] [stdout] ... | [INFO] [stdout] 387 | | _ => {} [INFO] [stdout] 388 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:372:32 [INFO] [stdout] | [INFO] [stdout] 372 | InputEvent::GPIO { event } => { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 373 | match event { [INFO] [stdout] 374 | GPIOEvent::Press { button } => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `event: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:373:17 [INFO] [stdout] | [INFO] [stdout] 373 | / match event { [INFO] [stdout] 374 | | GPIOEvent::Press { button } => { [INFO] [stdout] 375 | | match button { [INFO] [stdout] 376 | | PhysicalButton::RIGHT => { [INFO] [stdout] ... | [INFO] [stdout] 387 | | _ => {} [INFO] [stdout] 388 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 373 ~ if let GPIOEvent::Press { button } = event { [INFO] [stdout] 374 + match button { [INFO] [stdout] 375 + PhysicalButton::RIGHT => { [INFO] [stdout] 376 + let response = self.replay.play_replay_move(); [INFO] [stdout] 377 + self.play_replay_move(response); [INFO] [stdout] 378 + }, [INFO] [stdout] 379 + PhysicalButton::LEFT => { [INFO] [stdout] 380 + let response = self.replay.undo_move(); [INFO] [stdout] 381 + self.play_replay_move(response); [INFO] [stdout] 382 + }, [INFO] [stdout] 383 + _ => {} [INFO] [stdout] 384 + } [INFO] [stdout] 385 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:437:25 [INFO] [stdout] | [INFO] [stdout] 437 | / if !self.is_game_over { [INFO] [stdout] 438 | | for x in 0..8 { [INFO] [stdout] 439 | | for y in 0..8 { [INFO] [stdout] 440 | | if Canvas::is_hitting(finger.pos, self.piece_hitboxes[x][y]) { [INFO] [stdout] ... | [INFO] [stdout] 508 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 436 ~ MultitouchEvent::Release { finger } [INFO] [stdout] 437 ~ if !self.is_game_over => { [INFO] [stdout] 438 | for x in 0..8 { [INFO] [stdout] ... [INFO] [stdout] 507 | } [INFO] [stdout] 508 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:444:57 [INFO] [stdout] | [INFO] [stdout] 444 | ... .insert(last_selected_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `last_selected_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:463:80 [INFO] [stdout] | [INFO] [stdout] 463 | ... self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:475:69 [INFO] [stdout] | [INFO] [stdout] 475 | ... .insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:487:60 [INFO] [stdout] | [INFO] [stdout] 487 | ... .unwrap_or(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:492:61 [INFO] [stdout] | [INFO] [stdout] 492 | ... .insert(finger_down_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `finger_down_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:500:80 [INFO] [stdout] | [INFO] [stdout] 500 | ... self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:592:39 [INFO] [stdout] | [INFO] [stdout] 592 | if self.redraw_all_squares || self.redraw_squares.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.redraw_squares.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: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead [INFO] [stdout] --> src/bin/chessmarkable/pgns.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | let ref pgn_loc = crate::CLI_OPTS.pgn_location; [INFO] [stdout] | ----^^^^^^^^^^^-------------------------------- help: try: `let pgn_loc = &crate::CLI_OPTS.pgn_location;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead [INFO] [stdout] --> src/bin/chessmarkable/pgns.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | let ref pgn_loc = crate::CLI_OPTS.pgn_location; [INFO] [stdout] | ----^^^^^^^^^^^-------------------------------- help: try: `let pgn_loc = &crate::CLI_OPTS.pgn_location;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/chessmarkable/pgns.rs:48:26 [INFO] [stdout] | [INFO] [stdout] 48 | Ok(_) => pages = pages + 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `pages += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/bin/chessmarkable/canvas.rs:50:5 [INFO] [stdout] | [INFO] [stdout] 50 | / pub fn draw_multi_line_text( [INFO] [stdout] 51 | | &mut self, [INFO] [stdout] 52 | | x_pos: Option, [INFO] [stdout] 53 | | y_pos: i32, [INFO] [stdout] ... | [INFO] [stdout] 58 | | line_spacing: f32, [INFO] [stdout] 59 | | ) -> mxcfb_rect { [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/chessmarkable/canvas.rs:91:21 [INFO] [stdout] | [INFO] [stdout] 91 | chars_taken_so_far = chars_taken_so_far + chars_to_take; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `chars_taken_so_far += chars_to_take` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/bin/chessmarkable/savestates.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / impl Default for Savestates { [INFO] [stdout] 12 | | fn default() -> Self { [INFO] [stdout] 13 | | Self { [INFO] [stdout] 14 | | slot_1: None, [INFO] [stdout] ... | [INFO] [stdout] 19 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 5 + #[derive(Default)] [INFO] [stdout] 6 | pub struct Savestates { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead [INFO] [stdout] --> src/bin/chessmarkable/savestates.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | let ref file_path = crate::CLI_OPTS.savestates_file; [INFO] [stdout] | ----^^^^^^^^^^^^^----------------------------------- help: try: `let file_path = &crate::CLI_OPTS.savestates_file;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg [INFO] [stdout] = note: `#[warn(clippy::toplevel_ref_arg)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/board_select_scene.rs:207:13 [INFO] [stdout] | [INFO] [stdout] 207 | / if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] 208 | | let position = finger.pos; [INFO] [stdout] 209 | | if self.select_slot_1_button_hitbox.is_some() [INFO] [stdout] 210 | | && Canvas::is_hitting(position, self.select_slot_1_button_hitbox.unwrap()) [INFO] [stdout] ... | [INFO] [stdout] 244 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/bin/chessmarkable/scene/board_select_scene.rs:206:46 [INFO] [stdout] | [INFO] [stdout] 206 | if let InputEvent::MultitouchEvent { event } = event { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 207 | if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `event: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:163:39 [INFO] [stdout] | [INFO] [stdout] 163 | img_pieces_rotated.insert(piece.clone(), img.rotate180()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*piece` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:356:13 [INFO] [stdout] | [INFO] [stdout] 356 | / show_after [INFO] [stdout] 357 | | .and_then(|delay| Some(SystemTime::now() + delay)) [INFO] [stdout] | |__________________________________________________________________^ help: try: `show_after.map(|delay| SystemTime::now() + delay)` [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] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:362:13 [INFO] [stdout] | [INFO] [stdout] 362 | clear_after.and_then(|delay| Some(SystemTime::now() + delay)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `clear_after.map(|delay| SystemTime::now() + delay)` [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/bin/chessmarkable/scene/game_scene.rs:430:25 [INFO] [stdout] | [INFO] [stdout] 430 | &piece_img, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `piece_img` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `mxcfb_rect` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:465:38 [INFO] [stdout] | [INFO] [stdout] 465 | updated_regions.push(bounds.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try dereferencing it: `*bounds` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:509:40 [INFO] [stdout] | [INFO] [stdout] 509 | self.redraw_squares.insert(last_move_hint.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*last_move_hint` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:569:40 [INFO] [stdout] | [INFO] [stdout] 569 | self.redraw_squares.insert(last_move_hint.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*last_move_hint` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:643:47 [INFO] [stdout] | [INFO] [stdout] 643 | GameBottomInfo::Error(format!("{}", message)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `message.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:683:25 [INFO] [stdout] | [INFO] [stdout] 683 | / if self.is_local_user(player) { [INFO] [stdout] 684 | | if self.pvp_piece_rotation_enabled { [INFO] [stdout] 685 | | // Rotate when local player black plays [INFO] [stdout] 686 | | let should_rotate_pieces = player == Player::Black; [INFO] [stdout] ... | [INFO] [stdout] 694 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 683 ~ if self.is_local_user(player) [INFO] [stdout] 684 ~ && self.pvp_piece_rotation_enabled { [INFO] [stdout] 685 | // Rotate when local player black plays [INFO] [stdout] ... [INFO] [stdout] 692 | } [INFO] [stdout] 693 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `sender` after checking its variant with `is_none` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:793:46 [INFO] [stdout] | [INFO] [stdout] 785 | ... if sender.is_none() { [INFO] [stdout] | ------------------- help: try: `if let Some() = sender` [INFO] [stdout] ... [INFO] [stdout] 793 | ... let sender = sender.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:718:9 [INFO] [stdout] | [INFO] [stdout] 718 | / match event { [INFO] [stdout] 719 | | InputEvent::MultitouchEvent { event } => { [INFO] [stdout] 720 | | // Taps and buttons [INFO] [stdout] 721 | | match event { [INFO] [stdout] ... | [INFO] [stdout] 886 | | _ => {} [INFO] [stdout] 887 | | }; [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 718 ~ if let InputEvent::MultitouchEvent { event } = event { [INFO] [stdout] 719 + // Taps and buttons [INFO] [stdout] 720 + match event { [INFO] [stdout] 721 + MultitouchEvent::Press { finger } => { [INFO] [stdout] 722 + for x in 0..8 { [INFO] [stdout] 723 + for y in 0..8 { [INFO] [stdout] 724 + if Canvas::is_hitting(finger.pos, self.piece_hitboxes[x][y]) { [INFO] [stdout] 725 + self.finger_down_square = Some(to_square(x, y)); [INFO] [stdout] 726 + } [INFO] [stdout] 727 + } [INFO] [stdout] 728 + } [INFO] [stdout] 729 + } [INFO] [stdout] 730 + MultitouchEvent::Release { finger } => { [INFO] [stdout] 731 + if self.back_button_hitbox.is_some() [INFO] [stdout] 732 + && Canvas::is_hitting(finger.pos, self.back_button_hitbox.unwrap()) [INFO] [stdout] 733 + { [INFO] [stdout] 734 + // Save game [INFO] [stdout] 735 + let fen = self.board.fen(); [INFO] [stdout] 736 + let mut savesstates = crate::SAVESTATES.lock().unwrap(); [INFO] [stdout] 737 + match self.savestate_slot { [INFO] [stdout] 738 + SavestateSlot::First => savesstates.slot_1 = Some(fen), [INFO] [stdout] 739 + SavestateSlot::Second => savesstates.slot_2 = Some(fen), [INFO] [stdout] 740 + SavestateSlot::Third => savesstates.slot_3 = Some(fen), [INFO] [stdout] 741 + } [INFO] [stdout] 742 + if let Err(err) = crate::savestates::write(&savesstates) { [INFO] [stdout] 743 + error!("Failed to write savestates file!"); [INFO] [stdout] 744 + self.show_bottom_game_info( [INFO] [stdout] 745 + GameBottomInfo::Error(format!("{}", err)), [INFO] [stdout] 746 + None, [INFO] [stdout] 747 + Some(Duration::from_secs(10)), [INFO] [stdout] 748 + ); [INFO] [stdout] 749 + } else { [INFO] [stdout] 750 + info!("Saved game to selected savestate slot"); [INFO] [stdout] 751 + self.back_button_pressed = true; [INFO] [stdout] 752 + } [INFO] [stdout] 753 + } [INFO] [stdout] 754 + if self.undo_button_hitbox.is_some() [INFO] [stdout] 755 + && Canvas::is_hitting(finger.pos, self.undo_button_hitbox.unwrap()) [INFO] [stdout] 756 + { [INFO] [stdout] 757 + let undo_count: u16 = if self.game_mode == GameMode::PvP { [INFO] [stdout] 758 + 1 [INFO] [stdout] 759 + } else { [INFO] [stdout] 760 + if let Player::Black = self.board.turn().into() { [INFO] [stdout] 761 + 1 [INFO] [stdout] 762 + } else { [INFO] [stdout] 763 + 2 [INFO] [stdout] 764 + } [INFO] [stdout] 765 + }; [INFO] [stdout] 766 + let sender = if self.is_game_over { [INFO] [stdout] 767 + // Find any player to send the event on [INFO] [stdout] 768 + if let Some(ref sender) = self.black_request_sender { [INFO] [stdout] 769 + Some(sender.clone()) [INFO] [stdout] 770 + } else { [INFO] [stdout] 771 + if let Some(ref sender) = self.white_request_sender { [INFO] [stdout] 772 + Some(sender.clone()) [INFO] [stdout] 773 + } else { [INFO] [stdout] 774 + None [INFO] [stdout] 775 + } [INFO] [stdout] 776 + } [INFO] [stdout] 777 + } else { [INFO] [stdout] 778 + // Only undo when own turn [INFO] [stdout] 779 + match self.board.turn().into() { [INFO] [stdout] 780 + Player::Black => self.black_request_sender.clone(), [INFO] [stdout] 781 + Player::White => self.white_request_sender.clone(), [INFO] [stdout] 782 + } [INFO] [stdout] 783 + }; [INFO] [stdout] 784 + if sender.is_none() { [INFO] [stdout] 785 + error!("Undo failed because it cant be sent (not any local players turn)."); [INFO] [stdout] 786 + self.show_bottom_game_info( [INFO] [stdout] 787 + GameBottomInfo::Info("You can't undo right now.".to_owned()), [INFO] [stdout] 788 + None, [INFO] [stdout] 789 + Some(Duration::from_secs(3)), [INFO] [stdout] 790 + ); [INFO] [stdout] 791 + } else { [INFO] [stdout] 792 + let sender = sender.unwrap(); [INFO] [stdout] 793 + self.runtime.spawn(async move { [INFO] [stdout] 794 + sender [INFO] [stdout] 795 + .send(ChessRequest::UndoMoves { moves: undo_count }) [INFO] [stdout] 796 + .await [INFO] [stdout] 797 + .ok(); [INFO] [stdout] 798 + }); [INFO] [stdout] 799 + } [INFO] [stdout] 800 + } [INFO] [stdout] 801 + if self.full_refresh_button_hitbox.is_some() [INFO] [stdout] 802 + && Canvas::is_hitting( [INFO] [stdout] 803 + finger.pos, [INFO] [stdout] 804 + self.full_refresh_button_hitbox.unwrap(), [INFO] [stdout] 805 + ) [INFO] [stdout] 806 + { [INFO] [stdout] 807 + self.force_full_refresh = Some(SystemTime::now()); [INFO] [stdout] 808 + } else if !self.is_game_over { [INFO] [stdout] 809 + for x in 0..8 { [INFO] [stdout] 810 + for y in 0..8 { [INFO] [stdout] 811 + if Canvas::is_hitting(finger.pos, self.piece_hitboxes[x][y]) { [INFO] [stdout] 812 + let new_square = to_square(x, y); [INFO] [stdout] 813 + if let Some(last_selected_square) = self.selected_square { [INFO] [stdout] 814 + self.redraw_squares [INFO] [stdout] 815 + .insert(last_selected_square.clone()); [INFO] [stdout] 816 + [INFO] [stdout] 817 + if last_selected_square == new_square { [INFO] [stdout] 818 + // Cancel move [INFO] [stdout] 819 + self.selected_square = None; [INFO] [stdout] 820 + self.clear_move_hints(); [INFO] [stdout] 821 + } else { [INFO] [stdout] 822 + // Attempt to move from last_selected_square to new_square if move is [INFO] [stdout] 823 + // in self.possible_moves. Otherwise just select the piece on new_square. [INFO] [stdout] 824 + // See https://github.com/LinusCDE/chessmarkable/issues/14 [INFO] [stdout] 825 + let is_possible_move = self [INFO] [stdout] 826 + .possible_moves [INFO] [stdout] 827 + .iter() [INFO] [stdout] 828 + .any(|(possible_src, possible_dest)| { [INFO] [stdout] 829 + possible_src == &last_selected_square [INFO] [stdout] 830 + && possible_dest == &new_square [INFO] [stdout] 831 + }); [INFO] [stdout] 832 + if is_possible_move { [INFO] [stdout] 833 + // Move [INFO] [stdout] 834 + self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] 835 + self.on_user_move( [INFO] [stdout] 836 + last_selected_square, [INFO] [stdout] 837 + new_square, [INFO] [stdout] 838 + ); [INFO] [stdout] 839 + } else { [INFO] [stdout] 840 + // Select new_square as new selected piece [INFO] [stdout] 841 + if self.board.piece_at_sq(*new_square) [INFO] [stdout] 842 + != Piece::None [INFO] [stdout] 843 + { [INFO] [stdout] 844 + self.selected_square = Some(new_square); [INFO] [stdout] 845 + self.redraw_squares [INFO] [stdout] 846 + .insert(new_square.clone()); [INFO] [stdout] 847 + self.set_move_hints(new_square); [INFO] [stdout] 848 + } else { [INFO] [stdout] 849 + // Clear selection [INFO] [stdout] 850 + self.selected_square = None; [INFO] [stdout] 851 + self.clear_move_hints(); [INFO] [stdout] 852 + } [INFO] [stdout] 853 + } [INFO] [stdout] 854 + } [INFO] [stdout] 855 + } else { [INFO] [stdout] 856 + let finger_down_square = self [INFO] [stdout] 857 + .finger_down_square [INFO] [stdout] 858 + .unwrap_or(new_square.clone()); [INFO] [stdout] 859 + if finger_down_square.0 != new_square.0 { [INFO] [stdout] 860 + // Do immeate move (swiped) without highlighting [INFO] [stdout] 861 + [INFO] [stdout] 862 + self.redraw_squares [INFO] [stdout] 863 + .insert(finger_down_square.clone()); [INFO] [stdout] 864 + self.on_user_move(finger_down_square, new_square); [INFO] [stdout] 865 + } else { [INFO] [stdout] 866 + // Mark square [INFO] [stdout] 867 + if self.board.piece_at_sq(*new_square) [INFO] [stdout] 868 + != Piece::None [INFO] [stdout] 869 + { [INFO] [stdout] 870 + self.selected_square = Some(new_square); [INFO] [stdout] 871 + self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] 872 + self.set_move_hints(new_square); [INFO] [stdout] 873 + } [INFO] [stdout] 874 + } [INFO] [stdout] 875 + }; [INFO] [stdout] 876 + } [INFO] [stdout] 877 + } [INFO] [stdout] 878 + } [INFO] [stdout] 879 + } [INFO] [stdout] 880 + self.finger_down_square = None; [INFO] [stdout] 881 + } [INFO] [stdout] 882 + _ => {} [INFO] [stdout] 883 + } [INFO] [stdout] 884 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:772:37 [INFO] [stdout] | [INFO] [stdout] 772 | / ... if let Some(ref sender) = self.white_request_sender { [INFO] [stdout] 773 | | ... Some(sender.clone()) [INFO] [stdout] 774 | | ... } else { [INFO] [stdout] 775 | | ... None [INFO] [stdout] 776 | | ... } [INFO] [stdout] | |_______________________^ help: try: `self.white_request_sender.as_ref().map(|sender| sender.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:816:57 [INFO] [stdout] | [INFO] [stdout] 816 | ... .insert(last_selected_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `last_selected_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:835:80 [INFO] [stdout] | [INFO] [stdout] 835 | ... self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:847:69 [INFO] [stdout] | [INFO] [stdout] 847 | ... .insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:859:60 [INFO] [stdout] | [INFO] [stdout] 859 | ... .unwrap_or(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:864:61 [INFO] [stdout] | [INFO] [stdout] 864 | ... .insert(finger_down_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `finger_down_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:872:80 [INFO] [stdout] | [INFO] [stdout] 872 | ... self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/chessmarkable/scene/game_scene.rs:987:39 [INFO] [stdout] | [INFO] [stdout] 987 | if self.redraw_all_squares || self.redraw_squares.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.redraw_squares.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: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/main_menu_scene.rs:104:30 [INFO] [stdout] | [INFO] [stdout] 104 | let mut ext_hitbox = self.pvp_toggle_piece_rotation_hitbox.clone().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.pvp_toggle_piece_rotation_hitbox` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/main_menu_scene.rs:244:13 [INFO] [stdout] | [INFO] [stdout] 244 | / if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] 245 | | let position = finger.pos; [INFO] [stdout] 246 | | if self.play_pvp_button_hitbox.is_some() [INFO] [stdout] 247 | | && Canvas::is_hitting(position, self.play_pvp_button_hitbox.unwrap()) [INFO] [stdout] ... | [INFO] [stdout] 281 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/bin/chessmarkable/scene/main_menu_scene.rs:243:46 [INFO] [stdout] | [INFO] [stdout] 243 | if let InputEvent::MultitouchEvent { event } = event { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 244 | if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `event: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:54:36 [INFO] [stdout] | [INFO] [stdout] 54 | let selected_pgn_changed = if selected_pgn.is_some() {true} else {false}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can reduce it to: `selected_pgn.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:108:31 [INFO] [stdout] | [INFO] [stdout] 108 | let choose_pgn_mode = !self.selected_pgn.is_some(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.selected_pgn.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:114:28 [INFO] [stdout] | [INFO] [stdout] 114 | self.pgn_vec = match crate::pgns::read((self.current_page_number * REPLAYS_PER_PAGE) as usize, ((self.current_page_nu... [INFO] [stdout] | ____________________________^ [INFO] [stdout] 115 | | Ok(vec) => vec, [INFO] [stdout] 116 | | Err(_) => Vec::new() [INFO] [stdout] 117 | | }; [INFO] [stdout] | |_____________^ help: replace it with: `crate::pgns::read((self.current_page_number * REPLAYS_PER_PAGE) as usize, ((self.current_page_number + 1) * REPLAYS_PER_PAGE - 1) as usize).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:120:16 [INFO] [stdout] | [INFO] [stdout] 120 | if self.pgn_vec.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.pgn_vec.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: accessing first element with `self.pgn_vec.get(0)` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:140:64 [INFO] [stdout] | [INFO] [stdout] 140 | self.button_1_hitbox = draw_button_for_pgn(canvas, self.pgn_vec.get(0), FIRST_BOX_Y_POS, 50.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `self.pgn_vec.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:169:16 [INFO] [stdout] | [INFO] [stdout] 169 | if self.game_vec.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.game_vec.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 `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:248:13 [INFO] [stdout] | [INFO] [stdout] 248 | / if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] 249 | | let position = finger.pos; [INFO] [stdout] 250 | | if self.selected_pgn.is_some() { [INFO] [stdout] 251 | | if self.back_button_hitbox.is_some() [INFO] [stdout] ... | [INFO] [stdout] 326 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:247:46 [INFO] [stdout] | [INFO] [stdout] 247 | if let InputEvent::MultitouchEvent { event } = event { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 248 | if let MultitouchEvent::Release { finger, .. } = event { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `event: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:335:13 [INFO] [stdout] | [INFO] [stdout] 335 | self.current_page_number = self.current_page_number + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.current_page_number += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:342:13 [INFO] [stdout] | [INFO] [stdout] 342 | self.current_page_number = self.current_page_number - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.current_page_number -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:371:5 [INFO] [stdout] | [INFO] [stdout] 371 | replay_text.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `replay_text.push(' ')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:377:5 [INFO] [stdout] | [INFO] [stdout] 377 | / match maybe_pgn_ref { [INFO] [stdout] 378 | | Some(pgn_ref) => Some(canvas.draw_box_button(y_pos, BOX_HEIGHT as u32, &pgn_ref.path.file_name().unwrap().to_owned().into... [INFO] [stdout] 379 | | None => None [INFO] [stdout] 380 | | } [INFO] [stdout] | |_____^ help: try: `maybe_pgn_ref.map(|pgn_ref| canvas.draw_box_button(y_pos, BOX_HEIGHT as u32, &pgn_ref.path.file_name().unwrap().to_owned().into_string().unwrap_or("Can't read file name".to_string()), font_size))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/bin/chessmarkable/scene/pgn_select_scene.rs:384:5 [INFO] [stdout] | [INFO] [stdout] 384 | / match maybe_game_ref { [INFO] [stdout] 385 | | Some(game_ref) => Some(canvas.draw_box_button(y_pos, BOX_HEIGHT as u32, &construct_text_for_replay(game_ref), font_size)), [INFO] [stdout] 386 | | None => None [INFO] [stdout] 387 | | } [INFO] [stdout] | |_____^ help: try: `maybe_game_ref.map(|game_ref| canvas.draw_box_button(y_pos, BOX_HEIGHT as u32, &construct_text_for_replay(game_ref), font_size))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:212:25 [INFO] [stdout] | [INFO] [stdout] 212 | &piece_img, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `piece_img` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `mxcfb_rect` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:247:38 [INFO] [stdout] | [INFO] [stdout] 247 | updated_regions.push(bounds.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try dereferencing it: `*bounds` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:291:40 [INFO] [stdout] | [INFO] [stdout] 291 | self.redraw_squares.insert(last_move_hint.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*last_move_hint` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:324:40 [INFO] [stdout] | [INFO] [stdout] 324 | self.redraw_squares.insert(last_move_hint.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*last_move_hint` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:373:17 [INFO] [stdout] | [INFO] [stdout] 373 | / match event { [INFO] [stdout] 374 | | GPIOEvent::Press { button } => { [INFO] [stdout] 375 | | match button { [INFO] [stdout] 376 | | PhysicalButton::RIGHT => { [INFO] [stdout] ... | [INFO] [stdout] 387 | | _ => {} [INFO] [stdout] 388 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:372:32 [INFO] [stdout] | [INFO] [stdout] 372 | InputEvent::GPIO { event } => { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 373 | match event { [INFO] [stdout] 374 | GPIOEvent::Press { button } => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `event: ` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:373:17 [INFO] [stdout] | [INFO] [stdout] 373 | / match event { [INFO] [stdout] 374 | | GPIOEvent::Press { button } => { [INFO] [stdout] 375 | | match button { [INFO] [stdout] 376 | | PhysicalButton::RIGHT => { [INFO] [stdout] ... | [INFO] [stdout] 387 | | _ => {} [INFO] [stdout] 388 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 373 ~ if let GPIOEvent::Press { button } = event { [INFO] [stdout] 374 + match button { [INFO] [stdout] 375 + PhysicalButton::RIGHT => { [INFO] [stdout] 376 + let response = self.replay.play_replay_move(); [INFO] [stdout] 377 + self.play_replay_move(response); [INFO] [stdout] 378 + }, [INFO] [stdout] 379 + PhysicalButton::LEFT => { [INFO] [stdout] 380 + let response = self.replay.undo_move(); [INFO] [stdout] 381 + self.play_replay_move(response); [INFO] [stdout] 382 + }, [INFO] [stdout] 383 + _ => {} [INFO] [stdout] 384 + } [INFO] [stdout] 385 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:437:25 [INFO] [stdout] | [INFO] [stdout] 437 | / if !self.is_game_over { [INFO] [stdout] 438 | | for x in 0..8 { [INFO] [stdout] 439 | | for y in 0..8 { [INFO] [stdout] 440 | | if Canvas::is_hitting(finger.pos, self.piece_hitboxes[x][y]) { [INFO] [stdout] ... | [INFO] [stdout] 508 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 436 ~ MultitouchEvent::Release { finger } [INFO] [stdout] 437 ~ if !self.is_game_over => { [INFO] [stdout] 438 | for x in 0..8 { [INFO] [stdout] ... [INFO] [stdout] 507 | } [INFO] [stdout] 508 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:444:57 [INFO] [stdout] | [INFO] [stdout] 444 | ... .insert(last_selected_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `last_selected_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:463:80 [INFO] [stdout] | [INFO] [stdout] 463 | ... self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:475:69 [INFO] [stdout] | [INFO] [stdout] 475 | ... .insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:487:60 [INFO] [stdout] | [INFO] [stdout] 487 | ... .unwrap_or(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:492:61 [INFO] [stdout] | [INFO] [stdout] 492 | ... .insert(finger_down_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `finger_down_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Square` which implements the `Copy` trait [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:500:80 [INFO] [stdout] | [INFO] [stdout] 500 | ... self.redraw_squares.insert(new_square.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `new_square` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/bin/chessmarkable/scene/replay_scene.rs:592:39 [INFO] [stdout] | [INFO] [stdout] 592 | if self.redraw_all_squares || self.redraw_squares.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.redraw_squares.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: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead [INFO] [stdout] --> src/bin/chessmarkable/pgns.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | let ref pgn_loc = crate::CLI_OPTS.pgn_location; [INFO] [stdout] | ----^^^^^^^^^^^-------------------------------- help: try: `let pgn_loc = &crate::CLI_OPTS.pgn_location;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead [INFO] [stdout] --> src/bin/chessmarkable/pgns.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | let ref pgn_loc = crate::CLI_OPTS.pgn_location; [INFO] [stdout] | ----^^^^^^^^^^^-------------------------------- help: try: `let pgn_loc = &crate::CLI_OPTS.pgn_location;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#toplevel_ref_arg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/bin/chessmarkable/pgns.rs:48:26 [INFO] [stdout] | [INFO] [stdout] 48 | Ok(_) => pages = pages + 1, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `pages += 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 37.69s [INFO] running `Command { std: "docker" "inspect" "eb484ee5a47c350b0230d5ea073e81426633bd9c7e4a48932a7d614eed57aee5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "eb484ee5a47c350b0230d5ea073e81426633bd9c7e4a48932a7d614eed57aee5", kill_on_drop: false }` [INFO] [stdout] eb484ee5a47c350b0230d5ea073e81426633bd9c7e4a48932a7d614eed57aee5