[INFO] cloning repository https://github.com/craigfay/chess-engine [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/craigfay/chess-engine" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcraigfay%2Fchess-engine", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcraigfay%2Fchess-engine'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] bf8ff59865be685d7099a83e795110d1de1d1e23 [INFO] linting craigfay/chess-engine against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcraigfay%2Fchess-engine" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/craigfay/chess-engine [INFO] finished tweaking git repo https://github.com/craigfay/chess-engine [INFO] tweaked toml for git repo https://github.com/craigfay/chess-engine written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/craigfay/chess-engine 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/craigfay/chess-engine 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 9a69974e711709223b4060139836b199c56a5054b88136dad42f372ad8c4f1b2 [INFO] running `Command { std: "docker" "start" "-a" "9a69974e711709223b4060139836b199c56a5054b88136dad42f372ad8c4f1b2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "9a69974e711709223b4060139836b199c56a5054b88136dad42f372ad8c4f1b2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9a69974e711709223b4060139836b199c56a5054b88136dad42f372ad8c4f1b2", kill_on_drop: false }` [INFO] [stdout] 9a69974e711709223b4060139836b199c56a5054b88136dad42f372ad8c4f1b2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 164d3930f21571fae1091853451d94b28303dbd7c00dc7f0daff83b4558f3dcf [INFO] running `Command { std: "docker" "start" "-a" "164d3930f21571fae1091853451d94b28303dbd7c00dc7f0daff83b4558f3dcf", kill_on_drop: false }` [INFO] [stderr] Checking chess-engine v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `Color` [INFO] [stdout] --> src/actions.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | Color, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `legal_actions` and `legal_next_states` [INFO] [stdout] --> src/actions.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | legal_actions, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 25 | legal_next_states, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::gamestate::GameState` [INFO] [stdout] --> src/pieces.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use crate::gamestate::GameState; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Piece` [INFO] [stdout] --> src/utilities.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | Piece, [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `color_is_checked`, `color_threatens_square`, `diagonal_path_is_obstructed`, `is_checkmate`, `is_stalemate`, `legal_actions`, and `position_delta` [INFO] [stdout] --> src/tests.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | color_threatens_square, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 4 | color_is_checked, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 5 | position_delta, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] 6 | legal_actions, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 7 | is_checkmate, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 8 | is_stalemate, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 9 | diagonal_path_is_obstructed, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module [INFO] [stdout] --> src/lib.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | mod tests; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Action`, `Capture`, `Castle`, `EnPassant`, `Kingside`, `Move`, `Promotion`, and `Queenside` [INFO] [stdout] --> src/tests.rs:13:5 [INFO] [stdout] | [INFO] [stdout] 13 | Action, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 14 | Move, [INFO] [stdout] | ^^^^ [INFO] [stdout] 15 | Capture, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 16 | Promotion, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 17 | Castle, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 18 | CastleDirection::{Kingside, Queenside}, [INFO] [stdout] | ^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] 19 | EnPassant, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module [INFO] [stdout] --> src/lib.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | mod tests; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `GameState` and `Placement` [INFO] [stdout] --> src/tests.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 23 | GameState, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 24 | Placement, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module [INFO] [stdout] --> src/lib.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | mod tests; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Bishop`, `Black`, `King`, `Knight`, `Pawn`, `Piece`, `Queen`, `Rook`, and `White` [INFO] [stdout] --> src/tests.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | Piece, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 29 | PieceName::{ [INFO] [stdout] 30 | Pawn, [INFO] [stdout] | ^^^^ [INFO] [stdout] 31 | Rook, [INFO] [stdout] | ^^^^ [INFO] [stdout] 32 | Bishop, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 33 | Knight, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 34 | Queen, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 35 | King, [INFO] [stdout] | ^^^^ [INFO] [stdout] 36 | }, [INFO] [stdout] 37 | Color::{White, Black}, [INFO] [stdout] | ^^^^^ ^^^^^ [INFO] [stdout] | [INFO] [stdout] help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module [INFO] [stdout] --> src/lib.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | mod tests; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `fen_notation`, `square_algebraic_to_index`, and `square_index_to_algebraic` [INFO] [stdout] --> src/tests.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | square_index_to_algebraic, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 42 | square_algebraic_to_index, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 43 | fen_notation, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module [INFO] [stdout] --> src/lib.rs:7:1 [INFO] [stdout] | [INFO] [stdout] 7 | mod tests; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | let mut origin_rank = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | let mut origin_file = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `delta_x` [INFO] [stdout] --> src/actions.rs:149:14 [INFO] [stdout] | [INFO] [stdout] 149 | let (delta_x, delta_y) = position_delta(self.from, self.to); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_delta_x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:197:13 [INFO] [stdout] | [INFO] [stdout] 197 | let mut origin_rank = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:198:13 [INFO] [stdout] | [INFO] [stdout] 198 | let mut origin_file = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `delta_x` [INFO] [stdout] --> src/actions.rs:271:14 [INFO] [stdout] | [INFO] [stdout] 271 | let (delta_x, delta_y) = position_delta(self.with, self.on); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_delta_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `delta_y` [INFO] [stdout] --> src/actions.rs:271:23 [INFO] [stdout] | [INFO] [stdout] 271 | let (delta_x, delta_y) = position_delta(self.with, self.on); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_delta_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:297:13 [INFO] [stdout] | [INFO] [stdout] 297 | let mut origin_file = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:524:13 [INFO] [stdout] | [INFO] [stdout] 524 | let mut origin_file = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:525:13 [INFO] [stdout] | [INFO] [stdout] 525 | let mut capture_indicator = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:90:27 [INFO] [stdout] | [INFO] [stdout] 90 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:100:63 [INFO] [stdout] | [INFO] [stdout] 100 | let ambiguity = disambiguate_move(self.from, self.to, &state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/actions.rs:109:9 [INFO] [stdout] | [INFO] [stdout] 109 | / String::from(format!( [INFO] [stdout] 110 | | "{}{}{}{}{}", [INFO] [stdout] 111 | | piece_str, [INFO] [stdout] 112 | | origin_file, [INFO] [stdout] ... | [INFO] [stdout] 115 | | destination_rank, [INFO] [stdout] 116 | | )) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `String::from()` [INFO] [stdout] | [INFO] [stdout] 109 ~ format!( [INFO] [stdout] 110 + "{}{}{}{}{}", [INFO] [stdout] 111 + piece_str, [INFO] [stdout] 112 + origin_file, [INFO] [stdout] 113 + origin_rank, [INFO] [stdout] 114 + destination_file, [INFO] [stdout] 115 + destination_rank, [INFO] [stdout] 116 + ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:137:54 [INFO] [stdout] | [INFO] [stdout] 137 | if !move_is_pseudo_legal(self.from, self.to, &state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:141:56 [INFO] [stdout] | [INFO] [stdout] 141 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:148:29 [INFO] [stdout] | [INFO] [stdout] 148 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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` statement can be collapsed [INFO] [stdout] --> src/actions.rs:158:9 [INFO] [stdout] | [INFO] [stdout] 158 | / if piece.name == Pawn { [INFO] [stdout] 159 | | if delta_y.abs() == 2 { [INFO] [stdout] 160 | | match state.squares[self.from] { [INFO] [stdout] 161 | | None => (), [INFO] [stdout] ... | [INFO] [stdout] 170 | | } [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] 158 ~ if piece.name == Pawn [INFO] [stdout] 159 ~ && delta_y.abs() == 2 { [INFO] [stdout] 160 | match state.squares[self.from] { [INFO] [stdout] ... [INFO] [stdout] 168 | } [INFO] [stdout] 169 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:192:27 [INFO] [stdout] | [INFO] [stdout] 192 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:202:66 [INFO] [stdout] | [INFO] [stdout] 202 | let ambiguity = disambiguate_capture(self.with, self.on, &state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: comparison to empty slice [INFO] [stdout] --> src/actions.rs:207:12 [INFO] [stdout] | [INFO] [stdout] 207 | if piece_str == "" || ambiguity.file_is_ambiguous { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `piece_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/actions.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 211 | / String::from(format!( [INFO] [stdout] 212 | | "{}{}{}x{}{}", [INFO] [stdout] 213 | | piece_str, [INFO] [stdout] 214 | | origin_file, [INFO] [stdout] ... | [INFO] [stdout] 217 | | destination_rank, [INFO] [stdout] 218 | | )) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `String::from()` [INFO] [stdout] | [INFO] [stdout] 211 ~ format!( [INFO] [stdout] 212 + "{}{}{}x{}{}", [INFO] [stdout] 213 + piece_str, [INFO] [stdout] 214 + origin_file, [INFO] [stdout] 215 + origin_rank, [INFO] [stdout] 216 + destination_file, [INFO] [stdout] 217 + destination_rank, [INFO] [stdout] 218 + ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:259:54 [INFO] [stdout] | [INFO] [stdout] 259 | if !move_is_pseudo_legal(self.with, self.on, &state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:263:56 [INFO] [stdout] | [INFO] [stdout] 263 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:270:29 [INFO] [stdout] | [INFO] [stdout] 270 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:293:27 [INFO] [stdout] | [INFO] [stdout] 293 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/actions.rs:303:9 [INFO] [stdout] | [INFO] [stdout] 303 | / String::from(format!( [INFO] [stdout] 304 | | "{}x{}{}", [INFO] [stdout] 305 | | origin_file, [INFO] [stdout] 306 | | destination_file, [INFO] [stdout] 307 | | destination_rank, [INFO] [stdout] 308 | | )) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `String::from()` [INFO] [stdout] | [INFO] [stdout] 303 ~ format!( [INFO] [stdout] 304 + "{}x{}{}", [INFO] [stdout] 305 + origin_file, [INFO] [stdout] 306 + destination_file, [INFO] [stdout] 307 + destination_rank, [INFO] [stdout] 308 + ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/actions.rs:313:12 [INFO] [stdout] | [INFO] [stdout] 313 | if !state.en_passant_square.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.en_passant_square.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: this boolean expression can be simplified [INFO] [stdout] --> src/actions.rs:318:12 [INFO] [stdout] | [INFO] [stdout] 318 | if !state.squares[self.with].is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.squares[self.with].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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:351:56 [INFO] [stdout] | [INFO] [stdout] 351 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:358:29 [INFO] [stdout] | [INFO] [stdout] 358 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:394:27 [INFO] [stdout] | [INFO] [stdout] 394 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/actions.rs:418:18 [INFO] [stdout] | [INFO] [stdout] 418 | 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] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 418 - return true [INFO] [stdout] 418 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/actions.rs:432:17 [INFO] [stdout] | [INFO] [stdout] 432 | 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] 432 - return true [INFO] [stdout] 432 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/actions.rs:444:17 [INFO] [stdout] | [INFO] [stdout] 444 | 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] 444 - return true [INFO] [stdout] 444 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/actions.rs:458:17 [INFO] [stdout] | [INFO] [stdout] 458 | 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] 458 - return true [INFO] [stdout] 458 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:404:56 [INFO] [stdout] | [INFO] [stdout] 404 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:410:47 [INFO] [stdout] | [INFO] [stdout] 410 | if !piece_is(White, King, 4, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:411:47 [INFO] [stdout] | [INFO] [stdout] 411 | if !piece_is(White, Rook, 7, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:414:54 [INFO] [stdout] | [INFO] [stdout] 414 | if color_threatens_square(Black, 4, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:415:54 [INFO] [stdout] | [INFO] [stdout] 415 | if color_threatens_square(Black, 5, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:416:54 [INFO] [stdout] | [INFO] [stdout] 416 | if color_threatens_square(Black, 6, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:417:54 [INFO] [stdout] | [INFO] [stdout] 417 | if color_threatens_square(Black, 7, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:422:46 [INFO] [stdout] | [INFO] [stdout] 422 | if !piece_is(White, King, 4, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:423:46 [INFO] [stdout] | [INFO] [stdout] 423 | if !piece_is(White, Rook, 0, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:427:53 [INFO] [stdout] | [INFO] [stdout] 427 | if color_threatens_square(Black, 0, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:428:53 [INFO] [stdout] | [INFO] [stdout] 428 | if color_threatens_square(Black, 1, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:429:53 [INFO] [stdout] | [INFO] [stdout] 429 | if color_threatens_square(Black, 2, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:430:53 [INFO] [stdout] | [INFO] [stdout] 430 | if color_threatens_square(Black, 3, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:431:53 [INFO] [stdout] | [INFO] [stdout] 431 | if color_threatens_square(Black, 4, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:436:47 [INFO] [stdout] | [INFO] [stdout] 436 | if !piece_is(Black, King, 60, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:437:47 [INFO] [stdout] | [INFO] [stdout] 437 | if !piece_is(Black, Rook, 63, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:440:54 [INFO] [stdout] | [INFO] [stdout] 440 | if color_threatens_square(White, 60, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:441:54 [INFO] [stdout] | [INFO] [stdout] 441 | if color_threatens_square(White, 61, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:442:54 [INFO] [stdout] | [INFO] [stdout] 442 | if color_threatens_square(White, 62, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:443:54 [INFO] [stdout] | [INFO] [stdout] 443 | if color_threatens_square(White, 63, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:448:47 [INFO] [stdout] | [INFO] [stdout] 448 | if !piece_is(Black, King, 60, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:449:47 [INFO] [stdout] | [INFO] [stdout] 449 | if !piece_is(Black, Rook, 56, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: unused import: `Color` [INFO] [stdout] --> src/actions.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | Color, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `legal_actions` and `legal_next_states` [INFO] [stdout] --> src/actions.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | legal_actions, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] 25 | legal_next_states, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:453:54 [INFO] [stdout] | [INFO] [stdout] 453 | if color_threatens_square(White, 56, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:454:54 [INFO] [stdout] | [INFO] [stdout] 454 | if color_threatens_square(White, 57, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:455:54 [INFO] [stdout] | [INFO] [stdout] 455 | if color_threatens_square(White, 58, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:456:54 [INFO] [stdout] | [INFO] [stdout] 456 | if color_threatens_square(White, 59, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:457:54 [INFO] [stdout] | [INFO] [stdout] 457 | if color_threatens_square(White, 60, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:463:29 [INFO] [stdout] | [INFO] [stdout] 463 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:513:27 [INFO] [stdout] | [INFO] [stdout] 513 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/actions.rs:537:9 [INFO] [stdout] | [INFO] [stdout] 537 | / String::from(format!( [INFO] [stdout] 538 | | "{}{}{}{}{}", [INFO] [stdout] 539 | | origin_file, [INFO] [stdout] 540 | | capture_indicator, [INFO] [stdout] ... | [INFO] [stdout] 543 | | new_piece_str, [INFO] [stdout] 544 | | )) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `String::from()` [INFO] [stdout] | [INFO] [stdout] 537 ~ format!( [INFO] [stdout] 538 + "{}{}{}{}{}", [INFO] [stdout] 539 + origin_file, [INFO] [stdout] 540 + capture_indicator, [INFO] [stdout] 541 + destination_file, [INFO] [stdout] 542 + destination_rank, [INFO] [stdout] 543 + new_piece_str, [INFO] [stdout] 544 + ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::gamestate::GameState` [INFO] [stdout] --> src/pieces.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use crate::gamestate::GameState; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:552:56 [INFO] [stdout] | [INFO] [stdout] 552 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:585:29 [INFO] [stdout] | [INFO] [stdout] 585 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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: unused import: `Piece` [INFO] [stdout] --> src/utilities.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | Piece, [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/actions.rs:610:5 [INFO] [stdout] | [INFO] [stdout] 610 | / match piece { [INFO] [stdout] 611 | | Bishop => true, [INFO] [stdout] 612 | | Knight => true, [INFO] [stdout] 613 | | Rook => true, [INFO] [stdout] 614 | | Queen => true, [INFO] [stdout] 615 | | _ => false, [INFO] [stdout] 616 | | } [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] 610 - match piece { [INFO] [stdout] 611 - Bishop => true, [INFO] [stdout] 612 - Knight => true, [INFO] [stdout] 613 - Rook => true, [INFO] [stdout] 614 - Queen => true, [INFO] [stdout] 615 - _ => false, [INFO] [stdout] 616 - } [INFO] [stdout] 610 + matches!(piece, Bishop | Knight | Rook | Queen) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:638:36 [INFO] [stdout] | [INFO] [stdout] 638 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: unused import: `Piece` [INFO] [stdout] --> src/tests.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 28 | Piece, [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `square_index_to_algebraic` [INFO] [stdout] --> src/tests.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | square_index_to_algebraic, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:667:36 [INFO] [stdout] | [INFO] [stdout] 667 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/actions.rs:698:22 [INFO] [stdout] | [INFO] [stdout] 698 | White => match origin { [INFO] [stdout] | ______________________^ [INFO] [stdout] 699 | | 4 => { [INFO] [stdout] 700 | | state.white_can_castle_queenside = false; [INFO] [stdout] 701 | | state.white_can_castle_kingside = false; [INFO] [stdout] 702 | | }, [INFO] [stdout] 703 | | _ => (), [INFO] [stdout] 704 | | }, [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] 698 ~ White => if origin == 4 { [INFO] [stdout] 699 + state.white_can_castle_queenside = false; [INFO] [stdout] 700 + state.white_can_castle_kingside = false; [INFO] [stdout] 701 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/actions.rs:705:22 [INFO] [stdout] | [INFO] [stdout] 705 | Black => match origin { [INFO] [stdout] | ______________________^ [INFO] [stdout] 706 | | 60 => { [INFO] [stdout] 707 | | state.black_can_castle_queenside = false; [INFO] [stdout] 708 | | state.black_can_castle_kingside = false; [INFO] [stdout] 709 | | }, [INFO] [stdout] 710 | | _ => (), [INFO] [stdout] 711 | | } [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] 705 ~ Black => if origin == 60 { [INFO] [stdout] 706 + state.black_can_castle_queenside = false; [INFO] [stdout] 707 + state.black_can_castle_kingside = false; [INFO] [stdout] 708 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/pieces.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | / impl ToString for Piece { [INFO] [stdout] 43 | | fn to_string(&self) -> String { [INFO] [stdout] 44 | | match self.name { [INFO] [stdout] 45 | | PieceName::Pawn => String::from(""), [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/notation.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | String::from(format!("{}{}", rank, file)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", rank, file)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:101:5 [INFO] [stdout] | [INFO] [stdout] 101 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:116:5 [INFO] [stdout] | [INFO] [stdout] 116 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `GameState` [INFO] [stdout] --> src/gamestate.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 47 | / pub fn new() -> GameState { [INFO] [stdout] 48 | | let mut state = GameState::with_placements(vec![ [INFO] [stdout] 49 | | Placement::new(Color::White, PieceName::Rook, 0), [INFO] [stdout] 50 | | Placement::new(Color::White, PieceName::Knight, 1), [INFO] [stdout] ... | [INFO] [stdout] 93 | | state [INFO] [stdout] 94 | | } [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] 19 + impl Default for GameState { [INFO] [stdout] 20 + fn default() -> Self { [INFO] [stdout] 21 + Self::new() [INFO] [stdout] 22 + } [INFO] [stdout] 23 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamestate.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | 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] 29 - return true; [INFO] [stdout] 29 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/gamestate.rs:110:1 [INFO] [stdout] | [INFO] [stdout] 110 | / impl ToString for GameState { [INFO] [stdout] 111 | | // Create a human readable gamestate string [INFO] [stdout] 112 | | fn to_string(&self) -> String { [INFO] [stdout] 113 | | let mut output = String::with_capacity(136); [INFO] [stdout] ... | [INFO] [stdout] 143 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/gamestate.rs:137:17 [INFO] [stdout] | [INFO] [stdout] 137 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/gamestate.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | output.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.push('\n')` [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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:31:54 [INFO] [stdout] | [INFO] [stdout] 31 | let is_checked = color_is_checked(state.to_move, &state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:32:33 [INFO] [stdout] | [INFO] [stdout] 32 | let actions = legal_actions(&state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utilities.rs:33:19 [INFO] [stdout] | [INFO] [stdout] 33 | is_checked && actions.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `actions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:37:54 [INFO] [stdout] | [INFO] [stdout] 37 | let is_checked = color_is_checked(state.to_move, &state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:38:33 [INFO] [stdout] | [INFO] [stdout] 38 | let actions = legal_actions(&state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utilities.rs:39:20 [INFO] [stdout] | [INFO] [stdout] 39 | !is_checked && actions.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `actions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:58:55 [INFO] [stdout] | [INFO] [stdout] 58 | if move_is_pseudo_legal(m.from, m.to, &state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utilities.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 85 | if !king_square.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `king_square.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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:91:60 [INFO] [stdout] | [INFO] [stdout] 91 | color_threatens_square(attacker, king_square.unwrap(), &state) [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:97:32 [INFO] [stdout] | [INFO] [stdout] 97 | for action in legal_moves(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:98:35 [INFO] [stdout] | [INFO] [stdout] 98 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:100:35 [INFO] [stdout] | [INFO] [stdout] 100 | for action in legal_captures(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:101:35 [INFO] [stdout] | [INFO] [stdout] 101 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:103:38 [INFO] [stdout] | [INFO] [stdout] 103 | for action in legal_en_passants(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:104:35 [INFO] [stdout] | [INFO] [stdout] 104 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:106:33 [INFO] [stdout] | [INFO] [stdout] 106 | for action in legal_castles(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:107:35 [INFO] [stdout] | [INFO] [stdout] 107 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:109:36 [INFO] [stdout] | [INFO] [stdout] 109 | for action in legal_promotions(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:110:35 [INFO] [stdout] | [INFO] [stdout] 110 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:119:32 [INFO] [stdout] | [INFO] [stdout] 119 | for action in legal_moves(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:122:34 [INFO] [stdout] | [INFO] [stdout] 122 | for action in legal_captures(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:125:38 [INFO] [stdout] | [INFO] [stdout] 125 | for action in legal_en_passants(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:128:33 [INFO] [stdout] | [INFO] [stdout] 128 | for action in legal_castles(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:131:36 [INFO] [stdout] | [INFO] [stdout] 131 | for action in legal_promotions(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:141:5 [INFO] [stdout] | [INFO] [stdout] 141 | return (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] 141 - return (x, y); [INFO] [stdout] 141 + (x, y) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utilities.rs:180:8 [INFO] [stdout] | [INFO] [stdout] 180 | if !state.en_passant_square.is_some() { return results } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.en_passant_square.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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:185:24 [INFO] [stdout] | [INFO] [stdout] 185 | if action.is_legal(&state) { results.push(action); } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:188:24 [INFO] [stdout] | [INFO] [stdout] 188 | if action.is_legal(&state) { results.push(action); } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:191:24 [INFO] [stdout] | [INFO] [stdout] 191 | if action.is_legal(&state) { results.push(action); } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:194:24 [INFO] [stdout] | [INFO] [stdout] 194 | if action.is_legal(&state) { results.push(action); } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:208:40 [INFO] [stdout] | [INFO] [stdout] 208 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:228:40 [INFO] [stdout] | [INFO] [stdout] 228 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:242:24 [INFO] [stdout] | [INFO] [stdout] 242 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:246:24 [INFO] [stdout] | [INFO] [stdout] 246 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:264:36 [INFO] [stdout] | [INFO] [stdout] 264 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:278:36 [INFO] [stdout] | [INFO] [stdout] 278 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utilities.rs:291:8 [INFO] [stdout] | [INFO] [stdout] 291 | if !state.squares[origin].is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.squares[origin].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] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/utilities.rs:378:12 [INFO] [stdout] | [INFO] [stdout] 378 | if (hi - low) % n == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace with: `(hi - low).is_multiple_of(*n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/utilities.rs:399:5 [INFO] [stdout] | [INFO] [stdout] 399 | / match (delta_x, delta_y) { [INFO] [stdout] 400 | | (0, _) => true, [INFO] [stdout] 401 | | (_, 0) => true, [INFO] [stdout] 402 | | _ => false, [INFO] [stdout] 403 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 399 - match (delta_x, delta_y) { [INFO] [stdout] 400 - (0, _) => true, [INFO] [stdout] 401 - (_, 0) => true, [INFO] [stdout] 402 - _ => false, [INFO] [stdout] 403 - } [INFO] [stdout] 399 + matches!((delta_x, delta_y), (0, _) | (_, 0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:411:5 [INFO] [stdout] | [INFO] [stdout] 411 | return false == diagonal_path_is_obstructed(origin, destination, state); [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 false == diagonal_path_is_obstructed(origin, destination, state); [INFO] [stdout] 411 + false == diagonal_path_is_obstructed(origin, destination, state) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utilities.rs:411:12 [INFO] [stdout] | [INFO] [stdout] 411 | return false == diagonal_path_is_obstructed(origin, destination, state); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!diagonal_path_is_obstructed(origin, destination, state)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:418:5 [INFO] [stdout] | [INFO] [stdout] 418 | / return match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 419 | | (1, 2) => true, [INFO] [stdout] 420 | | (2, 1) => true, [INFO] [stdout] 421 | | (_, _) => false, [INFO] [stdout] 422 | | } [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] 418 ~ match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 419 + (1, 2) => true, [INFO] [stdout] 420 + (2, 1) => true, [INFO] [stdout] 421 + (_, _) => false, [INFO] [stdout] 422 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:429:5 [INFO] [stdout] | [INFO] [stdout] 429 | / return match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 430 | | (0, _) => !vertical_path_is_obstructed(origin, delta_y, state), [INFO] [stdout] 431 | | (_, 0) => !horizontal_path_is_obstructed(origin, delta_x, state), [INFO] [stdout] 432 | | (x, y) => x == y && !diagonal_path_is_obstructed(origin, destination, state), [INFO] [stdout] 433 | | } [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] 429 ~ match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 430 + (0, _) => !vertical_path_is_obstructed(origin, delta_y, state), [INFO] [stdout] 431 + (_, 0) => !horizontal_path_is_obstructed(origin, delta_x, state), [INFO] [stdout] 432 + (x, y) => x == y && !diagonal_path_is_obstructed(origin, destination, state), [INFO] [stdout] 433 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:446:5 [INFO] [stdout] | [INFO] [stdout] 446 | / return match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 447 | | (0, 1) => !horizontal_path_is_obstructed(origin, delta_x, &state), [INFO] [stdout] 448 | | (1, 0) => !vertical_path_is_obstructed(origin, delta_y, &state), [INFO] [stdout] 449 | | (1, 1) => !diagonal_path_is_obstructed(origin, destination, &state), [INFO] [stdout] 450 | | _ => false, [INFO] [stdout] 451 | | } [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] 446 ~ match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 447 + (0, 1) => !horizontal_path_is_obstructed(origin, delta_x, &state), [INFO] [stdout] 448 + (1, 0) => !vertical_path_is_obstructed(origin, delta_y, &state), [INFO] [stdout] 449 + (1, 1) => !diagonal_path_is_obstructed(origin, destination, &state), [INFO] [stdout] 450 + _ => false, [INFO] [stdout] 451 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:447:67 [INFO] [stdout] | [INFO] [stdout] 447 | (0, 1) => !horizontal_path_is_obstructed(origin, delta_x, &state), [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:448:65 [INFO] [stdout] | [INFO] [stdout] 448 | (1, 0) => !vertical_path_is_obstructed(origin, delta_y, &state), [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:449:69 [INFO] [stdout] | [INFO] [stdout] 449 | (1, 1) => !diagonal_path_is_obstructed(origin, destination, &state), [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | let mut origin_rank = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:96:13 [INFO] [stdout] | [INFO] [stdout] 96 | let mut origin_file = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `delta_x` [INFO] [stdout] --> src/actions.rs:149:14 [INFO] [stdout] | [INFO] [stdout] 149 | let (delta_x, delta_y) = position_delta(self.from, self.to); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_delta_x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:197:13 [INFO] [stdout] | [INFO] [stdout] 197 | let mut origin_rank = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:198:13 [INFO] [stdout] | [INFO] [stdout] 198 | let mut origin_file = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `delta_x` [INFO] [stdout] --> src/actions.rs:271:14 [INFO] [stdout] | [INFO] [stdout] 271 | let (delta_x, delta_y) = position_delta(self.with, self.on); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_delta_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `delta_y` [INFO] [stdout] --> src/actions.rs:271:23 [INFO] [stdout] | [INFO] [stdout] 271 | let (delta_x, delta_y) = position_delta(self.with, self.on); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_delta_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:297:13 [INFO] [stdout] | [INFO] [stdout] 297 | let mut origin_file = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:524:13 [INFO] [stdout] | [INFO] [stdout] 524 | let mut origin_file = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/actions.rs:525:13 [INFO] [stdout] | [INFO] [stdout] 525 | let mut capture_indicator = &mut String::with_capacity(1); [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `action` [INFO] [stdout] --> src/tests.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | let action = Move { from: 61, to: 54 }; [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_action` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/tests.rs:527:9 [INFO] [stdout] | [INFO] [stdout] 527 | let mut state = GameState::with_placements(vec![ [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `action` [INFO] [stdout] --> src/tests.rs:1135:9 [INFO] [stdout] | [INFO] [stdout] 1135 | let action = Move { from: 29, to: 20 }; [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_action` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/tests.rs:1378:9 [INFO] [stdout] | [INFO] [stdout] 1378 | let mut state = GameState::with_placements(vec![ [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:90:27 [INFO] [stdout] | [INFO] [stdout] 90 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:100:63 [INFO] [stdout] | [INFO] [stdout] 100 | let ambiguity = disambiguate_move(self.from, self.to, &state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/actions.rs:109:9 [INFO] [stdout] | [INFO] [stdout] 109 | / String::from(format!( [INFO] [stdout] 110 | | "{}{}{}{}{}", [INFO] [stdout] 111 | | piece_str, [INFO] [stdout] 112 | | origin_file, [INFO] [stdout] ... | [INFO] [stdout] 115 | | destination_rank, [INFO] [stdout] 116 | | )) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `String::from()` [INFO] [stdout] | [INFO] [stdout] 109 ~ format!( [INFO] [stdout] 110 + "{}{}{}{}{}", [INFO] [stdout] 111 + piece_str, [INFO] [stdout] 112 + origin_file, [INFO] [stdout] 113 + origin_rank, [INFO] [stdout] 114 + destination_file, [INFO] [stdout] 115 + destination_rank, [INFO] [stdout] 116 + ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:137:54 [INFO] [stdout] | [INFO] [stdout] 137 | if !move_is_pseudo_legal(self.from, self.to, &state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:141:56 [INFO] [stdout] | [INFO] [stdout] 141 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:148:29 [INFO] [stdout] | [INFO] [stdout] 148 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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` statement can be collapsed [INFO] [stdout] --> src/actions.rs:158:9 [INFO] [stdout] | [INFO] [stdout] 158 | / if piece.name == Pawn { [INFO] [stdout] 159 | | if delta_y.abs() == 2 { [INFO] [stdout] 160 | | match state.squares[self.from] { [INFO] [stdout] 161 | | None => (), [INFO] [stdout] ... | [INFO] [stdout] 170 | | } [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] 158 ~ if piece.name == Pawn [INFO] [stdout] 159 ~ && delta_y.abs() == 2 { [INFO] [stdout] 160 | match state.squares[self.from] { [INFO] [stdout] ... [INFO] [stdout] 168 | } [INFO] [stdout] 169 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:192:27 [INFO] [stdout] | [INFO] [stdout] 192 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:202:66 [INFO] [stdout] | [INFO] [stdout] 202 | let ambiguity = disambiguate_capture(self.with, self.on, &state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: comparison to empty slice [INFO] [stdout] --> src/actions.rs:207:12 [INFO] [stdout] | [INFO] [stdout] 207 | if piece_str == "" || ambiguity.file_is_ambiguous { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `piece_str.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/actions.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 211 | / String::from(format!( [INFO] [stdout] 212 | | "{}{}{}x{}{}", [INFO] [stdout] 213 | | piece_str, [INFO] [stdout] 214 | | origin_file, [INFO] [stdout] ... | [INFO] [stdout] 217 | | destination_rank, [INFO] [stdout] 218 | | )) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `String::from()` [INFO] [stdout] | [INFO] [stdout] 211 ~ format!( [INFO] [stdout] 212 + "{}{}{}x{}{}", [INFO] [stdout] 213 + piece_str, [INFO] [stdout] 214 + origin_file, [INFO] [stdout] 215 + origin_rank, [INFO] [stdout] 216 + destination_file, [INFO] [stdout] 217 + destination_rank, [INFO] [stdout] 218 + ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:259:54 [INFO] [stdout] | [INFO] [stdout] 259 | if !move_is_pseudo_legal(self.with, self.on, &state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:263:56 [INFO] [stdout] | [INFO] [stdout] 263 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:270:29 [INFO] [stdout] | [INFO] [stdout] 270 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:293:27 [INFO] [stdout] | [INFO] [stdout] 293 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/actions.rs:303:9 [INFO] [stdout] | [INFO] [stdout] 303 | / String::from(format!( [INFO] [stdout] 304 | | "{}x{}{}", [INFO] [stdout] 305 | | origin_file, [INFO] [stdout] 306 | | destination_file, [INFO] [stdout] 307 | | destination_rank, [INFO] [stdout] 308 | | )) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `String::from()` [INFO] [stdout] | [INFO] [stdout] 303 ~ format!( [INFO] [stdout] 304 + "{}x{}{}", [INFO] [stdout] 305 + origin_file, [INFO] [stdout] 306 + destination_file, [INFO] [stdout] 307 + destination_rank, [INFO] [stdout] 308 + ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/actions.rs:313:12 [INFO] [stdout] | [INFO] [stdout] 313 | if !state.en_passant_square.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.en_passant_square.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: this boolean expression can be simplified [INFO] [stdout] --> src/actions.rs:318:12 [INFO] [stdout] | [INFO] [stdout] 318 | if !state.squares[self.with].is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.squares[self.with].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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:351:56 [INFO] [stdout] | [INFO] [stdout] 351 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:358:29 [INFO] [stdout] | [INFO] [stdout] 358 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:394:27 [INFO] [stdout] | [INFO] [stdout] 394 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/actions.rs:418:18 [INFO] [stdout] | [INFO] [stdout] 418 | 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] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 418 - return true [INFO] [stdout] 418 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/actions.rs:432:17 [INFO] [stdout] | [INFO] [stdout] 432 | 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] 432 - return true [INFO] [stdout] 432 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/actions.rs:444:17 [INFO] [stdout] | [INFO] [stdout] 444 | 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] 444 - return true [INFO] [stdout] 444 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/actions.rs:458:17 [INFO] [stdout] | [INFO] [stdout] 458 | 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] 458 - return true [INFO] [stdout] 458 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:404:56 [INFO] [stdout] | [INFO] [stdout] 404 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:410:47 [INFO] [stdout] | [INFO] [stdout] 410 | if !piece_is(White, King, 4, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:411:47 [INFO] [stdout] | [INFO] [stdout] 411 | if !piece_is(White, Rook, 7, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:414:54 [INFO] [stdout] | [INFO] [stdout] 414 | if color_threatens_square(Black, 4, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:415:54 [INFO] [stdout] | [INFO] [stdout] 415 | if color_threatens_square(Black, 5, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:416:54 [INFO] [stdout] | [INFO] [stdout] 416 | if color_threatens_square(Black, 6, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:417:54 [INFO] [stdout] | [INFO] [stdout] 417 | if color_threatens_square(Black, 7, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:422:46 [INFO] [stdout] | [INFO] [stdout] 422 | if !piece_is(White, King, 4, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:423:46 [INFO] [stdout] | [INFO] [stdout] 423 | if !piece_is(White, Rook, 0, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:427:53 [INFO] [stdout] | [INFO] [stdout] 427 | if color_threatens_square(Black, 0, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:428:53 [INFO] [stdout] | [INFO] [stdout] 428 | if color_threatens_square(Black, 1, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:429:53 [INFO] [stdout] | [INFO] [stdout] 429 | if color_threatens_square(Black, 2, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:430:53 [INFO] [stdout] | [INFO] [stdout] 430 | if color_threatens_square(Black, 3, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:431:53 [INFO] [stdout] | [INFO] [stdout] 431 | if color_threatens_square(Black, 4, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:436:47 [INFO] [stdout] | [INFO] [stdout] 436 | if !piece_is(Black, King, 60, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:437:47 [INFO] [stdout] | [INFO] [stdout] 437 | if !piece_is(Black, Rook, 63, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:440:54 [INFO] [stdout] | [INFO] [stdout] 440 | if color_threatens_square(White, 60, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:441:54 [INFO] [stdout] | [INFO] [stdout] 441 | if color_threatens_square(White, 61, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:442:54 [INFO] [stdout] | [INFO] [stdout] 442 | if color_threatens_square(White, 62, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:443:54 [INFO] [stdout] | [INFO] [stdout] 443 | if color_threatens_square(White, 63, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:448:47 [INFO] [stdout] | [INFO] [stdout] 448 | if !piece_is(Black, King, 60, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:449:47 [INFO] [stdout] | [INFO] [stdout] 449 | if !piece_is(Black, Rook, 56, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:453:54 [INFO] [stdout] | [INFO] [stdout] 453 | if color_threatens_square(White, 56, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:454:54 [INFO] [stdout] | [INFO] [stdout] 454 | if color_threatens_square(White, 57, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:455:54 [INFO] [stdout] | [INFO] [stdout] 455 | if color_threatens_square(White, 58, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:456:54 [INFO] [stdout] | [INFO] [stdout] 456 | if color_threatens_square(White, 59, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:457:54 [INFO] [stdout] | [INFO] [stdout] 457 | if color_threatens_square(White, 60, &state) { return false } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:463:29 [INFO] [stdout] | [INFO] [stdout] 463 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:513:27 [INFO] [stdout] | [INFO] [stdout] 513 | if !self.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/actions.rs:537:9 [INFO] [stdout] | [INFO] [stdout] 537 | / String::from(format!( [INFO] [stdout] 538 | | "{}{}{}{}{}", [INFO] [stdout] 539 | | origin_file, [INFO] [stdout] 540 | | capture_indicator, [INFO] [stdout] ... | [INFO] [stdout] 543 | | new_piece_str, [INFO] [stdout] 544 | | )) [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `String::from()` [INFO] [stdout] | [INFO] [stdout] 537 ~ format!( [INFO] [stdout] 538 + "{}{}{}{}{}", [INFO] [stdout] 539 + origin_file, [INFO] [stdout] 540 + capture_indicator, [INFO] [stdout] 541 + destination_file, [INFO] [stdout] 542 + destination_rank, [INFO] [stdout] 543 + new_piece_str, [INFO] [stdout] 544 + ) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:552:56 [INFO] [stdout] | [INFO] [stdout] 552 | if color_is_checked(state.to_move, &self.apply(&state)) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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 `GameState` which implements the `Copy` trait [INFO] [stdout] --> src/actions.rs:585:29 [INFO] [stdout] | [INFO] [stdout] 585 | let mut new_state = state.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*state` [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/actions.rs:610:5 [INFO] [stdout] | [INFO] [stdout] 610 | / match piece { [INFO] [stdout] 611 | | Bishop => true, [INFO] [stdout] 612 | | Knight => true, [INFO] [stdout] 613 | | Rook => true, [INFO] [stdout] 614 | | Queen => true, [INFO] [stdout] 615 | | _ => false, [INFO] [stdout] 616 | | } [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] 610 - match piece { [INFO] [stdout] 611 - Bishop => true, [INFO] [stdout] 612 - Knight => true, [INFO] [stdout] 613 - Rook => true, [INFO] [stdout] 614 - Queen => true, [INFO] [stdout] 615 - _ => false, [INFO] [stdout] 616 - } [INFO] [stdout] 610 + matches!(piece, Bishop | Knight | Rook | Queen) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:638:36 [INFO] [stdout] | [INFO] [stdout] 638 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/actions.rs:667:36 [INFO] [stdout] | [INFO] [stdout] 667 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/actions.rs:698:22 [INFO] [stdout] | [INFO] [stdout] 698 | White => match origin { [INFO] [stdout] | ______________________^ [INFO] [stdout] 699 | | 4 => { [INFO] [stdout] 700 | | state.white_can_castle_queenside = false; [INFO] [stdout] 701 | | state.white_can_castle_kingside = false; [INFO] [stdout] 702 | | }, [INFO] [stdout] 703 | | _ => (), [INFO] [stdout] 704 | | }, [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] 698 ~ White => if origin == 4 { [INFO] [stdout] 699 + state.white_can_castle_queenside = false; [INFO] [stdout] 700 + state.white_can_castle_kingside = false; [INFO] [stdout] 701 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/actions.rs:705:22 [INFO] [stdout] | [INFO] [stdout] 705 | Black => match origin { [INFO] [stdout] | ______________________^ [INFO] [stdout] 706 | | 60 => { [INFO] [stdout] 707 | | state.black_can_castle_queenside = false; [INFO] [stdout] 708 | | state.black_can_castle_kingside = false; [INFO] [stdout] 709 | | }, [INFO] [stdout] 710 | | _ => (), [INFO] [stdout] 711 | | } [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] 705 ~ Black => if origin == 60 { [INFO] [stdout] 706 + state.black_can_castle_queenside = false; [INFO] [stdout] 707 + state.black_can_castle_kingside = false; [INFO] [stdout] 708 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/pieces.rs:42:1 [INFO] [stdout] | [INFO] [stdout] 42 | / impl ToString for Piece { [INFO] [stdout] 43 | | fn to_string(&self) -> String { [INFO] [stdout] 44 | | match self.name { [INFO] [stdout] 45 | | PieceName::Pawn => String::from(""), [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/notation.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | String::from(format!("{}{}", rank, file)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("{}{}", rank, file)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:101:5 [INFO] [stdout] | [INFO] [stdout] 101 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:110:5 [INFO] [stdout] | [INFO] [stdout] 110 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/notation.rs:116:5 [INFO] [stdout] | [INFO] [stdout] 116 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `GameState` [INFO] [stdout] --> src/gamestate.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 47 | / pub fn new() -> GameState { [INFO] [stdout] 48 | | let mut state = GameState::with_placements(vec![ [INFO] [stdout] 49 | | Placement::new(Color::White, PieceName::Rook, 0), [INFO] [stdout] 50 | | Placement::new(Color::White, PieceName::Knight, 1), [INFO] [stdout] ... | [INFO] [stdout] 93 | | state [INFO] [stdout] 94 | | } [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] 19 + impl Default for GameState { [INFO] [stdout] 20 + fn default() -> Self { [INFO] [stdout] 21 + Self::new() [INFO] [stdout] 22 + } [INFO] [stdout] 23 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamestate.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | 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] 29 - return true; [INFO] [stdout] 29 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/gamestate.rs:110:1 [INFO] [stdout] | [INFO] [stdout] 110 | / impl ToString for GameState { [INFO] [stdout] 111 | | // Create a human readable gamestate string [INFO] [stdout] 112 | | fn to_string(&self) -> String { [INFO] [stdout] 113 | | let mut output = String::with_capacity(136); [INFO] [stdout] ... | [INFO] [stdout] 143 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/gamestate.rs:137:17 [INFO] [stdout] | [INFO] [stdout] 137 | output.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/gamestate.rs:139:13 [INFO] [stdout] | [INFO] [stdout] 139 | output.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `output.push('\n')` [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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:31:54 [INFO] [stdout] | [INFO] [stdout] 31 | let is_checked = color_is_checked(state.to_move, &state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:32:33 [INFO] [stdout] | [INFO] [stdout] 32 | let actions = legal_actions(&state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utilities.rs:33:19 [INFO] [stdout] | [INFO] [stdout] 33 | is_checked && actions.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `actions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:37:54 [INFO] [stdout] | [INFO] [stdout] 37 | let is_checked = color_is_checked(state.to_move, &state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:38:33 [INFO] [stdout] | [INFO] [stdout] 38 | let actions = legal_actions(&state); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utilities.rs:39:20 [INFO] [stdout] | [INFO] [stdout] 39 | !is_checked && actions.len() == 0 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `actions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:58:55 [INFO] [stdout] | [INFO] [stdout] 58 | if move_is_pseudo_legal(m.from, m.to, &state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utilities.rs:85:8 [INFO] [stdout] | [INFO] [stdout] 85 | if !king_square.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `king_square.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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:91:60 [INFO] [stdout] | [INFO] [stdout] 91 | color_threatens_square(attacker, king_square.unwrap(), &state) [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:97:32 [INFO] [stdout] | [INFO] [stdout] 97 | for action in legal_moves(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:98:35 [INFO] [stdout] | [INFO] [stdout] 98 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:100:35 [INFO] [stdout] | [INFO] [stdout] 100 | for action in legal_captures(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:101:35 [INFO] [stdout] | [INFO] [stdout] 101 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:103:38 [INFO] [stdout] | [INFO] [stdout] 103 | for action in legal_en_passants(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:104:35 [INFO] [stdout] | [INFO] [stdout] 104 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:106:33 [INFO] [stdout] | [INFO] [stdout] 106 | for action in legal_castles(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:107:35 [INFO] [stdout] | [INFO] [stdout] 107 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:109:36 [INFO] [stdout] | [INFO] [stdout] 109 | for action in legal_promotions(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:110:35 [INFO] [stdout] | [INFO] [stdout] 110 | results.push(action.apply(&state)); [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:119:32 [INFO] [stdout] | [INFO] [stdout] 119 | for action in legal_moves(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:122:34 [INFO] [stdout] | [INFO] [stdout] 122 | for action in legal_captures(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:125:38 [INFO] [stdout] | [INFO] [stdout] 125 | for action in legal_en_passants(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:128:33 [INFO] [stdout] | [INFO] [stdout] 128 | for action in legal_castles(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:131:36 [INFO] [stdout] | [INFO] [stdout] 131 | for action in legal_promotions(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:141:5 [INFO] [stdout] | [INFO] [stdout] 141 | return (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] 141 - return (x, y); [INFO] [stdout] 141 + (x, y) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utilities.rs:180:8 [INFO] [stdout] | [INFO] [stdout] 180 | if !state.en_passant_square.is_some() { return results } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.en_passant_square.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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:185:24 [INFO] [stdout] | [INFO] [stdout] 185 | if action.is_legal(&state) { results.push(action); } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:188:24 [INFO] [stdout] | [INFO] [stdout] 188 | if action.is_legal(&state) { results.push(action); } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:191:24 [INFO] [stdout] | [INFO] [stdout] 191 | if action.is_legal(&state) { results.push(action); } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:194:24 [INFO] [stdout] | [INFO] [stdout] 194 | if action.is_legal(&state) { results.push(action); } [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:208:40 [INFO] [stdout] | [INFO] [stdout] 208 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:228:40 [INFO] [stdout] | [INFO] [stdout] 228 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:242:24 [INFO] [stdout] | [INFO] [stdout] 242 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:246:24 [INFO] [stdout] | [INFO] [stdout] 246 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:264:36 [INFO] [stdout] | [INFO] [stdout] 264 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:278:36 [INFO] [stdout] | [INFO] [stdout] 278 | if action.is_legal(&state) { [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utilities.rs:291:8 [INFO] [stdout] | [INFO] [stdout] 291 | if !state.squares[origin].is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.squares[origin].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] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/utilities.rs:378:12 [INFO] [stdout] | [INFO] [stdout] 378 | if (hi - low) % n == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace with: `(hi - low).is_multiple_of(*n)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/utilities.rs:399:5 [INFO] [stdout] | [INFO] [stdout] 399 | / match (delta_x, delta_y) { [INFO] [stdout] 400 | | (0, _) => true, [INFO] [stdout] 401 | | (_, 0) => true, [INFO] [stdout] 402 | | _ => false, [INFO] [stdout] 403 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 399 - match (delta_x, delta_y) { [INFO] [stdout] 400 - (0, _) => true, [INFO] [stdout] 401 - (_, 0) => true, [INFO] [stdout] 402 - _ => false, [INFO] [stdout] 403 - } [INFO] [stdout] 399 + matches!((delta_x, delta_y), (0, _) | (_, 0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:411:5 [INFO] [stdout] | [INFO] [stdout] 411 | return false == diagonal_path_is_obstructed(origin, destination, state); [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 false == diagonal_path_is_obstructed(origin, destination, state); [INFO] [stdout] 411 + false == diagonal_path_is_obstructed(origin, destination, state) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/utilities.rs:411:12 [INFO] [stdout] | [INFO] [stdout] 411 | return false == diagonal_path_is_obstructed(origin, destination, state); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!diagonal_path_is_obstructed(origin, destination, state)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:418:5 [INFO] [stdout] | [INFO] [stdout] 418 | / return match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 419 | | (1, 2) => true, [INFO] [stdout] 420 | | (2, 1) => true, [INFO] [stdout] 421 | | (_, _) => false, [INFO] [stdout] 422 | | } [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] 418 ~ match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 419 + (1, 2) => true, [INFO] [stdout] 420 + (2, 1) => true, [INFO] [stdout] 421 + (_, _) => false, [INFO] [stdout] 422 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:429:5 [INFO] [stdout] | [INFO] [stdout] 429 | / return match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 430 | | (0, _) => !vertical_path_is_obstructed(origin, delta_y, state), [INFO] [stdout] 431 | | (_, 0) => !horizontal_path_is_obstructed(origin, delta_x, state), [INFO] [stdout] 432 | | (x, y) => x == y && !diagonal_path_is_obstructed(origin, destination, state), [INFO] [stdout] 433 | | } [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] 429 ~ match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 430 + (0, _) => !vertical_path_is_obstructed(origin, delta_y, state), [INFO] [stdout] 431 + (_, 0) => !horizontal_path_is_obstructed(origin, delta_x, state), [INFO] [stdout] 432 + (x, y) => x == y && !diagonal_path_is_obstructed(origin, destination, state), [INFO] [stdout] 433 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utilities.rs:446:5 [INFO] [stdout] | [INFO] [stdout] 446 | / return match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 447 | | (0, 1) => !horizontal_path_is_obstructed(origin, delta_x, &state), [INFO] [stdout] 448 | | (1, 0) => !vertical_path_is_obstructed(origin, delta_y, &state), [INFO] [stdout] 449 | | (1, 1) => !diagonal_path_is_obstructed(origin, destination, &state), [INFO] [stdout] 450 | | _ => false, [INFO] [stdout] 451 | | } [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] 446 ~ match (delta_x.abs(), delta_y.abs()) { [INFO] [stdout] 447 + (0, 1) => !horizontal_path_is_obstructed(origin, delta_x, &state), [INFO] [stdout] 448 + (1, 0) => !vertical_path_is_obstructed(origin, delta_y, &state), [INFO] [stdout] 449 + (1, 1) => !diagonal_path_is_obstructed(origin, destination, &state), [INFO] [stdout] 450 + _ => false, [INFO] [stdout] 451 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:447:67 [INFO] [stdout] | [INFO] [stdout] 447 | (0, 1) => !horizontal_path_is_obstructed(origin, delta_x, &state), [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:448:65 [INFO] [stdout] | [INFO] [stdout] 448 | (1, 0) => !vertical_path_is_obstructed(origin, delta_y, &state), [INFO] [stdout] | ^^^^^^ help: change this to: `state` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utilities.rs:449:69 [INFO] [stdout] | [INFO] [stdout] 449 | (1, 1) => !diagonal_path_is_obstructed(origin, destination, &state), [INFO] [stdout] | ^^^^^^ help: change this to: `state` [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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/tests.rs:156:13 [INFO] [stdout] | [INFO] [stdout] 156 | assert!(false == diagonal_path_is_obstructed(61, 54, &state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!diagonal_path_is_obstructed(61, 54, &state)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:166:5 [INFO] [stdout] | [INFO] [stdout] 166 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 166 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 166 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:187:5 [INFO] [stdout] | [INFO] [stdout] 187 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 187 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 187 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:197:5 [INFO] [stdout] | [INFO] [stdout] 197 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 197 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 197 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:200:5 [INFO] [stdout] | [INFO] [stdout] 200 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 200 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 200 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:210:5 [INFO] [stdout] | [INFO] [stdout] 210 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 210 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 210 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:220:5 [INFO] [stdout] | [INFO] [stdout] 220 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 220 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 220 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:231:5 [INFO] [stdout] | [INFO] [stdout] 231 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 231 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 231 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:239:5 [INFO] [stdout] | [INFO] [stdout] 239 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 239 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 239 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:249:5 [INFO] [stdout] | [INFO] [stdout] 249 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 249 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 249 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:259:5 [INFO] [stdout] | [INFO] [stdout] 259 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 259 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 259 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:269:5 [INFO] [stdout] | [INFO] [stdout] 269 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 269 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 269 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:279:5 [INFO] [stdout] | [INFO] [stdout] 279 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 279 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 279 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:289:5 [INFO] [stdout] | [INFO] [stdout] 289 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 289 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 289 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:299:5 [INFO] [stdout] | [INFO] [stdout] 299 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 299 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 299 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:308:5 [INFO] [stdout] | [INFO] [stdout] 308 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 308 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 308 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:317:5 [INFO] [stdout] | [INFO] [stdout] 317 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 317 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 317 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:326:5 [INFO] [stdout] | [INFO] [stdout] 326 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 326 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 326 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:335:5 [INFO] [stdout] | [INFO] [stdout] 335 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 335 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 335 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 344 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 344 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:353:5 [INFO] [stdout] | [INFO] [stdout] 353 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 353 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 353 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:362:5 [INFO] [stdout] | [INFO] [stdout] 362 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 362 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 362 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:371:5 [INFO] [stdout] | [INFO] [stdout] 371 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 371 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 371 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:381:5 [INFO] [stdout] | [INFO] [stdout] 381 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 381 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 381 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:393:5 [INFO] [stdout] | [INFO] [stdout] 393 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 393 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 393 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:405:5 [INFO] [stdout] | [INFO] [stdout] 405 | assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 405 - assert_eq!(false, action.is_legal(&state)); [INFO] [stdout] 405 + assert!(!action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:415:5 [INFO] [stdout] | [INFO] [stdout] 415 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 415 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 415 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/tests.rs:425:5 [INFO] [stdout] | [INFO] [stdout] 425 | assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 425 - assert_eq!(true, action.is_legal(&state)); [INFO] [stdout] 425 + assert!(action.is_legal(&state)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:534:13 [INFO] [stdout] | [INFO] [stdout] 534 | assert!(!new_state.squares[0].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `new_state.squares[0].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:596:13 [INFO] [stdout] | [INFO] [stdout] 596 | assert!(!aftermath.squares[4].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `aftermath.squares[4].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:597:13 [INFO] [stdout] | [INFO] [stdout] 597 | assert!(!aftermath.squares[7].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `aftermath.squares[7].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:613:13 [INFO] [stdout] | [INFO] [stdout] 613 | assert!(!aftermath.squares[4].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `aftermath.squares[4].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:614:13 [INFO] [stdout] | [INFO] [stdout] 614 | assert!(!aftermath.squares[0].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `aftermath.squares[0].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:631:13 [INFO] [stdout] | [INFO] [stdout] 631 | assert!(!aftermath.squares[60].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `aftermath.squares[60].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:632:13 [INFO] [stdout] | [INFO] [stdout] 632 | assert!(!aftermath.squares[63].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `aftermath.squares[63].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:649:13 [INFO] [stdout] | [INFO] [stdout] 649 | assert!(!aftermath.squares[60].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `aftermath.squares[60].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:650:13 [INFO] [stdout] | [INFO] [stdout] 650 | assert!(!aftermath.squares[56].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `aftermath.squares[56].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] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:985:13 [INFO] [stdout] | [INFO] [stdout] 985 | assert!(!state.squares[34].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.squares[34].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] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:973:13 [INFO] [stdout] | [INFO] [stdout] 973 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/tests.rs:1007:13 [INFO] [stdout] | [INFO] [stdout] 1007 | assert!(!state.squares[28].is_some()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.squares[28].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] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:995:13 [INFO] [stdout] | [INFO] [stdout] 995 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:1114:13 [INFO] [stdout] | [INFO] [stdout] 1114 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:1136:13 [INFO] [stdout] | [INFO] [stdout] 1136 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:1158:13 [INFO] [stdout] | [INFO] [stdout] 1158 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:1179:13 [INFO] [stdout] | [INFO] [stdout] 1179 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:1200:13 [INFO] [stdout] | [INFO] [stdout] 1200 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:1331:13 [INFO] [stdout] | [INFO] [stdout] 1331 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/tests.rs:1357:13 [INFO] [stdout] | [INFO] [stdout] 1357 | assert!(state.en_passant_square == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `state.en_passant_square.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/tests.rs:2098:20 [INFO] [stdout] | [INFO] [stdout] 2098 | let expected = format!( [INFO] [stdout] | ____________________^ [INFO] [stdout] 2099 | | "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 0" [INFO] [stdout] 2100 | | ); [INFO] [stdout] | |_____^ help: consider using `.to_string()`: `"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 0".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] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.00s [INFO] running `Command { std: "docker" "inspect" "164d3930f21571fae1091853451d94b28303dbd7c00dc7f0daff83b4558f3dcf", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "164d3930f21571fae1091853451d94b28303dbd7c00dc7f0daff83b4558f3dcf", kill_on_drop: false }` [INFO] [stdout] 164d3930f21571fae1091853451d94b28303dbd7c00dc7f0daff83b4558f3dcf