[INFO] cloning repository https://github.com/MorrisMing7/rust-chess-bs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/MorrisMing7/rust-chess-bs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FMorrisMing7%2Frust-chess-bs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FMorrisMing7%2Frust-chess-bs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 43fd711dec6fc8c613671166e7dd1a3c22983f96 [INFO] linting MorrisMing7/rust-chess-bs against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FMorrisMing7%2Frust-chess-bs" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/MorrisMing7/rust-chess-bs [INFO] finished tweaking git repo https://github.com/MorrisMing7/rust-chess-bs [INFO] tweaked toml for git repo https://github.com/MorrisMing7/rust-chess-bs written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/MorrisMing7/rust-chess-bs 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/MorrisMing7/rust-chess-bs 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] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded impl-more v0.1.8 [INFO] [stderr] Downloaded unicase v2.8.0 [INFO] [stderr] Downloaded tempfile v3.17.1 [INFO] [stderr] Downloaded cc v1.2.2 [INFO] [stderr] Downloaded tokio v1.41.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] c210f45f54f19f43544e3361feed19cc291354750149f0641f1fb03497838ccc [INFO] running `Command { std: "docker" "start" "-a" "c210f45f54f19f43544e3361feed19cc291354750149f0641f1fb03497838ccc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "c210f45f54f19f43544e3361feed19cc291354750149f0641f1fb03497838ccc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c210f45f54f19f43544e3361feed19cc291354750149f0641f1fb03497838ccc", kill_on_drop: false }` [INFO] [stdout] c210f45f54f19f43544e3361feed19cc291354750149f0641f1fb03497838ccc [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 2ea110093f863cf6a01169b9e66c2330c40b5fb79738ca663ba2fa03844df2f2 [INFO] running `Command { std: "docker" "start" "-a" "2ea110093f863cf6a01169b9e66c2330c40b5fb79738ca663ba2fa03844df2f2", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.167 [INFO] [stderr] Compiling serde v1.0.215 [INFO] [stderr] Compiling stable_deref_trait v1.2.0 [INFO] [stderr] Checking bytes v1.9.0 [INFO] [stderr] Compiling once_cell v1.20.2 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling typenum v1.17.0 [INFO] [stderr] Compiling syn v2.0.90 [INFO] [stderr] Checking litemap v0.7.4 [INFO] [stderr] Compiling writeable v0.5.5 [INFO] [stderr] Compiling smallvec v1.13.2 [INFO] [stderr] Compiling serde_json v1.0.133 [INFO] [stderr] Compiling byteorder v1.5.0 [INFO] [stderr] Checking tracing-core v0.1.33 [INFO] [stderr] Compiling pin-project-lite v0.2.15 [INFO] [stderr] Compiling icu_locid_transform_data v1.5.0 [INFO] [stderr] Compiling icu_properties_data v1.5.0 [INFO] [stderr] Compiling icu_normalizer_data v1.5.0 [INFO] [stderr] Compiling write16 v1.0.0 [INFO] [stderr] Compiling utf16_iter v1.0.5 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling futures-core v0.3.31 [INFO] [stderr] Compiling crossbeam-utils v0.8.20 [INFO] [stderr] Checking hashbrown v0.15.2 [INFO] [stderr] Checking cpufeatures v0.2.16 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Compiling minimal-lexical v0.2.1 [INFO] [stderr] Compiling percent-encoding v2.3.1 [INFO] [stderr] Compiling futures-sink v0.3.31 [INFO] [stderr] Compiling tinyvec v1.9.0 [INFO] [stderr] Compiling slab v0.4.9 [INFO] [stderr] Compiling form_urlencoded v1.2.1 [INFO] [stderr] Compiling getrandom v0.3.3 [INFO] [stderr] Compiling iana-time-zone v0.1.63 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling nom v7.1.3 [INFO] [stderr] Compiling equivalent v1.0.1 [INFO] [stderr] Compiling ryu v1.0.18 [INFO] [stderr] Compiling futures-task v0.3.31 [INFO] [stderr] Compiling rustix v0.38.44 [INFO] [stderr] Compiling futures-io v0.3.31 [INFO] [stderr] Compiling pin-utils v0.1.0 [INFO] [stderr] Compiling crc-catalog v2.4.0 [INFO] [stderr] Compiling itoa v1.0.14 [INFO] [stderr] Compiling unicode_categories v0.1.1 [INFO] [stderr] Compiling bitflags v2.6.0 [INFO] [stderr] Compiling crc v3.3.0 [INFO] [stderr] Checking indexmap v2.7.0 [INFO] [stderr] Compiling crossbeam-queue v0.3.12 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Compiling futures-channel v0.3.31 [INFO] [stderr] Compiling event-listener v2.5.3 [INFO] [stderr] Compiling linux-raw-sys v0.4.15 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Compiling jobserver v0.1.32 [INFO] [stderr] Checking mio v1.0.3 [INFO] [stderr] Checking signal-hook-registry v1.4.2 [INFO] [stderr] Checking socket2 v0.5.8 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Compiling atoi v2.0.0 [INFO] [stderr] Compiling chrono v0.4.41 [INFO] [stderr] Compiling cc v1.2.2 [INFO] [stderr] Compiling unicode-normalization v0.1.24 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling unicode-properties v0.1.3 [INFO] [stderr] Compiling hex v0.4.3 [INFO] [stderr] Compiling crypto-common v0.1.6 [INFO] [stderr] Compiling block-buffer v0.10.4 [INFO] [stderr] Compiling time-macros v0.2.19 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking deranged v0.3.11 [INFO] [stderr] Compiling digest v0.10.7 [INFO] [stderr] Compiling futures-intrusive v0.5.0 [INFO] [stderr] Compiling stringprep v0.1.5 [INFO] [stderr] Checking actix-utils v3.0.1 [INFO] [stderr] Compiling bytestring v1.4.0 [INFO] [stderr] Compiling hmac v0.12.1 [INFO] [stderr] Compiling sha2 v0.10.9 [INFO] [stderr] Compiling md-5 v0.10.6 [INFO] [stderr] Compiling hkdf v0.12.4 [INFO] [stderr] Compiling sqlformat v0.2.6 [INFO] [stderr] Checking actix-service v2.0.2 [INFO] [stderr] Compiling dotenvy v0.15.7 [INFO] [stderr] Compiling whoami v1.6.0 [INFO] [stderr] Compiling fastrand v2.3.0 [INFO] [stderr] Compiling home v0.5.11 [INFO] [stderr] Compiling unicase v2.8.0 [INFO] [stderr] Compiling base64 v0.21.7 [INFO] [stderr] Compiling heck v0.4.1 [INFO] [stderr] Checking flate2 v1.0.35 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Compiling v_htmlescape v0.15.8 [INFO] [stderr] Checking time v0.3.37 [INFO] [stderr] Compiling tempfile v3.17.1 [INFO] [stderr] Checking impl-more v0.1.8 [INFO] [stderr] Checking http-range v0.1.5 [INFO] [stderr] Compiling zstd-sys v2.0.13+zstd.1.5.6 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking cookie v0.16.2 [INFO] [stderr] Compiling synstructure v0.13.1 [INFO] [stderr] Compiling zerovec-derive v0.10.3 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling zerocopy-derive v0.7.35 [INFO] [stderr] Compiling icu_provider_macros v1.5.0 [INFO] [stderr] Compiling serde_derive v1.0.215 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling tokio-macros v2.4.0 [INFO] [stderr] Compiling zerofrom-derive v0.1.5 [INFO] [stderr] Compiling yoke-derive v0.7.5 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling derive_more v0.99.18 [INFO] [stderr] Compiling actix-macros v0.2.4 [INFO] [stderr] Checking tokio v1.41.1 [INFO] [stderr] Checking zerocopy v0.7.35 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Compiling zerofrom v0.1.5 [INFO] [stderr] Compiling ahash v0.8.11 [INFO] [stderr] Compiling ppv-lite86 v0.2.20 [INFO] [stderr] Compiling yoke v0.7.5 [INFO] [stderr] Compiling zstd-safe v7.2.1 [INFO] [stderr] Compiling thiserror v1.0.69 [INFO] [stderr] Compiling zerovec v0.10.4 [INFO] [stderr] Compiling hashbrown v0.14.5 [INFO] [stderr] Compiling rand_chacha v0.3.1 [INFO] [stderr] Compiling hashlink v0.8.4 [INFO] [stderr] Checking zstd v0.13.2 [INFO] [stderr] Compiling rand v0.8.5 [INFO] [stderr] Compiling tinystr v0.7.6 [INFO] [stderr] Compiling icu_collections v1.5.0 [INFO] [stderr] Checking dashmap v6.1.0 [INFO] [stderr] Checking icu_locid v1.5.0 [INFO] [stderr] Checking icu_provider v1.5.0 [INFO] [stderr] Checking icu_locid_transform v1.5.0 [INFO] [stderr] Checking icu_properties v1.5.1 [INFO] [stderr] Compiling either v1.15.0 [INFO] [stderr] Compiling actix-router v0.5.3 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Compiling actix-web-codegen v4.3.0 [INFO] [stderr] Checking tokio-util v0.7.12 [INFO] [stderr] Checking actix-rt v2.10.0 [INFO] [stderr] Checking actix-server v2.5.0 [INFO] [stderr] Checking icu_normalizer v1.5.0 [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking actix-codec v0.5.2 [INFO] [stderr] Checking idna_adapter v1.2.0 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking sqlx-core v0.7.4 [INFO] [stderr] Checking sqlx-postgres v0.7.4 [INFO] [stderr] Checking actix-http v3.9.0 [INFO] [stderr] Checking actix-web v4.9.0 [INFO] [stderr] Compiling sqlx-macros-core v0.7.4 [INFO] [stderr] Checking actix-files v0.6.6 [INFO] [stderr] Compiling sqlx-macros v0.7.4 [INFO] [stderr] Checking sqlx v0.7.4 [INFO] [stderr] Checking chess-rust v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/chess_game.rs:10:20 [INFO] [stdout] | [INFO] [stdout] 10 | fn take_choise(self: &Self, c: impl Choise) -> Self; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 10 - fn take_choise(self: &Self, c: impl Choise) -> Self; [INFO] [stdout] 10 + fn take_choise(&self, c: impl Choise) -> Self; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/chess_game.rs:10:20 [INFO] [stdout] | [INFO] [stdout] 10 | fn take_choise(self: &Self, c: impl Choise) -> Self; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 10 - fn take_choise(self: &Self, c: impl Choise) -> Self; [INFO] [stdout] 10 + fn take_choise(&self, c: impl Choise) -> Self; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/chess_board.rs:57:30 [INFO] [stdout] | [INFO] [stdout] 57 | id.push(('A' as u8 + i as u8) as char); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'A'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/chess_board.rs:64:16 [INFO] [stdout] | [INFO] [stdout] 64 | if let Some(_) = self.pawn_promote { [INFO] [stdout] | -------^^^^^^^-------------------- help: try: `if self.pawn_promote.is_some()` [INFO] [stdout] | [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: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:128:9 [INFO] [stdout] | [INFO] [stdout] 128 | return Ok(b); [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] 128 - return Ok(b); [INFO] [stdout] 128 + Ok(b) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/chess_board.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | if let Some(_) = self.pawn_promote { [INFO] [stdout] | -------^^^^^^^-------------------- help: try: `if self.pawn_promote.is_some()` [INFO] [stdout] | [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 `[[Square; 8]; 8]` which implements the `Copy` trait [INFO] [stdout] --> src/chess_board.rs:75:20 [INFO] [stdout] | [INFO] [stdout] 75 | board: self.board.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.board` [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 `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/chess_board.rs:102:17 [INFO] [stdout] | [INFO] [stdout] 102 | / if from_p.0 == 0 || from_p.0 == 7 { [INFO] [stdout] 103 | | let aoh = if from_p.0 == 0 { 0 } else { 1 }; [INFO] [stdout] 104 | | let bow = if bow { 0 } else { 1 }; [INFO] [stdout] 105 | | b.rook_moved_bow_aoh[bow][aoh] = true; [INFO] [stdout] 106 | | } [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] 101 ~ Square::Piece { name: PIECE_R, bow } [INFO] [stdout] 102 ~ if (from_p.0 == 0 || from_p.0 == 7) => { [INFO] [stdout] 103 | let aoh = if from_p.0 == 0 { 0 } else { 1 }; [INFO] [stdout] 104 | let bow = if bow { 0 } else { 1 }; [INFO] [stdout] 105 | b.rook_moved_bow_aoh[bow][aoh] = true; [INFO] [stdout] 106 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[[Square; 8]; 8]` which implements the `Copy` trait [INFO] [stdout] --> src/chess_board.rs:139:20 [INFO] [stdout] | [INFO] [stdout] 139 | board: self.board.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:236:16 [INFO] [stdout] | [INFO] [stdout] 236 | if tx >= 0 && tx <= 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..=7).contains(&tx)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/chess_board.rs:238:81 [INFO] [stdout] | [INFO] [stdout] 238 | if let Square::Piece { name: _, bow } = self.board[tx as usize][forward_y as usize] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `forward_y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/chess_board.rs:240:46 [INFO] [stdout] | [INFO] [stdout] 240 | v.push((tx as usize, forward_y as usize)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `forward_y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/chess_board.rs:258:17 [INFO] [stdout] | [INFO] [stdout] 258 | / if self.check_point_safe_for_king(1, ty as i8, self_color) [INFO] [stdout] 259 | | && self.check_point_safe_for_king(2, ty as i8, self_color) [INFO] [stdout] 260 | | { [INFO] [stdout] 261 | | v.push((1, ty)); [INFO] [stdout] 262 | | } [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] 257 ~ (false, false, Square::None, Square::None) [INFO] [stdout] 258 | if self.check_point_safe_for_king(1, ty as i8, self_color) [INFO] [stdout] 259 | && self.check_point_safe_for_king(2, ty as i8, self_color) [INFO] [stdout] 260 ~ => { [INFO] [stdout] 261 | v.push((1, ty)); [INFO] [stdout] 262 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/chess_board.rs:256:9 [INFO] [stdout] | [INFO] [stdout] 256 | / match (self.king_moved[bow], self.rook_moved_bow_aoh[bow][0], self.board[1][ty], self.board[2][ty]) { [INFO] [stdout] 257 | | (false, false, Square::None, Square::None) => { [INFO] [stdout] 258 | | if self.check_point_safe_for_king(1, ty as i8, self_color) [INFO] [stdout] 259 | | && self.check_point_safe_for_king(2, ty as i8, self_color) [INFO] [stdout] ... | [INFO] [stdout] 264 | | _ => (), [INFO] [stdout] 265 | | } [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] 256 ~ if let (false, false, Square::None, Square::None) = (self.king_moved[bow], self.rook_moved_bow_aoh[bow][0], self.board[1][ty], self.board[2][ty]) { [INFO] [stdout] 257 + if self.check_point_safe_for_king(1, ty as i8, self_color) [INFO] [stdout] 258 + && self.check_point_safe_for_king(2, ty as i8, self_color) [INFO] [stdout] 259 + { [INFO] [stdout] 260 + v.push((1, ty)); [INFO] [stdout] 261 + } [INFO] [stdout] 262 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/chess_board.rs:272:17 [INFO] [stdout] | [INFO] [stdout] 272 | / if self.check_point_safe_for_king(4, ty as i8, self_color) [INFO] [stdout] 273 | | && self.check_point_safe_for_king(5, ty as i8, self_color) [INFO] [stdout] 274 | | && self.check_point_safe_for_king(6, ty as i8, self_color) [INFO] [stdout] ... | [INFO] [stdout] 277 | | } [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] 271 ~ (false, false, Square::None, Square::None, Square::None) [INFO] [stdout] 272 | if self.check_point_safe_for_king(4, ty as i8, self_color) [INFO] [stdout] 273 | && self.check_point_safe_for_king(5, ty as i8, self_color) [INFO] [stdout] 274 | && self.check_point_safe_for_king(6, ty as i8, self_color) [INFO] [stdout] 275 ~ => { [INFO] [stdout] 276 | v.push((6, ty)); [INFO] [stdout] 277 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/chess_board.rs:267:9 [INFO] [stdout] | [INFO] [stdout] 267 | / match ( [INFO] [stdout] 268 | | self.king_moved[bow], self.rook_moved_bow_aoh[bow][1], self.board[4][ty], self.board[5][ty], [INFO] [stdout] 269 | | self.board[6][ty], [INFO] [stdout] 270 | | ) { [INFO] [stdout] ... | [INFO] [stdout] 279 | | _ => (), [INFO] [stdout] 280 | | } [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] 267 ~ if let (false, false, Square::None, Square::None, Square::None) = ( [INFO] [stdout] 268 + self.king_moved[bow], self.rook_moved_bow_aoh[bow][1], self.board[4][ty], self.board[5][ty], [INFO] [stdout] 269 + self.board[6][ty], [INFO] [stdout] 270 + ) { [INFO] [stdout] 271 + if self.check_point_safe_for_king(4, ty as i8, self_color) [INFO] [stdout] 272 + && self.check_point_safe_for_king(5, ty as i8, self_color) [INFO] [stdout] 273 + && self.check_point_safe_for_king(6, ty as i8, self_color) [INFO] [stdout] 274 + { [INFO] [stdout] 275 + v.push((6, ty)); [INFO] [stdout] 276 + } [INFO] [stdout] 277 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:295:36 [INFO] [stdout] | [INFO] [stdout] 295 | if tx < 0 || tx > 7 || ty < 0 || ty > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&ty)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:295:16 [INFO] [stdout] | [INFO] [stdout] 295 | if tx < 0 || tx > 7 || ty < 0 || ty > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&tx)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] ... | [INFO] [stdout] 321 | | && self.check_for_safe(tx, ty, 0, 1, vec![PIECE_R, PIECE_Q], !self_color, true) [INFO] [stdout] 322 | | && self.check_for_safe(tx, ty, 0, -1, vec![PIECE_R, PIECE_Q], !self_color, true) [INFO] [stdout] | |________________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 0, 1, vec![PIECE_R, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 0, -1, vec![PIECE_R, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] ... | [INFO] [stdout] 321 | | && self.check_for_safe(tx, ty, 0, 1, vec![PIECE_R, PIECE_Q], !self_color, true) [INFO] [stdout] | |_______________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 0, 1, vec![PIECE_R, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 318 | | && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 319 | | && self.check_for_safe(tx, ty, -1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] | |_________________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, -1, vec![PIECE_B, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 318 | | && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] | |________________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] | |________________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] | |_______________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:358:9 [INFO] [stdout] | [INFO] [stdout] 358 | return coor_safe; [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] 358 - return coor_safe; [INFO] [stdout] 358 + coor_safe [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:348:20 [INFO] [stdout] | [INFO] [stdout] 348 | if tx < 0 || tx > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&tx)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:352:43 [INFO] [stdout] | [INFO] [stdout] 352 | if name == PIECE_P && bow == !self_color { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `bow != self_color` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:365:30 [INFO] [stdout] | [INFO] [stdout] 365 | if x < 0 || x > 7 || y > 7 || y < 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:365:12 [INFO] [stdout] | [INFO] [stdout] 365 | if x < 0 || x > 7 || y > 7 || y < 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/chess_board.rs:387:5 [INFO] [stdout] | [INFO] [stdout] 387 | / fn check_for_safe( [INFO] [stdout] 388 | | &self, [INFO] [stdout] 389 | | tx: i8, [INFO] [stdout] 390 | | ty: i8, [INFO] [stdout] ... | [INFO] [stdout] 395 | | recursive: bool, [INFO] [stdout] 396 | | ) -> bool { [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: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:406:13 [INFO] [stdout] | [INFO] [stdout] 406 | return true; [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] 406 - return true; [INFO] [stdout] 406 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:409:17 [INFO] [stdout] | [INFO] [stdout] 409 | return self.check_for_safe(tx, ty, dx, dy, piece_name, enemy_color, recursive); [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] 409 - return self.check_for_safe(tx, ty, dx, dy, piece_name, enemy_color, recursive); [INFO] [stdout] 409 + self.check_for_safe(tx, ty, dx, dy, piece_name, enemy_color, recursive) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:411:17 [INFO] [stdout] | [INFO] [stdout] 411 | return true; [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] 411 - return true; [INFO] [stdout] 411 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:399:32 [INFO] [stdout] | [INFO] [stdout] 399 | if tx < 0 || tx > 7 || ty < 0 || ty > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&ty)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:399:12 [INFO] [stdout] | [INFO] [stdout] 399 | if tx < 0 || tx > 7 || ty < 0 || ty > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&tx)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ChessGame` [INFO] [stdout] --> src/chess_game.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | / pub fn new() -> Self { [INFO] [stdout] 26 | | ChessGame { step: vec![Board::new()] } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 16 + impl Default for ChessGame { [INFO] [stdout] 17 + fn default() -> Self { [INFO] [stdout] 18 + Self::new() [INFO] [stdout] 19 + } [INFO] [stdout] 20 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_game.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | return Ok(t); [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] 40 - return Ok(t); [INFO] [stdout] 40 + Ok(t) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_game.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | return Ok((x, y)); [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] 59 - return Ok((x, y)); [INFO] [stdout] 59 + Ok((x, y)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/chess_game.rs:51:17 [INFO] [stdout] | [INFO] [stdout] 50 | let t = c as usize - b'A' as usize; [INFO] [stdout] | ----------------------------------- unnecessary `let` binding [INFO] [stdout] 51 | t [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 50 ~ [INFO] [stdout] 51 ~ c as usize - b'A' as usize [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/chess_game.rs:83:18 [INFO] [stdout] | [INFO] [stdout] 83 | h8.push(('A' as u8 + x as u8) as char); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'A'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/chess_board.rs:57:30 [INFO] [stdout] | [INFO] [stdout] 57 | id.push(('A' as u8 + i as u8) as char); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'A'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/chess_board.rs:64:16 [INFO] [stdout] | [INFO] [stdout] 64 | if let Some(_) = self.pawn_promote { [INFO] [stdout] | -------^^^^^^^-------------------- help: try: `if self.pawn_promote.is_some()` [INFO] [stdout] | [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: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:128:9 [INFO] [stdout] | [INFO] [stdout] 128 | return Ok(b); [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] 128 - return Ok(b); [INFO] [stdout] 128 + Ok(b) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/chess_board.rs:71:16 [INFO] [stdout] | [INFO] [stdout] 71 | if let Some(_) = self.pawn_promote { [INFO] [stdout] | -------^^^^^^^-------------------- help: try: `if self.pawn_promote.is_some()` [INFO] [stdout] | [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 `[[Square; 8]; 8]` which implements the `Copy` trait [INFO] [stdout] --> src/chess_board.rs:75:20 [INFO] [stdout] | [INFO] [stdout] 75 | board: self.board.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.board` [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 `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/chess_board.rs:102:17 [INFO] [stdout] | [INFO] [stdout] 102 | / if from_p.0 == 0 || from_p.0 == 7 { [INFO] [stdout] 103 | | let aoh = if from_p.0 == 0 { 0 } else { 1 }; [INFO] [stdout] 104 | | let bow = if bow { 0 } else { 1 }; [INFO] [stdout] 105 | | b.rook_moved_bow_aoh[bow][aoh] = true; [INFO] [stdout] 106 | | } [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] 101 ~ Square::Piece { name: PIECE_R, bow } [INFO] [stdout] 102 ~ if (from_p.0 == 0 || from_p.0 == 7) => { [INFO] [stdout] 103 | let aoh = if from_p.0 == 0 { 0 } else { 1 }; [INFO] [stdout] 104 | let bow = if bow { 0 } else { 1 }; [INFO] [stdout] 105 | b.rook_moved_bow_aoh[bow][aoh] = true; [INFO] [stdout] 106 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[[Square; 8]; 8]` which implements the `Copy` trait [INFO] [stdout] --> src/chess_board.rs:139:20 [INFO] [stdout] | [INFO] [stdout] 139 | board: self.board.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:236:16 [INFO] [stdout] | [INFO] [stdout] 236 | if tx >= 0 && tx <= 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: use: `(0..=7).contains(&tx)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/chess_board.rs:238:81 [INFO] [stdout] | [INFO] [stdout] 238 | if let Square::Piece { name: _, bow } = self.board[tx as usize][forward_y as usize] { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `forward_y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/chess_board.rs:240:46 [INFO] [stdout] | [INFO] [stdout] 240 | v.push((tx as usize, forward_y as usize)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `forward_y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/chess_board.rs:258:17 [INFO] [stdout] | [INFO] [stdout] 258 | / if self.check_point_safe_for_king(1, ty as i8, self_color) [INFO] [stdout] 259 | | && self.check_point_safe_for_king(2, ty as i8, self_color) [INFO] [stdout] 260 | | { [INFO] [stdout] 261 | | v.push((1, ty)); [INFO] [stdout] 262 | | } [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] 257 ~ (false, false, Square::None, Square::None) [INFO] [stdout] 258 | if self.check_point_safe_for_king(1, ty as i8, self_color) [INFO] [stdout] 259 | && self.check_point_safe_for_king(2, ty as i8, self_color) [INFO] [stdout] 260 ~ => { [INFO] [stdout] 261 | v.push((1, ty)); [INFO] [stdout] 262 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/chess_board.rs:256:9 [INFO] [stdout] | [INFO] [stdout] 256 | / match (self.king_moved[bow], self.rook_moved_bow_aoh[bow][0], self.board[1][ty], self.board[2][ty]) { [INFO] [stdout] 257 | | (false, false, Square::None, Square::None) => { [INFO] [stdout] 258 | | if self.check_point_safe_for_king(1, ty as i8, self_color) [INFO] [stdout] 259 | | && self.check_point_safe_for_king(2, ty as i8, self_color) [INFO] [stdout] ... | [INFO] [stdout] 264 | | _ => (), [INFO] [stdout] 265 | | } [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] 256 ~ if let (false, false, Square::None, Square::None) = (self.king_moved[bow], self.rook_moved_bow_aoh[bow][0], self.board[1][ty], self.board[2][ty]) { [INFO] [stdout] 257 + if self.check_point_safe_for_king(1, ty as i8, self_color) [INFO] [stdout] 258 + && self.check_point_safe_for_king(2, ty as i8, self_color) [INFO] [stdout] 259 + { [INFO] [stdout] 260 + v.push((1, ty)); [INFO] [stdout] 261 + } [INFO] [stdout] 262 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/chess_board.rs:272:17 [INFO] [stdout] | [INFO] [stdout] 272 | / if self.check_point_safe_for_king(4, ty as i8, self_color) [INFO] [stdout] 273 | | && self.check_point_safe_for_king(5, ty as i8, self_color) [INFO] [stdout] 274 | | && self.check_point_safe_for_king(6, ty as i8, self_color) [INFO] [stdout] ... | [INFO] [stdout] 277 | | } [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] 271 ~ (false, false, Square::None, Square::None, Square::None) [INFO] [stdout] 272 | if self.check_point_safe_for_king(4, ty as i8, self_color) [INFO] [stdout] 273 | && self.check_point_safe_for_king(5, ty as i8, self_color) [INFO] [stdout] 274 | && self.check_point_safe_for_king(6, ty as i8, self_color) [INFO] [stdout] 275 ~ => { [INFO] [stdout] 276 | v.push((6, ty)); [INFO] [stdout] 277 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/chess_board.rs:267:9 [INFO] [stdout] | [INFO] [stdout] 267 | / match ( [INFO] [stdout] 268 | | self.king_moved[bow], self.rook_moved_bow_aoh[bow][1], self.board[4][ty], self.board[5][ty], [INFO] [stdout] 269 | | self.board[6][ty], [INFO] [stdout] 270 | | ) { [INFO] [stdout] ... | [INFO] [stdout] 279 | | _ => (), [INFO] [stdout] 280 | | } [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] 267 ~ if let (false, false, Square::None, Square::None, Square::None) = ( [INFO] [stdout] 268 + self.king_moved[bow], self.rook_moved_bow_aoh[bow][1], self.board[4][ty], self.board[5][ty], [INFO] [stdout] 269 + self.board[6][ty], [INFO] [stdout] 270 + ) { [INFO] [stdout] 271 + if self.check_point_safe_for_king(4, ty as i8, self_color) [INFO] [stdout] 272 + && self.check_point_safe_for_king(5, ty as i8, self_color) [INFO] [stdout] 273 + && self.check_point_safe_for_king(6, ty as i8, self_color) [INFO] [stdout] 274 + { [INFO] [stdout] 275 + v.push((6, ty)); [INFO] [stdout] 276 + } [INFO] [stdout] 277 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:295:36 [INFO] [stdout] | [INFO] [stdout] 295 | if tx < 0 || tx > 7 || ty < 0 || ty > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&ty)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:295:16 [INFO] [stdout] | [INFO] [stdout] 295 | if tx < 0 || tx > 7 || ty < 0 || ty > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&tx)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] ... | [INFO] [stdout] 321 | | && self.check_for_safe(tx, ty, 0, 1, vec![PIECE_R, PIECE_Q], !self_color, true) [INFO] [stdout] 322 | | && self.check_for_safe(tx, ty, 0, -1, vec![PIECE_R, PIECE_Q], !self_color, true) [INFO] [stdout] | |________________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 0, 1, vec![PIECE_R, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 0, -1, vec![PIECE_R, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] ... | [INFO] [stdout] 321 | | && self.check_for_safe(tx, ty, 0, 1, vec![PIECE_R, PIECE_Q], !self_color, true) [INFO] [stdout] | |_______________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 0, 1, vec![PIECE_R, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 318 | | && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 319 | | && self.check_for_safe(tx, ty, -1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] | |_________________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, -1, vec![PIECE_B, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 318 | | && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] | |________________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, -1, 1, vec![PIECE_B, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] 317 | | && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] | |________________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) && self.check_for_safe(tx, ty, 1, -1, vec![PIECE_B, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:314:35 [INFO] [stdout] | [INFO] [stdout] 314 | let mut coor_safe: bool = true [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 315 | | //B [INFO] [stdout] 316 | | && self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true) [INFO] [stdout] | |_______________________________________________________________________________________^ help: try: `self.check_for_safe(tx, ty, 1, 1, vec![PIECE_B, PIECE_Q], !self_color, true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:358:9 [INFO] [stdout] | [INFO] [stdout] 358 | return coor_safe; [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] 358 - return coor_safe; [INFO] [stdout] 358 + coor_safe [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:348:20 [INFO] [stdout] | [INFO] [stdout] 348 | if tx < 0 || tx > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&tx)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/chess_board.rs:352:43 [INFO] [stdout] | [INFO] [stdout] 352 | if name == PIECE_P && bow == !self_color { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `bow != self_color` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:365:30 [INFO] [stdout] | [INFO] [stdout] 365 | if x < 0 || x > 7 || y > 7 || y < 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:365:12 [INFO] [stdout] | [INFO] [stdout] 365 | if x < 0 || x > 7 || y > 7 || y < 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/chess_board.rs:387:5 [INFO] [stdout] | [INFO] [stdout] 387 | / fn check_for_safe( [INFO] [stdout] 388 | | &self, [INFO] [stdout] 389 | | tx: i8, [INFO] [stdout] 390 | | ty: i8, [INFO] [stdout] ... | [INFO] [stdout] 395 | | recursive: bool, [INFO] [stdout] 396 | | ) -> bool { [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: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:406:13 [INFO] [stdout] | [INFO] [stdout] 406 | return true; [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] 406 - return true; [INFO] [stdout] 406 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:409:17 [INFO] [stdout] | [INFO] [stdout] 409 | return self.check_for_safe(tx, ty, dx, dy, piece_name, enemy_color, recursive); [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] 409 - return self.check_for_safe(tx, ty, dx, dy, piece_name, enemy_color, recursive); [INFO] [stdout] 409 + self.check_for_safe(tx, ty, dx, dy, piece_name, enemy_color, recursive) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_board.rs:411:17 [INFO] [stdout] | [INFO] [stdout] 411 | return true; [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] 411 - return true; [INFO] [stdout] 411 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:399:32 [INFO] [stdout] | [INFO] [stdout] 399 | if tx < 0 || tx > 7 || ty < 0 || ty > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&ty)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/chess_board.rs:399:12 [INFO] [stdout] | [INFO] [stdout] 399 | if tx < 0 || tx > 7 || ty < 0 || ty > 7 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `!(0..=7).contains(&tx)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ChessGame` [INFO] [stdout] --> src/chess_game.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | / pub fn new() -> Self { [INFO] [stdout] 26 | | ChessGame { step: vec![Board::new()] } [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 16 + impl Default for ChessGame { [INFO] [stdout] 17 + fn default() -> Self { [INFO] [stdout] 18 + Self::new() [INFO] [stdout] 19 + } [INFO] [stdout] 20 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_game.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | return Ok(t); [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] 40 - return Ok(t); [INFO] [stdout] 40 + Ok(t) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/chess_game.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | return Ok((x, y)); [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] 59 - return Ok((x, y)); [INFO] [stdout] 59 + Ok((x, y)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/chess_game.rs:51:17 [INFO] [stdout] | [INFO] [stdout] 50 | let t = c as usize - b'A' as usize; [INFO] [stdout] | ----------------------------------- unnecessary `let` binding [INFO] [stdout] 51 | t [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 50 ~ [INFO] [stdout] 51 ~ c as usize - b'A' as usize [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/chess_game.rs:83:18 [INFO] [stdout] | [INFO] [stdout] 83 | h8.push(('A' as u8 + x as u8) as char); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'A'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:23:22 [INFO] [stdout] | [INFO] [stdout] 23 | Ok(t) => return web::Json(BaseResp::new(t)), [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] 23 ~ Ok(t) => web::Json(BaseResp::new(t)), [INFO] [stdout] 24 | Err(e) => return web::Json(BaseResp::error("400".to_string(), e)), [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | Err(e) => return web::Json(BaseResp::error("400".to_string(), e)), [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] 24 ~ Err(e) => web::Json(BaseResp::error("400".to_string(), e)), [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [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] 28 - return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [INFO] [stdout] 28 + web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:37:22 [INFO] [stdout] | [INFO] [stdout] 37 | Ok(t) => return web::Json(BaseResp::new(t)), [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] 37 ~ Ok(t) => web::Json(BaseResp::new(t)), [INFO] [stdout] 38 | Err(e) => return web::Json(BaseResp::error("400".to_string(), e)), [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:38:23 [INFO] [stdout] | [INFO] [stdout] 38 | Err(e) => return web::Json(BaseResp::error("400".to_string(), e)), [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] 38 ~ Err(e) => web::Json(BaseResp::error("400".to_string(), e)), [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [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] 41 - return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [INFO] [stdout] 41 + web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:50:22 [INFO] [stdout] | [INFO] [stdout] 50 | Ok(t) => return web::Json(BaseResp::new(t)), [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] 50 ~ Ok(t) => web::Json(BaseResp::new(t)), [INFO] [stdout] 51 | Err(_) => todo!(), [INFO] [stdout] 52 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [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] 54 - return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [INFO] [stdout] 54 + web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `t2` is never read [INFO] [stdout] --> src/main.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | t2[0][1] = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:23:22 [INFO] [stdout] | [INFO] [stdout] 23 | Ok(t) => return web::Json(BaseResp::new(t)), [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] 23 ~ Ok(t) => web::Json(BaseResp::new(t)), [INFO] [stdout] 24 | Err(e) => return web::Json(BaseResp::error("400".to_string(), e)), [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:24:23 [INFO] [stdout] | [INFO] [stdout] 24 | Err(e) => return web::Json(BaseResp::error("400".to_string(), e)), [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] 24 ~ Err(e) => web::Json(BaseResp::error("400".to_string(), e)), [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [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] 28 - return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [INFO] [stdout] 28 + web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:37:22 [INFO] [stdout] | [INFO] [stdout] 37 | Ok(t) => return web::Json(BaseResp::new(t)), [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] 37 ~ Ok(t) => web::Json(BaseResp::new(t)), [INFO] [stdout] 38 | Err(e) => return web::Json(BaseResp::error("400".to_string(), e)), [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:38:23 [INFO] [stdout] | [INFO] [stdout] 38 | Err(e) => return web::Json(BaseResp::error("400".to_string(), e)), [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] 38 ~ Err(e) => web::Json(BaseResp::error("400".to_string(), e)), [INFO] [stdout] 39 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [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] 41 - return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [INFO] [stdout] 41 + web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:50:22 [INFO] [stdout] | [INFO] [stdout] 50 | Ok(t) => return web::Json(BaseResp::new(t)), [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] 50 ~ Ok(t) => web::Json(BaseResp::new(t)), [INFO] [stdout] 51 | Err(_) => todo!(), [INFO] [stdout] 52 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/handlers/game.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [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] 54 - return web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())); [INFO] [stdout] 54 + web::Json(BaseResp::error("400".to_string(), "无此对局".to_string())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 25s [INFO] [stderr] warning: the following packages contain code that will be rejected by a future version of Rust: sqlx-postgres v0.7.4 [INFO] [stderr] note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 2` [INFO] running `Command { std: "docker" "inspect" "2ea110093f863cf6a01169b9e66c2330c40b5fb79738ca663ba2fa03844df2f2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2ea110093f863cf6a01169b9e66c2330c40b5fb79738ca663ba2fa03844df2f2", kill_on_drop: false }` [INFO] [stdout] 2ea110093f863cf6a01169b9e66c2330c40b5fb79738ca663ba2fa03844df2f2