[INFO] cloning repository https://github.com/daizyoo/aho-ai [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/daizyoo/aho-ai" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdaizyoo%2Faho-ai", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdaizyoo%2Faho-ai'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 3c691cdcf69dc8d1cf446a8c19dbc08ef726242a [INFO] linting daizyoo/aho-ai against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fdaizyoo%2Faho-ai" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/daizyoo/aho-ai [INFO] finished tweaking git repo https://github.com/daizyoo/aho-ai [INFO] tweaked toml for git repo https://github.com/daizyoo/aho-ai written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/daizyoo/aho-ai 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/daizyoo/aho-ai already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded zmij v1.0.9 [INFO] [stderr] Downloaded base64ct v1.8.2 [INFO] [stderr] Downloaded webpki-root-certs v1.0.5 [INFO] [stderr] Downloaded syn v2.0.112 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] b3ad1d4bbf0b31d39fd8ee887165d82b27ce79c68b0cda376a634d815440eb39 [INFO] running `Command { std: "docker" "start" "-a" "b3ad1d4bbf0b31d39fd8ee887165d82b27ce79c68b0cda376a634d815440eb39", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "b3ad1d4bbf0b31d39fd8ee887165d82b27ce79c68b0cda376a634d815440eb39", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b3ad1d4bbf0b31d39fd8ee887165d82b27ce79c68b0cda376a634d815440eb39", kill_on_drop: false }` [INFO] [stdout] b3ad1d4bbf0b31d39fd8ee887165d82b27ce79c68b0cda376a634d815440eb39 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 429ae60645f5e1e7d89d2ad78dc66200c52208c9335a0f4a1a20d178ad60e069 [INFO] running `Command { std: "docker" "start" "-a" "429ae60645f5e1e7d89d2ad78dc66200c52208c9335a0f4a1a20d178ad60e069", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.179 [INFO] [stderr] Compiling proc-macro2 v1.0.104 [INFO] [stderr] Compiling quote v1.0.42 [INFO] [stderr] Compiling zerocopy v0.8.31 [INFO] [stderr] Checking log v0.4.29 [INFO] [stderr] Compiling zmij v1.0.9 [INFO] [stderr] Compiling serde_json v1.0.148 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Checking bitflags v2.10.0 [INFO] [stderr] Checking memchr v2.7.6 [INFO] [stderr] Checking bytes v1.11.0 [INFO] [stderr] Checking chrono v0.4.42 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Compiling syn v2.0.112 [INFO] [stderr] Checking errno v0.3.14 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking mio v0.8.11 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking socket2 v0.6.1 [INFO] [stderr] Checking signal-hook-registry v1.4.8 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking signal-hook v0.3.18 [INFO] [stderr] Checking signal-hook-mio v0.2.5 [INFO] [stderr] Checking crossterm v0.27.0 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Checking tokio v1.49.0 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking shogi-aho-ai v0.6.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> src/selfplay/mod.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> src/selfplay/mod.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | use std::thread; [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 variable: `path` [INFO] [stdout] --> src/ml/model_registry.rs:138:30 [INFO] [stdout] | [INFO] [stdout] 138 | pub fn get_model_version(path: &Path) -> Option { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_path` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `path` [INFO] [stdout] --> src/ml/model_registry.rs:138:30 [INFO] [stdout] | [INFO] [stdout] 138 | pub fn get_model_version(path: &Path) -> Option { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_path` [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/selfplay/mod.rs:301:17 [INFO] [stdout] | [INFO] [stdout] 301 | let mut stdout = std::io::stdout(); [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: unused variable: `i` [INFO] [stdout] --> src/selfplay/mod.rs:369:26 [INFO] [stdout] | [INFO] [stdout] 369 | for (i, worker) in workers.iter().enumerate().take(num_display_slots) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/selfplay/mod.rs:301:17 [INFO] [stdout] | [INFO] [stdout] 301 | let mut stdout = std::io::stdout(); [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: unused variable: `i` [INFO] [stdout] --> src/selfplay/mod.rs:369:26 [INFO] [stdout] | [INFO] [stdout] 369 | for (i, worker) in workers.iter().enumerate().take(num_display_slots) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `extract_timestamp_from_filename` and `extract_timestamp_from_path` are never used [INFO] [stdout] --> src/ui/kifu_selector.rs:64:8 [INFO] [stdout] | [INFO] [stdout] 38 | impl KifuSelector { [INFO] [stdout] | ----------------- associated functions in this implementation [INFO] [stdout] ... [INFO] [stdout] 64 | fn extract_timestamp_from_filename(filename: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 102 | fn extract_timestamp_from_path(path: &Path) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `extract_timestamp_from_filename` and `extract_timestamp_from_path` are never used [INFO] [stdout] --> src/ui/kifu_selector.rs:64:8 [INFO] [stdout] | [INFO] [stdout] 38 | impl KifuSelector { [INFO] [stdout] | ----------------- associated functions in this implementation [INFO] [stdout] ... [INFO] [stdout] 64 | fn extract_timestamp_from_filename(filename: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 102 | fn extract_timestamp_from_path(path: &Path) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/game/replay.rs:93:22 [INFO] [stdout] | [INFO] [stdout] 93 | Some(self.history[self.current_index - 1].clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.history[self.current_index - 1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/game/replay.rs:93:22 [INFO] [stdout] | [INFO] [stdout] 93 | Some(self.history[self.current_index - 1].clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.history[self.current_index - 1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/replay.rs:158:29 [INFO] [stdout] | [INFO] [stdout] 158 | / ... if self.current_index < self.history.len() { [INFO] [stdout] 159 | | ... self.current_index += 1; [INFO] [stdout] 160 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 157 ~ KeyCode::Right | KeyCode::Char('n') [INFO] [stdout] 158 ~ if self.current_index < self.history.len() => { [INFO] [stdout] 159 | self.current_index += 1; [INFO] [stdout] 160 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/replay.rs:163:29 [INFO] [stdout] | [INFO] [stdout] 163 | / ... if self.current_index > 0 { [INFO] [stdout] 164 | | ... self.current_index -= 1; [INFO] [stdout] 165 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 162 ~ KeyCode::Left | KeyCode::Char('p') [INFO] [stdout] 163 ~ if self.current_index > 0 => { [INFO] [stdout] 164 | self.current_index -= 1; [INFO] [stdout] 165 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/replay.rs:158:29 [INFO] [stdout] | [INFO] [stdout] 158 | / ... if self.current_index < self.history.len() { [INFO] [stdout] 159 | | ... self.current_index += 1; [INFO] [stdout] 160 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 157 ~ KeyCode::Right | KeyCode::Char('n') [INFO] [stdout] 158 ~ if self.current_index < self.history.len() => { [INFO] [stdout] 159 | self.current_index += 1; [INFO] [stdout] 160 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/replay.rs:163:29 [INFO] [stdout] | [INFO] [stdout] 163 | / ... if self.current_index > 0 { [INFO] [stdout] 164 | | ... self.current_index -= 1; [INFO] [stdout] 165 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 162 ~ KeyCode::Left | KeyCode::Char('p') [INFO] [stdout] 163 ~ if self.current_index > 0 => { [INFO] [stdout] 164 | self.current_index -= 1; [INFO] [stdout] 165 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/game/mod.rs:107:31 [INFO] [stdout] | [INFO] [stdout] 107 | state.last_move = self.board.last_move.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.board.last_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/game/mod.rs:107:31 [INFO] [stdout] | [INFO] [stdout] 107 | state.last_move = self.board.last_move.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.board.last_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/game/mod.rs:220:35 [INFO] [stdout] | [INFO] [stdout] 220 | self.history.push(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try removing the `clone` call: `mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/game/mod.rs:220:35 [INFO] [stdout] | [INFO] [stdout] 220 | self.history.push(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try removing the `clone` call: `mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logic/mod.rs:39:41 [INFO] [stdout] | [INFO] [stdout] 39 | / ... if (player == PlayerId::Player1 && y == 0) [INFO] [stdout] 40 | | ... || (player == PlayerId::Player2 && y == 8) [INFO] [stdout] 41 | | ... { [INFO] [stdout] 42 | | ... continue; [INFO] [stdout] 43 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 38 ~ PieceKind::S_Pawn | PieceKind::S_Lance [INFO] [stdout] 39 ~ if ((player == PlayerId::Player1 && y == 0) [INFO] [stdout] 40 ~ || (player == PlayerId::Player2 && y == 8)) [INFO] [stdout] 41 ~ => { [INFO] [stdout] 42 | continue; [INFO] [stdout] 43 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logic/mod.rs:46:41 [INFO] [stdout] | [INFO] [stdout] 46 | / ... if (player == PlayerId::Player1 && y <= 1) [INFO] [stdout] 47 | | ... || (player == PlayerId::Player2 && y >= 7) [INFO] [stdout] 48 | | ... { [INFO] [stdout] 49 | | ... continue; [INFO] [stdout] 50 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 45 ~ PieceKind::S_Knight [INFO] [stdout] 46 ~ if ((player == PlayerId::Player1 && y <= 1) [INFO] [stdout] 47 ~ || (player == PlayerId::Player2 && y >= 7)) [INFO] [stdout] 48 ~ => { [INFO] [stdout] 49 | continue; [INFO] [stdout] 50 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logic/mod.rs:39:41 [INFO] [stdout] | [INFO] [stdout] 39 | / ... if (player == PlayerId::Player1 && y == 0) [INFO] [stdout] 40 | | ... || (player == PlayerId::Player2 && y == 8) [INFO] [stdout] 41 | | ... { [INFO] [stdout] 42 | | ... continue; [INFO] [stdout] 43 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 38 ~ PieceKind::S_Pawn | PieceKind::S_Lance [INFO] [stdout] 39 ~ if ((player == PlayerId::Player1 && y == 0) [INFO] [stdout] 40 ~ || (player == PlayerId::Player2 && y == 8)) [INFO] [stdout] 41 ~ => { [INFO] [stdout] 42 | continue; [INFO] [stdout] 43 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logic/mod.rs:46:41 [INFO] [stdout] | [INFO] [stdout] 46 | / ... if (player == PlayerId::Player1 && y <= 1) [INFO] [stdout] 47 | | ... || (player == PlayerId::Player2 && y >= 7) [INFO] [stdout] 48 | | ... { [INFO] [stdout] 49 | | ... continue; [INFO] [stdout] 50 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 45 ~ PieceKind::S_Knight [INFO] [stdout] 46 ~ if ((player == PlayerId::Player1 && y <= 1) [INFO] [stdout] 47 ~ || (player == PlayerId::Player2 && y >= 7)) [INFO] [stdout] 48 ~ => { [INFO] [stdout] 49 | continue; [INFO] [stdout] 50 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/logic/mod.rs:312:27 [INFO] [stdout] | [INFO] [stdout] 312 | next.last_move = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/logic/mod.rs:312:27 [INFO] [stdout] | [INFO] [stdout] 312 | next.last_move = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/ml/model_registry.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | / for entry in entries { [INFO] [stdout] 64 | | if let Ok(entry) = entry { [INFO] [stdout] 65 | | let path = entry.path(); [INFO] [stdout] ... | [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/ml/model_registry.rs:64:21 [INFO] [stdout] | [INFO] [stdout] 64 | / if let Ok(entry) = entry { [INFO] [stdout] 65 | | let path = entry.path(); [INFO] [stdout] 66 | | [INFO] [stdout] 67 | | if path.is_dir() { [INFO] [stdout] ... | [INFO] [stdout] 129 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 63 ~ for entry in entries.flatten() { [INFO] [stdout] 64 + let path = entry.path(); [INFO] [stdout] 65 + [INFO] [stdout] 66 + if path.is_dir() { [INFO] [stdout] 67 + dirs_to_visit.push(path); [INFO] [stdout] 68 + continue; [INFO] [stdout] 69 + } [INFO] [stdout] 70 + [INFO] [stdout] 71 + let extension = path.extension().and_then(|s| s.to_str()); [INFO] [stdout] 72 + let model_type = match extension { [INFO] [stdout] 73 + Some("onnx") => Some(ModelType::ONNX), [INFO] [stdout] 74 + _ => None, [INFO] [stdout] 75 + }; [INFO] [stdout] 76 + [INFO] [stdout] 77 + if let Some(model_type) = model_type { [INFO] [stdout] 78 + // Calculate relative name from base directory [INFO] [stdout] 79 + let relative_path = path.strip_prefix(models_dir).unwrap_or(&path); [INFO] [stdout] 80 + let mut name = relative_path [INFO] [stdout] 81 + .with_extension("") // Remove .onnx [INFO] [stdout] 82 + .to_string_lossy() [INFO] [stdout] 83 + .into_owned(); [INFO] [stdout] 84 + [INFO] [stdout] 85 + // Strip "model" from end if it exists (e.g. Fair/v1.0/model -> Fair/v1.0) [INFO] [stdout] 86 + if name.ends_with("/model") { [INFO] [stdout] 87 + name = name.strip_suffix("/model").unwrap().to_string(); [INFO] [stdout] 88 + } else if name == "model" { [INFO] [stdout] 89 + // Keep it if it's just "model" at the root, or handle as needed [INFO] [stdout] 90 + } [INFO] [stdout] 91 + [INFO] [stdout] 92 + let version = { [INFO] [stdout] 93 + #[cfg(feature = "ml")] [INFO] [stdout] 94 + { [INFO] [stdout] 95 + // Try to load session to read metadata [INFO] [stdout] 96 + if let Ok(session) = [INFO] [stdout] 97 + Session::builder().and_then(|b| b.commit_from_file(&path)) [INFO] [stdout] 98 + { [INFO] [stdout] 99 + if let Ok(metadata) = session.metadata() { [INFO] [stdout] 100 + if let Ok(Some(version)) = metadata.custom("version") { [INFO] [stdout] 101 + Some(version) [INFO] [stdout] 102 + } else { [INFO] [stdout] 103 + None [INFO] [stdout] 104 + } [INFO] [stdout] 105 + } else { [INFO] [stdout] 106 + None [INFO] [stdout] 107 + } [INFO] [stdout] 108 + } else { [INFO] [stdout] 109 + None [INFO] [stdout] 110 + } [INFO] [stdout] 111 + } [INFO] [stdout] 112 + #[cfg(not(feature = "ml"))] [INFO] [stdout] 113 + { [INFO] [stdout] 114 + None [INFO] [stdout] 115 + } [INFO] [stdout] 116 + }; [INFO] [stdout] 117 + [INFO] [stdout] 118 + let metadata = ModelMetadata { [INFO] [stdout] 119 + name: name.clone(), [INFO] [stdout] 120 + model_type, [INFO] [stdout] 121 + path: path.clone(), [INFO] [stdout] 122 + version, [INFO] [stdout] 123 + created_at: None, [INFO] [stdout] 124 + }; [INFO] [stdout] 125 + [INFO] [stdout] 126 + self.register(metadata); [INFO] [stdout] 127 + } [INFO] [stdout] 128 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/ml/model_registry.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | / for entry in entries { [INFO] [stdout] 64 | | if let Ok(entry) = entry { [INFO] [stdout] 65 | | let path = entry.path(); [INFO] [stdout] ... | [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/ml/model_registry.rs:64:21 [INFO] [stdout] | [INFO] [stdout] 64 | / if let Ok(entry) = entry { [INFO] [stdout] 65 | | let path = entry.path(); [INFO] [stdout] 66 | | [INFO] [stdout] 67 | | if path.is_dir() { [INFO] [stdout] ... | [INFO] [stdout] 129 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 63 ~ for entry in entries.flatten() { [INFO] [stdout] 64 + let path = entry.path(); [INFO] [stdout] 65 + [INFO] [stdout] 66 + if path.is_dir() { [INFO] [stdout] 67 + dirs_to_visit.push(path); [INFO] [stdout] 68 + continue; [INFO] [stdout] 69 + } [INFO] [stdout] 70 + [INFO] [stdout] 71 + let extension = path.extension().and_then(|s| s.to_str()); [INFO] [stdout] 72 + let model_type = match extension { [INFO] [stdout] 73 + Some("onnx") => Some(ModelType::ONNX), [INFO] [stdout] 74 + _ => None, [INFO] [stdout] 75 + }; [INFO] [stdout] 76 + [INFO] [stdout] 77 + if let Some(model_type) = model_type { [INFO] [stdout] 78 + // Calculate relative name from base directory [INFO] [stdout] 79 + let relative_path = path.strip_prefix(models_dir).unwrap_or(&path); [INFO] [stdout] 80 + let mut name = relative_path [INFO] [stdout] 81 + .with_extension("") // Remove .onnx [INFO] [stdout] 82 + .to_string_lossy() [INFO] [stdout] 83 + .into_owned(); [INFO] [stdout] 84 + [INFO] [stdout] 85 + // Strip "model" from end if it exists (e.g. Fair/v1.0/model -> Fair/v1.0) [INFO] [stdout] 86 + if name.ends_with("/model") { [INFO] [stdout] 87 + name = name.strip_suffix("/model").unwrap().to_string(); [INFO] [stdout] 88 + } else if name == "model" { [INFO] [stdout] 89 + // Keep it if it's just "model" at the root, or handle as needed [INFO] [stdout] 90 + } [INFO] [stdout] 91 + [INFO] [stdout] 92 + let version = { [INFO] [stdout] 93 + #[cfg(feature = "ml")] [INFO] [stdout] 94 + { [INFO] [stdout] 95 + // Try to load session to read metadata [INFO] [stdout] 96 + if let Ok(session) = [INFO] [stdout] 97 + Session::builder().and_then(|b| b.commit_from_file(&path)) [INFO] [stdout] 98 + { [INFO] [stdout] 99 + if let Ok(metadata) = session.metadata() { [INFO] [stdout] 100 + if let Ok(Some(version)) = metadata.custom("version") { [INFO] [stdout] 101 + Some(version) [INFO] [stdout] 102 + } else { [INFO] [stdout] 103 + None [INFO] [stdout] 104 + } [INFO] [stdout] 105 + } else { [INFO] [stdout] 106 + None [INFO] [stdout] 107 + } [INFO] [stdout] 108 + } else { [INFO] [stdout] 109 + None [INFO] [stdout] 110 + } [INFO] [stdout] 111 + } [INFO] [stdout] 112 + #[cfg(not(feature = "ml"))] [INFO] [stdout] 113 + { [INFO] [stdout] 114 + None [INFO] [stdout] 115 + } [INFO] [stdout] 116 + }; [INFO] [stdout] 117 + [INFO] [stdout] 118 + let metadata = ModelMetadata { [INFO] [stdout] 119 + name: name.clone(), [INFO] [stdout] 120 + model_type, [INFO] [stdout] 121 + path: path.clone(), [INFO] [stdout] 122 + version, [INFO] [stdout] 123 + created_at: None, [INFO] [stdout] 124 + }; [INFO] [stdout] 125 + [INFO] [stdout] 126 + self.register(metadata); [INFO] [stdout] 127 + } [INFO] [stdout] 128 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:161:34 [INFO] [stdout] | [INFO] [stdout] 161 | best_move = Some(legal_moves[0].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `legal_moves[0]` [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 boolean expression can be simplified [INFO] [stdout] --> src/player/ai/alpha_beta.rs:327:24 [INFO] [stdout] | [INFO] [stdout] 327 | && !is_promote_move.is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_promote_move.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: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:161:34 [INFO] [stdout] | [INFO] [stdout] 161 | best_move = Some(legal_moves[0].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `legal_moves[0]` [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 boolean expression can be simplified [INFO] [stdout] --> src/player/ai/alpha_beta.rs:327:24 [INFO] [stdout] | [INFO] [stdout] 327 | && !is_promote_move.is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_promote_move.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: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:375:34 [INFO] [stdout] | [INFO] [stdout] 375 | best_move = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:391:43 [INFO] [stdout] | [INFO] [stdout] 391 | killers[ply][1] = killers[ply][0].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `killers[ply][0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:392:48 [INFO] [stdout] | [INFO] [stdout] 392 | killers[ply][0] = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Option; 2]` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:419:13 [INFO] [stdout] | [INFO] [stdout] 419 | self.killer_moves.borrow()[ply].clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.killer_moves.borrow()[ply]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:375:34 [INFO] [stdout] | [INFO] [stdout] 375 | best_move = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:391:43 [INFO] [stdout] | [INFO] [stdout] 391 | killers[ply][1] = killers[ply][0].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `killers[ply][0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:392:48 [INFO] [stdout] | [INFO] [stdout] 392 | killers[ply][0] = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Option; 2]` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:419:13 [INFO] [stdout] | [INFO] [stdout] 419 | self.killer_moves.borrow()[ply].clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.killer_moves.borrow()[ply]` [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: you should consider adding a `Default` implementation for `HandcraftedEvaluator` [INFO] [stdout] --> src/player/ai/eval.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn new() -> Self { [INFO] [stdout] 37 | | Self [INFO] [stdout] 38 | | } [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] 35 + impl Default for HandcraftedEvaluator { [INFO] [stdout] 36 + fn default() -> Self { [INFO] [stdout] 37 + Self::new() [INFO] [stdout] 38 + } [INFO] [stdout] 39 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `HandcraftedEvaluator` [INFO] [stdout] --> src/player/ai/eval.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn new() -> Self { [INFO] [stdout] 37 | | Self [INFO] [stdout] 38 | | } [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] 35 + impl Default for HandcraftedEvaluator { [INFO] [stdout] 36 + fn default() -> Self { [INFO] [stdout] 37 + Self::new() [INFO] [stdout] 38 + } [INFO] [stdout] 39 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/player/ai/eval.rs:481:19 [INFO] [stdout] | [INFO] [stdout] 481 | while check_y >= 0 && check_y < 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..9).contains(&check_y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/player/ai/eval.rs:481:19 [INFO] [stdout] | [INFO] [stdout] 481 | while check_y >= 0 && check_y < 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..9).contains(&check_y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player/ai/see.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | / if piece.owner == attacker { [INFO] [stdout] 59 | | if can_piece_attack(board, pos, target, piece.kind, attacker) { [INFO] [stdout] 60 | | count += 1; [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [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] 58 ~ if piece.owner == attacker [INFO] [stdout] 59 ~ && can_piece_attack(board, pos, target, piece.kind, attacker) { [INFO] [stdout] 60 | count += 1; [INFO] [stdout] 61 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/player/ai/see.rs:100:13 [INFO] [stdout] | [INFO] [stdout] 100 | / (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 | | (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 100 - (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 - (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] 100 + !(dy != forward || dx != 0 && dx.abs() != 1) || // Forward diagonals [INFO] [stdout] | [INFO] [stdout] 100 - (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 - (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] 100 + (dx.abs() == 1 || dx == 0) && dy == forward || // Forward diagonals [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!Range::contains` implementation [INFO] [stdout] --> src/player/ai/see.rs:175:31 [INFO] [stdout] | [INFO] [stdout] 175 | if x < 0 || x >= 9 || y < 0 || y >= 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `!(0..9).contains(&y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!Range::contains` implementation [INFO] [stdout] --> src/player/ai/see.rs:175:12 [INFO] [stdout] | [INFO] [stdout] 175 | if x < 0 || x >= 9 || y < 0 || y >= 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `!(0..9).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/tt.rs:59:38 [INFO] [stdout] | [INFO] [stdout] 59 | return Some((*entry, mv.clone())); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player/ai/see.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | / if piece.owner == attacker { [INFO] [stdout] 59 | | if can_piece_attack(board, pos, target, piece.kind, attacker) { [INFO] [stdout] 60 | | count += 1; [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [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] 58 ~ if piece.owner == attacker [INFO] [stdout] 59 ~ && can_piece_attack(board, pos, target, piece.kind, attacker) { [INFO] [stdout] 60 | count += 1; [INFO] [stdout] 61 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/player/ai/see.rs:100:13 [INFO] [stdout] | [INFO] [stdout] 100 | / (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 | | (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 100 - (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 - (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] 100 + !(dy != forward || dx != 0 && dx.abs() != 1) || // Forward diagonals [INFO] [stdout] | [INFO] [stdout] 100 - (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 - (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] 100 + (dx.abs() == 1 || dx == 0) && dy == forward || // Forward diagonals [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:36:24 [INFO] [stdout] | [INFO] [stdout] 36 | last_move: board.last_move.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `board.last_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!Range::contains` implementation [INFO] [stdout] --> src/player/ai/see.rs:175:31 [INFO] [stdout] | [INFO] [stdout] 175 | if x < 0 || x >= 9 || y < 0 || y >= 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `!(0..9).contains(&y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!Range::contains` implementation [INFO] [stdout] --> src/player/ai/see.rs:175:12 [INFO] [stdout] | [INFO] [stdout] 175 | if x < 0 || x >= 9 || y < 0 || y >= 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `!(0..9).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:192:66 [INFO] [stdout] | [INFO] [stdout] 192 | ... Some((k, m.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*m` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:213:65 [INFO] [stdout] | [INFO] [stdout] 213 | ... promote_options[0].1.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `promote_options[0].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/tt.rs:59:38 [INFO] [stdout] | [INFO] [stdout] 59 | return Some((*entry, mv.clone())); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:267:69 [INFO] [stdout] | [INFO] [stdout] 267 | / ... promote_options [INFO] [stdout] 268 | | ... [digit as usize - 1] [INFO] [stdout] 269 | | ... .1 [INFO] [stdout] 270 | | ... .clone(), [INFO] [stdout] | |__________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try removing the `clone` call [INFO] [stdout] | [INFO] [stdout] 267 ~ promote_options [INFO] [stdout] 268 + [digit as usize - 1] [INFO] [stdout] 269 ~ .1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:278:53 [INFO] [stdout] | [INFO] [stdout] 278 | ... return Some(found_moves[0].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `found_moves[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:36:24 [INFO] [stdout] | [INFO] [stdout] 36 | last_move: board.last_move.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `board.last_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:192:66 [INFO] [stdout] | [INFO] [stdout] 192 | ... Some((k, m.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*m` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:213:65 [INFO] [stdout] | [INFO] [stdout] 213 | ... promote_options[0].1.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `promote_options[0].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:267:69 [INFO] [stdout] | [INFO] [stdout] 267 | / ... promote_options [INFO] [stdout] 268 | | ... [digit as usize - 1] [INFO] [stdout] 269 | | ... .1 [INFO] [stdout] 270 | | ... .clone(), [INFO] [stdout] | |__________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try removing the `clone` call [INFO] [stdout] | [INFO] [stdout] 267 ~ promote_options [INFO] [stdout] 268 + [digit as usize - 1] [INFO] [stdout] 269 ~ .1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:278:53 [INFO] [stdout] | [INFO] [stdout] 278 | ... return Some(found_moves[0].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `found_moves[0]` [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: casting to the same type is unnecessary (`u128` -> `u128`) [INFO] [stdout] --> src/selfplay/mod.rs:184:61 [INFO] [stdout] | [INFO] [stdout] 184 | let total_time: u128 = thinking_data.iter().map(|t| t.time_ms as u128).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `t.time_ms` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u128` -> `u128`) [INFO] [stdout] --> src/selfplay/mod.rs:184:61 [INFO] [stdout] | [INFO] [stdout] 184 | let total_time: u128 = thinking_data.iter().map(|t| t.time_ms as u128).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `t.time_ms` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/selfplay/mod.rs:505:12 [INFO] [stdout] | [INFO] [stdout] 505 | if moves % update_interval == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `moves.is_multiple_of(update_interval)` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/selfplay/mod.rs:592:27 [INFO] [stdout] | [INFO] [stdout] 592 | let resigned = if let Some(_) = winner { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if winner.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/selfplay/mod.rs:719:16 [INFO] [stdout] | [INFO] [stdout] 719 | if pseudo_legal.len() > 0 && pseudo_legal.len() <= 5 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!pseudo_legal.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: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/selfplay/mod.rs:505:12 [INFO] [stdout] | [INFO] [stdout] 505 | if moves % update_interval == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `moves.is_multiple_of(update_interval)` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/selfplay/mod.rs:592:27 [INFO] [stdout] | [INFO] [stdout] 592 | let resigned = if let Some(_) = winner { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if winner.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/selfplay/mod.rs:719:16 [INFO] [stdout] | [INFO] [stdout] 719 | if pseudo_legal.len() > 0 && pseudo_legal.len() <= 5 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!pseudo_legal.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 `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:287:25 [INFO] [stdout] | [INFO] [stdout] 287 | / if !self.files.is_empty() { [INFO] [stdout] 288 | | return Ok(Some(self.files[self.selected_index].path.clone())); [INFO] [stdout] 289 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 286 ~ KeyCode::Enter [INFO] [stdout] 287 ~ if !self.files.is_empty() => { [INFO] [stdout] 288 | return Ok(Some(self.files[self.selected_index].path.clone())); [INFO] [stdout] 289 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:292:25 [INFO] [stdout] | [INFO] [stdout] 292 | / if self.selected_index > 0 { [INFO] [stdout] 293 | | self.selected_index -= 1; [INFO] [stdout] 294 | | self.update_scroll(); [INFO] [stdout] 295 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 291 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 292 ~ if self.selected_index > 0 => { [INFO] [stdout] 293 | self.selected_index -= 1; [INFO] [stdout] 294 | self.update_scroll(); [INFO] [stdout] 295 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:298:25 [INFO] [stdout] | [INFO] [stdout] 298 | / if self.selected_index < self.files.len().saturating_sub(1) { [INFO] [stdout] 299 | | self.selected_index += 1; [INFO] [stdout] 300 | | self.update_scroll(); [INFO] [stdout] 301 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 297 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 298 ~ if self.selected_index < self.files.len().saturating_sub(1) => { [INFO] [stdout] 299 | self.selected_index += 1; [INFO] [stdout] 300 | self.update_scroll(); [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/ui/selection.rs:10:6 [INFO] [stdout] | [INFO] [stdout] 10 | ) -> anyhow::Result<( [INFO] [stdout] | ______^ [INFO] [stdout] 11 | | Box, [INFO] [stdout] 12 | | Box, [INFO] [stdout] 13 | | PerspectiveMode, [INFO] [stdout] 14 | | )> { [INFO] [stdout] | |__^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/selection.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if selected_idx > 0 { [INFO] [stdout] 121 | | selected_idx -= 1; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ KeyCode::Up [INFO] [stdout] 120 ~ if selected_idx > 0 => { [INFO] [stdout] 121 | selected_idx -= 1; [INFO] [stdout] 122 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/selection.rs:125:25 [INFO] [stdout] | [INFO] [stdout] 125 | / if selected_idx < models.len() - 1 { [INFO] [stdout] 126 | | selected_idx += 1; [INFO] [stdout] 127 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 124 ~ KeyCode::Down [INFO] [stdout] 125 ~ if selected_idx < models.len() - 1 => { [INFO] [stdout] 126 | selected_idx += 1; [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/ui/selection.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if selected_idx > 0 { [INFO] [stdout] 121 | | selected_idx -= 1; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_________________________^ help: try: `selected_idx = selected_idx.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:287:25 [INFO] [stdout] | [INFO] [stdout] 287 | / if !self.files.is_empty() { [INFO] [stdout] 288 | | return Ok(Some(self.files[self.selected_index].path.clone())); [INFO] [stdout] 289 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 286 ~ KeyCode::Enter [INFO] [stdout] 287 ~ if !self.files.is_empty() => { [INFO] [stdout] 288 | return Ok(Some(self.files[self.selected_index].path.clone())); [INFO] [stdout] 289 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:292:25 [INFO] [stdout] | [INFO] [stdout] 292 | / if self.selected_index > 0 { [INFO] [stdout] 293 | | self.selected_index -= 1; [INFO] [stdout] 294 | | self.update_scroll(); [INFO] [stdout] 295 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 291 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 292 ~ if self.selected_index > 0 => { [INFO] [stdout] 293 | self.selected_index -= 1; [INFO] [stdout] 294 | self.update_scroll(); [INFO] [stdout] 295 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:298:25 [INFO] [stdout] | [INFO] [stdout] 298 | / if self.selected_index < self.files.len().saturating_sub(1) { [INFO] [stdout] 299 | | self.selected_index += 1; [INFO] [stdout] 300 | | self.update_scroll(); [INFO] [stdout] 301 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 297 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 298 ~ if self.selected_index < self.files.len().saturating_sub(1) => { [INFO] [stdout] 299 | self.selected_index += 1; [INFO] [stdout] 300 | self.update_scroll(); [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/mod.rs:36:25 [INFO] [stdout] | [INFO] [stdout] 36 | / if !input.is_empty() { [INFO] [stdout] 37 | | input.pop(); [INFO] [stdout] 38 | | print!("\u{0008} \u{0008}"); [INFO] [stdout] 39 | | io::stdout().flush()?; [INFO] [stdout] 40 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ KeyCode::Backspace [INFO] [stdout] 36 ~ if !input.is_empty() => { [INFO] [stdout] 37 | input.pop(); [INFO] [stdout] 38 | print!("\u{0008} \u{0008}"); [INFO] [stdout] 39 | io::stdout().flush()?; [INFO] [stdout] 40 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/ui/selection.rs:10:6 [INFO] [stdout] | [INFO] [stdout] 10 | ) -> anyhow::Result<( [INFO] [stdout] | ______^ [INFO] [stdout] 11 | | Box, [INFO] [stdout] 12 | | Box, [INFO] [stdout] 13 | | PerspectiveMode, [INFO] [stdout] 14 | | )> { [INFO] [stdout] | |__^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/selection.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if selected_idx > 0 { [INFO] [stdout] 121 | | selected_idx -= 1; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ KeyCode::Up [INFO] [stdout] 120 ~ if selected_idx > 0 => { [INFO] [stdout] 121 | selected_idx -= 1; [INFO] [stdout] 122 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/selection.rs:125:25 [INFO] [stdout] | [INFO] [stdout] 125 | / if selected_idx < models.len() - 1 { [INFO] [stdout] 126 | | selected_idx += 1; [INFO] [stdout] 127 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 124 ~ KeyCode::Down [INFO] [stdout] 125 ~ if selected_idx < models.len() - 1 => { [INFO] [stdout] 126 | selected_idx += 1; [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/ui/selection.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if selected_idx > 0 { [INFO] [stdout] 121 | | selected_idx -= 1; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_________________________^ help: try: `selected_idx = selected_idx.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/mod.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | / if selected_index < files_with_labels.len() - 1 { [INFO] [stdout] 146 | | selected_index += 1; [INFO] [stdout] 147 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 144 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 145 ~ if selected_index < files_with_labels.len() - 1 => { [INFO] [stdout] 146 | selected_index += 1; [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/mod.rs:36:25 [INFO] [stdout] | [INFO] [stdout] 36 | / if !input.is_empty() { [INFO] [stdout] 37 | | input.pop(); [INFO] [stdout] 38 | | print!("\u{0008} \u{0008}"); [INFO] [stdout] 39 | | io::stdout().flush()?; [INFO] [stdout] 40 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ KeyCode::Backspace [INFO] [stdout] 36 ~ if !input.is_empty() => { [INFO] [stdout] 37 | input.pop(); [INFO] [stdout] 38 | print!("\u{0008} \u{0008}"); [INFO] [stdout] 39 | io::stdout().flush()?; [INFO] [stdout] 40 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/mod.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | / if selected_index < files_with_labels.len() - 1 { [INFO] [stdout] 146 | | selected_index += 1; [INFO] [stdout] 147 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 144 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 145 ~ if selected_index < files_with_labels.len() - 1 => { [INFO] [stdout] 146 | selected_index += 1; [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Board` [INFO] [stdout] --> src/bin/extract_features.rs:5:26 [INFO] [stdout] | [INFO] [stdout] 5 | use shogi_aho_ai::core::{Board, PlayerId}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Board` [INFO] [stdout] --> src/bin/extract_features.rs:5:26 [INFO] [stdout] | [INFO] [stdout] 5 | use shogi_aho_ai::core::{Board, PlayerId}; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> src/selfplay/mod.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> src/selfplay/mod.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:719:9 [INFO] [stdout] | [INFO] [stdout] 719 | let mut model_path = None; [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/main.rs:719:9 [INFO] [stdout] | [INFO] [stdout] 719 | let mut model_path = None; [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: unused variable: `path` [INFO] [stdout] --> src/ml/model_registry.rs:138:30 [INFO] [stdout] | [INFO] [stdout] 138 | pub fn get_model_version(path: &Path) -> Option { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_path` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `path` [INFO] [stdout] --> src/ml/model_registry.rs:138:30 [INFO] [stdout] | [INFO] [stdout] 138 | pub fn get_model_version(path: &Path) -> Option { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_path` [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/selfplay/mod.rs:301:17 [INFO] [stdout] | [INFO] [stdout] 301 | let mut stdout = std::io::stdout(); [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/selfplay/mod.rs:369:26 [INFO] [stdout] | [INFO] [stdout] 369 | for (i, worker) in workers.iter().enumerate().take(num_display_slots) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `evaluate` is never used [INFO] [stdout] --> src/logic/mod.rs:350:8 [INFO] [stdout] | [INFO] [stdout] 350 | pub fn evaluate(board: &Board, player: PlayerId) -> i32 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_piece_value` is never used [INFO] [stdout] --> src/logic/mod.rs:382:4 [INFO] [stdout] | [INFO] [stdout] 382 | fn get_piece_value(kind: PieceKind) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `NUM_PIECE_TYPES` is never used [INFO] [stdout] --> src/ml/features.rs:9:7 [INFO] [stdout] | [INFO] [stdout] 9 | const NUM_PIECE_TYPES: usize = 41; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `BoardFeatureExtractor` is never constructed [INFO] [stdout] --> src/ml/features.rs:12:12 [INFO] [stdout] | [INFO] [stdout] 12 | pub struct BoardFeatureExtractor; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `extract`, `encode_square`, `encode_hand`, `piece_to_index`, and `feature_size` are never used [INFO] [stdout] --> src/ml/features.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 14 | impl BoardFeatureExtractor { [INFO] [stdout] | -------------------------- associated functions in this implementation [INFO] [stdout] ... [INFO] [stdout] 21 | pub fn extract(board: &Board, current_player: PlayerId) -> Vec { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 46 | fn encode_square(board: &Board, pos: Position, perspective: PlayerId) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 60 | fn encode_hand(board: &Board, perspective: PlayerId) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 100 | fn piece_to_index(kind: PieceKind, owner: PlayerId, perspective: PlayerId) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 133 | pub fn feature_size() -> usize { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `model_type` and `created_at` are never read [INFO] [stdout] --> src/ml/model_registry.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 14 | pub struct ModelMetadata { [INFO] [stdout] | ------------- fields in this struct [INFO] [stdout] 15 | pub name: String, [INFO] [stdout] 16 | pub model_type: ModelType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 19 | pub created_at: Option, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ModelMetadata` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `get` is never used [INFO] [stdout] --> src/ml/model_registry.rs:40:12 [INFO] [stdout] | [INFO] [stdout] 27 | impl ModelRegistry { [INFO] [stdout] | ------------------ method in this implementation [INFO] [stdout] ... [INFO] [stdout] 40 | pub fn get(&self, name: &str) -> Option<&ModelMetadata> { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `position_evaluations` and `critical_moments` are never read [INFO] [stdout] --> src/selfplay/mod.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 138 | pub struct GameExecutionResult { [INFO] [stdout] | ------------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 145 | pub position_evaluations: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 146 | /// Move indices where there were large evaluation swings (>2000 centipawns) [INFO] [stdout] 147 | pub critical_moments: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `select_kifu_file` is never used [INFO] [stdout] --> src/ui/mod.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn select_kifu_file(dir: &str) -> anyhow::Result> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `filename` is never read [INFO] [stdout] --> src/ui/kifu_selector.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 12 | pub struct KifuFileInfo { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] 13 | pub path: PathBuf, [INFO] [stdout] 14 | pub filename: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `KifuFileInfo` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `extract_timestamp_from_filename` and `extract_timestamp_from_path` are never used [INFO] [stdout] --> src/ui/kifu_selector.rs:64:8 [INFO] [stdout] | [INFO] [stdout] 38 | impl KifuSelector { [INFO] [stdout] | ----------------- associated functions in this implementation [INFO] [stdout] ... [INFO] [stdout] 64 | fn extract_timestamp_from_filename(filename: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 102 | fn extract_timestamp_from_path(path: &Path) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/selfplay/mod.rs:301:17 [INFO] [stdout] | [INFO] [stdout] 301 | let mut stdout = std::io::stdout(); [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/selfplay/mod.rs:369:26 [INFO] [stdout] | [INFO] [stdout] 369 | for (i, worker) in workers.iter().enumerate().take(num_display_slots) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `evaluate` is never used [INFO] [stdout] --> src/logic/mod.rs:350:8 [INFO] [stdout] | [INFO] [stdout] 350 | pub fn evaluate(board: &Board, player: PlayerId) -> i32 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_piece_value` is never used [INFO] [stdout] --> src/logic/mod.rs:382:4 [INFO] [stdout] | [INFO] [stdout] 382 | fn get_piece_value(kind: PieceKind) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `model_type` and `created_at` are never read [INFO] [stdout] --> src/ml/model_registry.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 14 | pub struct ModelMetadata { [INFO] [stdout] | ------------- fields in this struct [INFO] [stdout] 15 | pub name: String, [INFO] [stdout] 16 | pub model_type: ModelType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 19 | pub created_at: Option, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ModelMetadata` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `position_evaluations` and `critical_moments` are never read [INFO] [stdout] --> src/selfplay/mod.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 138 | pub struct GameExecutionResult { [INFO] [stdout] | ------------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 145 | pub position_evaluations: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 146 | /// Move indices where there were large evaluation swings (>2000 centipawns) [INFO] [stdout] 147 | pub critical_moments: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `select_kifu_file` is never used [INFO] [stdout] --> src/ui/mod.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn select_kifu_file(dir: &str) -> anyhow::Result> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `filename` is never read [INFO] [stdout] --> src/ui/kifu_selector.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 12 | pub struct KifuFileInfo { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] 13 | pub path: PathBuf, [INFO] [stdout] 14 | pub filename: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `KifuFileInfo` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated functions `extract_timestamp_from_filename` and `extract_timestamp_from_path` are never used [INFO] [stdout] --> src/ui/kifu_selector.rs:64:8 [INFO] [stdout] | [INFO] [stdout] 38 | impl KifuSelector { [INFO] [stdout] | ----------------- associated functions in this implementation [INFO] [stdout] ... [INFO] [stdout] 64 | fn extract_timestamp_from_filename(filename: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 102 | fn extract_timestamp_from_path(path: &Path) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/game/replay.rs:93:22 [INFO] [stdout] | [INFO] [stdout] 93 | Some(self.history[self.current_index - 1].clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.history[self.current_index - 1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/replay.rs:158:29 [INFO] [stdout] | [INFO] [stdout] 158 | / ... if self.current_index < self.history.len() { [INFO] [stdout] 159 | | ... self.current_index += 1; [INFO] [stdout] 160 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 157 ~ KeyCode::Right | KeyCode::Char('n') [INFO] [stdout] 158 ~ if self.current_index < self.history.len() => { [INFO] [stdout] 159 | self.current_index += 1; [INFO] [stdout] 160 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/replay.rs:163:29 [INFO] [stdout] | [INFO] [stdout] 163 | / ... if self.current_index > 0 { [INFO] [stdout] 164 | | ... self.current_index -= 1; [INFO] [stdout] 165 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 162 ~ KeyCode::Left | KeyCode::Char('p') [INFO] [stdout] 163 ~ if self.current_index > 0 => { [INFO] [stdout] 164 | self.current_index -= 1; [INFO] [stdout] 165 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/game/mod.rs:107:31 [INFO] [stdout] | [INFO] [stdout] 107 | state.last_move = self.board.last_move.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.board.last_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/game/mod.rs:220:35 [INFO] [stdout] | [INFO] [stdout] 220 | self.history.push(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try removing the `clone` call: `mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logic/mod.rs:39:41 [INFO] [stdout] | [INFO] [stdout] 39 | / ... if (player == PlayerId::Player1 && y == 0) [INFO] [stdout] 40 | | ... || (player == PlayerId::Player2 && y == 8) [INFO] [stdout] 41 | | ... { [INFO] [stdout] 42 | | ... continue; [INFO] [stdout] 43 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 38 ~ PieceKind::S_Pawn | PieceKind::S_Lance [INFO] [stdout] 39 ~ if ((player == PlayerId::Player1 && y == 0) [INFO] [stdout] 40 ~ || (player == PlayerId::Player2 && y == 8)) [INFO] [stdout] 41 ~ => { [INFO] [stdout] 42 | continue; [INFO] [stdout] 43 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logic/mod.rs:46:41 [INFO] [stdout] | [INFO] [stdout] 46 | / ... if (player == PlayerId::Player1 && y <= 1) [INFO] [stdout] 47 | | ... || (player == PlayerId::Player2 && y >= 7) [INFO] [stdout] 48 | | ... { [INFO] [stdout] 49 | | ... continue; [INFO] [stdout] 50 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 45 ~ PieceKind::S_Knight [INFO] [stdout] 46 ~ if ((player == PlayerId::Player1 && y <= 1) [INFO] [stdout] 47 ~ || (player == PlayerId::Player2 && y >= 7)) [INFO] [stdout] 48 ~ => { [INFO] [stdout] 49 | continue; [INFO] [stdout] 50 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/logic/mod.rs:312:27 [INFO] [stdout] | [INFO] [stdout] 312 | next.last_move = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [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: name `ONNX` contains a capitalized acronym [INFO] [stdout] --> src/ml/model_registry.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | ONNX, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Onnx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/ml/model_registry.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | / for entry in entries { [INFO] [stdout] 64 | | if let Ok(entry) = entry { [INFO] [stdout] 65 | | let path = entry.path(); [INFO] [stdout] ... | [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/ml/model_registry.rs:64:21 [INFO] [stdout] | [INFO] [stdout] 64 | / if let Ok(entry) = entry { [INFO] [stdout] 65 | | let path = entry.path(); [INFO] [stdout] 66 | | [INFO] [stdout] 67 | | if path.is_dir() { [INFO] [stdout] ... | [INFO] [stdout] 129 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 63 ~ for entry in entries.flatten() { [INFO] [stdout] 64 + let path = entry.path(); [INFO] [stdout] 65 + [INFO] [stdout] 66 + if path.is_dir() { [INFO] [stdout] 67 + dirs_to_visit.push(path); [INFO] [stdout] 68 + continue; [INFO] [stdout] 69 + } [INFO] [stdout] 70 + [INFO] [stdout] 71 + let extension = path.extension().and_then(|s| s.to_str()); [INFO] [stdout] 72 + let model_type = match extension { [INFO] [stdout] 73 + Some("onnx") => Some(ModelType::ONNX), [INFO] [stdout] 74 + _ => None, [INFO] [stdout] 75 + }; [INFO] [stdout] 76 + [INFO] [stdout] 77 + if let Some(model_type) = model_type { [INFO] [stdout] 78 + // Calculate relative name from base directory [INFO] [stdout] 79 + let relative_path = path.strip_prefix(models_dir).unwrap_or(&path); [INFO] [stdout] 80 + let mut name = relative_path [INFO] [stdout] 81 + .with_extension("") // Remove .onnx [INFO] [stdout] 82 + .to_string_lossy() [INFO] [stdout] 83 + .into_owned(); [INFO] [stdout] 84 + [INFO] [stdout] 85 + // Strip "model" from end if it exists (e.g. Fair/v1.0/model -> Fair/v1.0) [INFO] [stdout] 86 + if name.ends_with("/model") { [INFO] [stdout] 87 + name = name.strip_suffix("/model").unwrap().to_string(); [INFO] [stdout] 88 + } else if name == "model" { [INFO] [stdout] 89 + // Keep it if it's just "model" at the root, or handle as needed [INFO] [stdout] 90 + } [INFO] [stdout] 91 + [INFO] [stdout] 92 + let version = { [INFO] [stdout] 93 + #[cfg(feature = "ml")] [INFO] [stdout] 94 + { [INFO] [stdout] 95 + // Try to load session to read metadata [INFO] [stdout] 96 + if let Ok(session) = [INFO] [stdout] 97 + Session::builder().and_then(|b| b.commit_from_file(&path)) [INFO] [stdout] 98 + { [INFO] [stdout] 99 + if let Ok(metadata) = session.metadata() { [INFO] [stdout] 100 + if let Ok(Some(version)) = metadata.custom("version") { [INFO] [stdout] 101 + Some(version) [INFO] [stdout] 102 + } else { [INFO] [stdout] 103 + None [INFO] [stdout] 104 + } [INFO] [stdout] 105 + } else { [INFO] [stdout] 106 + None [INFO] [stdout] 107 + } [INFO] [stdout] 108 + } else { [INFO] [stdout] 109 + None [INFO] [stdout] 110 + } [INFO] [stdout] 111 + } [INFO] [stdout] 112 + #[cfg(not(feature = "ml"))] [INFO] [stdout] 113 + { [INFO] [stdout] 114 + None [INFO] [stdout] 115 + } [INFO] [stdout] 116 + }; [INFO] [stdout] 117 + [INFO] [stdout] 118 + let metadata = ModelMetadata { [INFO] [stdout] 119 + name: name.clone(), [INFO] [stdout] 120 + model_type, [INFO] [stdout] 121 + path: path.clone(), [INFO] [stdout] 122 + version, [INFO] [stdout] 123 + created_at: None, [INFO] [stdout] 124 + }; [INFO] [stdout] 125 + [INFO] [stdout] 126 + self.register(metadata); [INFO] [stdout] 127 + } [INFO] [stdout] 128 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/game/replay.rs:93:22 [INFO] [stdout] | [INFO] [stdout] 93 | Some(self.history[self.current_index - 1].clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.history[self.current_index - 1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/replay.rs:158:29 [INFO] [stdout] | [INFO] [stdout] 158 | / ... if self.current_index < self.history.len() { [INFO] [stdout] 159 | | ... self.current_index += 1; [INFO] [stdout] 160 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 157 ~ KeyCode::Right | KeyCode::Char('n') [INFO] [stdout] 158 ~ if self.current_index < self.history.len() => { [INFO] [stdout] 159 | self.current_index += 1; [INFO] [stdout] 160 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/replay.rs:163:29 [INFO] [stdout] | [INFO] [stdout] 163 | / ... if self.current_index > 0 { [INFO] [stdout] 164 | | ... self.current_index -= 1; [INFO] [stdout] 165 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 162 ~ KeyCode::Left | KeyCode::Char('p') [INFO] [stdout] 163 ~ if self.current_index > 0 => { [INFO] [stdout] 164 | self.current_index -= 1; [INFO] [stdout] 165 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/game/mod.rs:107:31 [INFO] [stdout] | [INFO] [stdout] 107 | state.last_move = self.board.last_move.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.board.last_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:161:34 [INFO] [stdout] | [INFO] [stdout] 161 | best_move = Some(legal_moves[0].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `legal_moves[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/game/mod.rs:220:35 [INFO] [stdout] | [INFO] [stdout] 220 | self.history.push(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try removing the `clone` call: `mv` [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 boolean expression can be simplified [INFO] [stdout] --> src/player/ai/alpha_beta.rs:327:24 [INFO] [stdout] | [INFO] [stdout] 327 | && !is_promote_move.is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_promote_move.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: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:375:34 [INFO] [stdout] | [INFO] [stdout] 375 | best_move = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:391:43 [INFO] [stdout] | [INFO] [stdout] 391 | killers[ply][1] = killers[ply][0].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `killers[ply][0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:392:48 [INFO] [stdout] | [INFO] [stdout] 392 | killers[ply][0] = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Option; 2]` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:419:13 [INFO] [stdout] | [INFO] [stdout] 419 | self.killer_moves.borrow()[ply].clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.killer_moves.borrow()[ply]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logic/mod.rs:39:41 [INFO] [stdout] | [INFO] [stdout] 39 | / ... if (player == PlayerId::Player1 && y == 0) [INFO] [stdout] 40 | | ... || (player == PlayerId::Player2 && y == 8) [INFO] [stdout] 41 | | ... { [INFO] [stdout] 42 | | ... continue; [INFO] [stdout] 43 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 38 ~ PieceKind::S_Pawn | PieceKind::S_Lance [INFO] [stdout] 39 ~ if ((player == PlayerId::Player1 && y == 0) [INFO] [stdout] 40 ~ || (player == PlayerId::Player2 && y == 8)) [INFO] [stdout] 41 ~ => { [INFO] [stdout] 42 | continue; [INFO] [stdout] 43 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/logic/mod.rs:46:41 [INFO] [stdout] | [INFO] [stdout] 46 | / ... if (player == PlayerId::Player1 && y <= 1) [INFO] [stdout] 47 | | ... || (player == PlayerId::Player2 && y >= 7) [INFO] [stdout] 48 | | ... { [INFO] [stdout] 49 | | ... continue; [INFO] [stdout] 50 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 45 ~ PieceKind::S_Knight [INFO] [stdout] 46 ~ if ((player == PlayerId::Player1 && y <= 1) [INFO] [stdout] 47 ~ || (player == PlayerId::Player2 && y >= 7)) [INFO] [stdout] 48 ~ => { [INFO] [stdout] 49 | continue; [INFO] [stdout] 50 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/logic/mod.rs:312:27 [INFO] [stdout] | [INFO] [stdout] 312 | next.last_move = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [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: name `ONNX` contains a capitalized acronym [INFO] [stdout] --> src/ml/model_registry.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | ONNX, [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Onnx` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> src/ml/model_registry.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | / for entry in entries { [INFO] [stdout] 64 | | if let Ok(entry) = entry { [INFO] [stdout] 65 | | let path = entry.path(); [INFO] [stdout] ... | [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/ml/model_registry.rs:64:21 [INFO] [stdout] | [INFO] [stdout] 64 | / if let Ok(entry) = entry { [INFO] [stdout] 65 | | let path = entry.path(); [INFO] [stdout] 66 | | [INFO] [stdout] 67 | | if path.is_dir() { [INFO] [stdout] ... | [INFO] [stdout] 129 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 63 ~ for entry in entries.flatten() { [INFO] [stdout] 64 + let path = entry.path(); [INFO] [stdout] 65 + [INFO] [stdout] 66 + if path.is_dir() { [INFO] [stdout] 67 + dirs_to_visit.push(path); [INFO] [stdout] 68 + continue; [INFO] [stdout] 69 + } [INFO] [stdout] 70 + [INFO] [stdout] 71 + let extension = path.extension().and_then(|s| s.to_str()); [INFO] [stdout] 72 + let model_type = match extension { [INFO] [stdout] 73 + Some("onnx") => Some(ModelType::ONNX), [INFO] [stdout] 74 + _ => None, [INFO] [stdout] 75 + }; [INFO] [stdout] 76 + [INFO] [stdout] 77 + if let Some(model_type) = model_type { [INFO] [stdout] 78 + // Calculate relative name from base directory [INFO] [stdout] 79 + let relative_path = path.strip_prefix(models_dir).unwrap_or(&path); [INFO] [stdout] 80 + let mut name = relative_path [INFO] [stdout] 81 + .with_extension("") // Remove .onnx [INFO] [stdout] 82 + .to_string_lossy() [INFO] [stdout] 83 + .into_owned(); [INFO] [stdout] 84 + [INFO] [stdout] 85 + // Strip "model" from end if it exists (e.g. Fair/v1.0/model -> Fair/v1.0) [INFO] [stdout] 86 + if name.ends_with("/model") { [INFO] [stdout] 87 + name = name.strip_suffix("/model").unwrap().to_string(); [INFO] [stdout] 88 + } else if name == "model" { [INFO] [stdout] 89 + // Keep it if it's just "model" at the root, or handle as needed [INFO] [stdout] 90 + } [INFO] [stdout] 91 + [INFO] [stdout] 92 + let version = { [INFO] [stdout] 93 + #[cfg(feature = "ml")] [INFO] [stdout] 94 + { [INFO] [stdout] 95 + // Try to load session to read metadata [INFO] [stdout] 96 + if let Ok(session) = [INFO] [stdout] 97 + Session::builder().and_then(|b| b.commit_from_file(&path)) [INFO] [stdout] 98 + { [INFO] [stdout] 99 + if let Ok(metadata) = session.metadata() { [INFO] [stdout] 100 + if let Ok(Some(version)) = metadata.custom("version") { [INFO] [stdout] 101 + Some(version) [INFO] [stdout] 102 + } else { [INFO] [stdout] 103 + None [INFO] [stdout] 104 + } [INFO] [stdout] 105 + } else { [INFO] [stdout] 106 + None [INFO] [stdout] 107 + } [INFO] [stdout] 108 + } else { [INFO] [stdout] 109 + None [INFO] [stdout] 110 + } [INFO] [stdout] 111 + } [INFO] [stdout] 112 + #[cfg(not(feature = "ml"))] [INFO] [stdout] 113 + { [INFO] [stdout] 114 + None [INFO] [stdout] 115 + } [INFO] [stdout] 116 + }; [INFO] [stdout] 117 + [INFO] [stdout] 118 + let metadata = ModelMetadata { [INFO] [stdout] 119 + name: name.clone(), [INFO] [stdout] 120 + model_type, [INFO] [stdout] 121 + path: path.clone(), [INFO] [stdout] 122 + version, [INFO] [stdout] 123 + created_at: None, [INFO] [stdout] 124 + }; [INFO] [stdout] 125 + [INFO] [stdout] 126 + self.register(metadata); [INFO] [stdout] 127 + } [INFO] [stdout] 128 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> src/player/ai/eval.rs:481:19 [INFO] [stdout] | [INFO] [stdout] 481 | while check_y >= 0 && check_y < 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..9).contains(&check_y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player/ai/see.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | / if piece.owner == attacker { [INFO] [stdout] 59 | | if can_piece_attack(board, pos, target, piece.kind, attacker) { [INFO] [stdout] 60 | | count += 1; [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [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] 58 ~ if piece.owner == attacker [INFO] [stdout] 59 ~ && can_piece_attack(board, pos, target, piece.kind, attacker) { [INFO] [stdout] 60 | count += 1; [INFO] [stdout] 61 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/player/ai/see.rs:100:13 [INFO] [stdout] | [INFO] [stdout] 100 | / (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 | | (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 100 - (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 - (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] 100 + !(dy != forward || dx != 0 && dx.abs() != 1) || // Forward diagonals [INFO] [stdout] | [INFO] [stdout] 100 - (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 - (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] 100 + (dx.abs() == 1 || dx == 0) && dy == forward || // Forward diagonals [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!Range::contains` implementation [INFO] [stdout] --> src/player/ai/see.rs:175:31 [INFO] [stdout] | [INFO] [stdout] 175 | if x < 0 || x >= 9 || y < 0 || y >= 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `!(0..9).contains(&y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!Range::contains` implementation [INFO] [stdout] --> src/player/ai/see.rs:175:12 [INFO] [stdout] | [INFO] [stdout] 175 | if x < 0 || x >= 9 || y < 0 || y >= 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `!(0..9).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/tt.rs:59:38 [INFO] [stdout] | [INFO] [stdout] 59 | return Some((*entry, mv.clone())); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:36:24 [INFO] [stdout] | [INFO] [stdout] 36 | last_move: board.last_move.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `board.last_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:192:66 [INFO] [stdout] | [INFO] [stdout] 192 | ... Some((k, m.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*m` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:213:65 [INFO] [stdout] | [INFO] [stdout] 213 | ... promote_options[0].1.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `promote_options[0].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:267:69 [INFO] [stdout] | [INFO] [stdout] 267 | / ... promote_options [INFO] [stdout] 268 | | ... [digit as usize - 1] [INFO] [stdout] 269 | | ... .1 [INFO] [stdout] 270 | | ... .clone(), [INFO] [stdout] | |__________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try removing the `clone` call [INFO] [stdout] | [INFO] [stdout] 267 ~ promote_options [INFO] [stdout] 268 + [digit as usize - 1] [INFO] [stdout] 269 ~ .1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:278:53 [INFO] [stdout] | [INFO] [stdout] 278 | ... return Some(found_moves[0].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `found_moves[0]` [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: casting to the same type is unnecessary (`u128` -> `u128`) [INFO] [stdout] --> src/selfplay/mod.rs:184:61 [INFO] [stdout] | [INFO] [stdout] 184 | let total_time: u128 = thinking_data.iter().map(|t| t.time_ms as u128).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `t.time_ms` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:161:34 [INFO] [stdout] | [INFO] [stdout] 161 | best_move = Some(legal_moves[0].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `legal_moves[0]` [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 boolean expression can be simplified [INFO] [stdout] --> src/player/ai/alpha_beta.rs:327:24 [INFO] [stdout] | [INFO] [stdout] 327 | && !is_promote_move.is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_promote_move.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: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:375:34 [INFO] [stdout] | [INFO] [stdout] 375 | best_move = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:391:43 [INFO] [stdout] | [INFO] [stdout] 391 | killers[ply][1] = killers[ply][0].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `killers[ply][0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:392:48 [INFO] [stdout] | [INFO] [stdout] 392 | killers[ply][0] = Some(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[Option; 2]` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/alpha_beta.rs:419:13 [INFO] [stdout] | [INFO] [stdout] 419 | self.killer_moves.borrow()[ply].clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.killer_moves.borrow()[ply]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/selfplay/mod.rs:505:12 [INFO] [stdout] | [INFO] [stdout] 505 | if moves % update_interval == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `moves.is_multiple_of(update_interval)` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/selfplay/mod.rs:592:27 [INFO] [stdout] | [INFO] [stdout] 592 | let resigned = if let Some(_) = winner { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if winner.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/selfplay/mod.rs:719:16 [INFO] [stdout] | [INFO] [stdout] 719 | if pseudo_legal.len() > 0 && pseudo_legal.len() <= 5 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!pseudo_legal.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: manual `Range::contains` implementation [INFO] [stdout] --> src/player/ai/eval.rs:481:19 [INFO] [stdout] | [INFO] [stdout] 481 | while check_y >= 0 && check_y < 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..9).contains(&check_y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:287:25 [INFO] [stdout] | [INFO] [stdout] 287 | / if !self.files.is_empty() { [INFO] [stdout] 288 | | return Ok(Some(self.files[self.selected_index].path.clone())); [INFO] [stdout] 289 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 286 ~ KeyCode::Enter [INFO] [stdout] 287 ~ if !self.files.is_empty() => { [INFO] [stdout] 288 | return Ok(Some(self.files[self.selected_index].path.clone())); [INFO] [stdout] 289 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:292:25 [INFO] [stdout] | [INFO] [stdout] 292 | / if self.selected_index > 0 { [INFO] [stdout] 293 | | self.selected_index -= 1; [INFO] [stdout] 294 | | self.update_scroll(); [INFO] [stdout] 295 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 291 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 292 ~ if self.selected_index > 0 => { [INFO] [stdout] 293 | self.selected_index -= 1; [INFO] [stdout] 294 | self.update_scroll(); [INFO] [stdout] 295 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:298:25 [INFO] [stdout] | [INFO] [stdout] 298 | / if self.selected_index < self.files.len().saturating_sub(1) { [INFO] [stdout] 299 | | self.selected_index += 1; [INFO] [stdout] 300 | | self.update_scroll(); [INFO] [stdout] 301 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 297 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 298 ~ if self.selected_index < self.files.len().saturating_sub(1) => { [INFO] [stdout] 299 | self.selected_index += 1; [INFO] [stdout] 300 | self.update_scroll(); [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/ui/selection.rs:10:6 [INFO] [stdout] | [INFO] [stdout] 10 | ) -> anyhow::Result<( [INFO] [stdout] | ______^ [INFO] [stdout] 11 | | Box, [INFO] [stdout] 12 | | Box, [INFO] [stdout] 13 | | PerspectiveMode, [INFO] [stdout] 14 | | )> { [INFO] [stdout] | |__^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player/ai/see.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | / if piece.owner == attacker { [INFO] [stdout] 59 | | if can_piece_attack(board, pos, target, piece.kind, attacker) { [INFO] [stdout] 60 | | count += 1; [INFO] [stdout] 61 | | } [INFO] [stdout] 62 | | } [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] 58 ~ if piece.owner == attacker [INFO] [stdout] 59 ~ && can_piece_attack(board, pos, target, piece.kind, attacker) { [INFO] [stdout] 60 | count += 1; [INFO] [stdout] 61 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/player/ai/see.rs:100:13 [INFO] [stdout] | [INFO] [stdout] 100 | / (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 | | (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 100 - (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 - (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] 100 + !(dy != forward || dx != 0 && dx.abs() != 1) || // Forward diagonals [INFO] [stdout] | [INFO] [stdout] 100 - (dx == 0 && dy == forward) || // Forward [INFO] [stdout] 101 - (dx.abs() == 1 && dy == forward) || // Forward diagonals [INFO] [stdout] 100 + (dx.abs() == 1 || dx == 0) && dy == forward || // Forward diagonals [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/selection.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if selected_idx > 0 { [INFO] [stdout] 121 | | selected_idx -= 1; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ KeyCode::Up [INFO] [stdout] 120 ~ if selected_idx > 0 => { [INFO] [stdout] 121 | selected_idx -= 1; [INFO] [stdout] 122 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/selection.rs:125:25 [INFO] [stdout] | [INFO] [stdout] 125 | / if selected_idx < models.len() - 1 { [INFO] [stdout] 126 | | selected_idx += 1; [INFO] [stdout] 127 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 124 ~ KeyCode::Down [INFO] [stdout] 125 ~ if selected_idx < models.len() - 1 => { [INFO] [stdout] 126 | selected_idx += 1; [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/ui/selection.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if selected_idx > 0 { [INFO] [stdout] 121 | | selected_idx -= 1; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_________________________^ help: try: `selected_idx = selected_idx.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!Range::contains` implementation [INFO] [stdout] --> src/player/ai/see.rs:175:31 [INFO] [stdout] | [INFO] [stdout] 175 | if x < 0 || x >= 9 || y < 0 || y >= 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `!(0..9).contains(&y)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!Range::contains` implementation [INFO] [stdout] --> src/player/ai/see.rs:175:12 [INFO] [stdout] | [INFO] [stdout] 175 | if x < 0 || x >= 9 || y < 0 || y >= 9 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `!(0..9).contains(&x)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/ai/tt.rs:59:38 [INFO] [stdout] | [INFO] [stdout] 59 | return Some((*entry, mv.clone())); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:36:24 [INFO] [stdout] | [INFO] [stdout] 36 | last_move: board.last_move.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `board.last_move` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/mod.rs:36:25 [INFO] [stdout] | [INFO] [stdout] 36 | / if !input.is_empty() { [INFO] [stdout] 37 | | input.pop(); [INFO] [stdout] 38 | | print!("\u{0008} \u{0008}"); [INFO] [stdout] 39 | | io::stdout().flush()?; [INFO] [stdout] 40 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ KeyCode::Backspace [INFO] [stdout] 36 ~ if !input.is_empty() => { [INFO] [stdout] 37 | input.pop(); [INFO] [stdout] 38 | print!("\u{0008} \u{0008}"); [INFO] [stdout] 39 | io::stdout().flush()?; [INFO] [stdout] 40 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:192:66 [INFO] [stdout] | [INFO] [stdout] 192 | ... Some((k, m.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*m` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:213:65 [INFO] [stdout] | [INFO] [stdout] 213 | ... promote_options[0].1.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `promote_options[0].1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/mod.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | / if selected_index < files_with_labels.len() - 1 { [INFO] [stdout] 146 | | selected_index += 1; [INFO] [stdout] 147 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 144 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 145 ~ if selected_index < files_with_labels.len() - 1 => { [INFO] [stdout] 146 | selected_index += 1; [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:267:69 [INFO] [stdout] | [INFO] [stdout] 267 | / ... promote_options [INFO] [stdout] 268 | | ... [digit as usize - 1] [INFO] [stdout] 269 | | ... .1 [INFO] [stdout] 270 | | ... .clone(), [INFO] [stdout] | |__________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try removing the `clone` call [INFO] [stdout] | [INFO] [stdout] 267 ~ promote_options [INFO] [stdout] 268 + [digit as usize - 1] [INFO] [stdout] 269 ~ .1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/player/tui.rs:278:53 [INFO] [stdout] | [INFO] [stdout] 278 | ... return Some(found_moves[0].clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `found_moves[0]` [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: casting to the same type is unnecessary (`u128` -> `u128`) [INFO] [stdout] --> src/selfplay/mod.rs:184:61 [INFO] [stdout] | [INFO] [stdout] 184 | let total_time: u128 = thinking_data.iter().map(|t| t.time_ms as u128).sum(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `t.time_ms` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:239:36 [INFO] [stdout] | [INFO] [stdout] 239 | let _ = local_move_tx.send(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/main.rs:292:9 [INFO] [stdout] | [INFO] [stdout] 292 | / loop { [INFO] [stdout] 293 | | match selector.run()? { [INFO] [stdout] 294 | | Some(selected_path) => { [INFO] [stdout] ... | [INFO] [stdout] 306 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(selected_path) = selector.run()? { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:377:25 [INFO] [stdout] | [INFO] [stdout] 377 | / if !num_input.is_empty() { [INFO] [stdout] 378 | | num_input.pop(); [INFO] [stdout] 379 | | print!("\u{0008} \u{0008}"); [INFO] [stdout] 380 | | std::io::Write::flush(&mut std::io::stdout())?; [INFO] [stdout] 381 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 376 ~ KeyCode::Backspace [INFO] [stdout] 377 ~ if !num_input.is_empty() => { [INFO] [stdout] 378 | num_input.pop(); [INFO] [stdout] 379 | print!("\u{0008} \u{0008}"); [INFO] [stdout] 380 | std::io::Write::flush(&mut std::io::stdout())?; [INFO] [stdout] 381 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/selfplay/mod.rs:505:12 [INFO] [stdout] | [INFO] [stdout] 505 | if moves % update_interval == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `moves.is_multiple_of(update_interval)` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/selfplay/mod.rs:592:27 [INFO] [stdout] | [INFO] [stdout] 592 | let resigned = if let Some(_) = winner { [INFO] [stdout] | -------^^^^^^^--------- help: try: `if winner.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/selfplay/mod.rs:719:16 [INFO] [stdout] | [INFO] [stdout] 719 | if pseudo_legal.len() > 0 && pseudo_legal.len() <= 5 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!pseudo_legal.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 `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:287:25 [INFO] [stdout] | [INFO] [stdout] 287 | / if !self.files.is_empty() { [INFO] [stdout] 288 | | return Ok(Some(self.files[self.selected_index].path.clone())); [INFO] [stdout] 289 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 286 ~ KeyCode::Enter [INFO] [stdout] 287 ~ if !self.files.is_empty() => { [INFO] [stdout] 288 | return Ok(Some(self.files[self.selected_index].path.clone())); [INFO] [stdout] 289 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:292:25 [INFO] [stdout] | [INFO] [stdout] 292 | / if self.selected_index > 0 { [INFO] [stdout] 293 | | self.selected_index -= 1; [INFO] [stdout] 294 | | self.update_scroll(); [INFO] [stdout] 295 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 291 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 292 ~ if self.selected_index > 0 => { [INFO] [stdout] 293 | self.selected_index -= 1; [INFO] [stdout] 294 | self.update_scroll(); [INFO] [stdout] 295 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/kifu_selector.rs:298:25 [INFO] [stdout] | [INFO] [stdout] 298 | / if self.selected_index < self.files.len().saturating_sub(1) { [INFO] [stdout] 299 | | self.selected_index += 1; [INFO] [stdout] 300 | | self.update_scroll(); [INFO] [stdout] 301 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 297 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 298 ~ if self.selected_index < self.files.len().saturating_sub(1) => { [INFO] [stdout] 299 | self.selected_index += 1; [INFO] [stdout] 300 | self.update_scroll(); [INFO] [stdout] 301 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/ui/selection.rs:10:6 [INFO] [stdout] | [INFO] [stdout] 10 | ) -> anyhow::Result<( [INFO] [stdout] | ______^ [INFO] [stdout] 11 | | Box, [INFO] [stdout] 12 | | Box, [INFO] [stdout] 13 | | PerspectiveMode, [INFO] [stdout] 14 | | )> { [INFO] [stdout] | |__^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/selection.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if selected_idx > 0 { [INFO] [stdout] 121 | | selected_idx -= 1; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ KeyCode::Up [INFO] [stdout] 120 ~ if selected_idx > 0 => { [INFO] [stdout] 121 | selected_idx -= 1; [INFO] [stdout] 122 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/selection.rs:125:25 [INFO] [stdout] | [INFO] [stdout] 125 | / if selected_idx < models.len() - 1 { [INFO] [stdout] 126 | | selected_idx += 1; [INFO] [stdout] 127 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 124 ~ KeyCode::Down [INFO] [stdout] 125 ~ if selected_idx < models.len() - 1 => { [INFO] [stdout] 126 | selected_idx += 1; [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implicitly performing saturating subtraction [INFO] [stdout] --> src/ui/selection.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if selected_idx > 0 { [INFO] [stdout] 121 | | selected_idx -= 1; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_________________________^ help: try: `selected_idx = selected_idx.saturating_sub(1);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/mod.rs:36:25 [INFO] [stdout] | [INFO] [stdout] 36 | / if !input.is_empty() { [INFO] [stdout] 37 | | input.pop(); [INFO] [stdout] 38 | | print!("\u{0008} \u{0008}"); [INFO] [stdout] 39 | | io::stdout().flush()?; [INFO] [stdout] 40 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ KeyCode::Backspace [INFO] [stdout] 36 ~ if !input.is_empty() => { [INFO] [stdout] 37 | input.pop(); [INFO] [stdout] 38 | print!("\u{0008} \u{0008}"); [INFO] [stdout] 39 | io::stdout().flush()?; [INFO] [stdout] 40 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/mod.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | / if selected_index < files_with_labels.len() - 1 { [INFO] [stdout] 146 | | selected_index += 1; [INFO] [stdout] 147 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 144 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 145 ~ if selected_index < files_with_labels.len() - 1 => { [INFO] [stdout] 146 | selected_index += 1; [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Move` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:239:36 [INFO] [stdout] | [INFO] [stdout] 239 | let _ = local_move_tx.send(mv.clone()); [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*mv` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/main.rs:292:9 [INFO] [stdout] | [INFO] [stdout] 292 | / loop { [INFO] [stdout] 293 | | match selector.run()? { [INFO] [stdout] 294 | | Some(selected_path) => { [INFO] [stdout] ... | [INFO] [stdout] 306 | | } [INFO] [stdout] | |_________^ help: try: `while let Some(selected_path) = selector.run()? { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:377:25 [INFO] [stdout] | [INFO] [stdout] 377 | / if !num_input.is_empty() { [INFO] [stdout] 378 | | num_input.pop(); [INFO] [stdout] 379 | | print!("\u{0008} \u{0008}"); [INFO] [stdout] 380 | | std::io::Write::flush(&mut std::io::stdout())?; [INFO] [stdout] 381 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 376 ~ KeyCode::Backspace [INFO] [stdout] 377 ~ if !num_input.is_empty() => { [INFO] [stdout] 378 | num_input.pop(); [INFO] [stdout] 379 | print!("\u{0008} \u{0008}"); [INFO] [stdout] 380 | std::io::Write::flush(&mut std::io::stdout())?; [INFO] [stdout] 381 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 8.34s [INFO] running `Command { std: "docker" "inspect" "429ae60645f5e1e7d89d2ad78dc66200c52208c9335a0f4a1a20d178ad60e069", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "429ae60645f5e1e7d89d2ad78dc66200c52208c9335a0f4a1a20d178ad60e069", kill_on_drop: false }` [INFO] [stdout] 429ae60645f5e1e7d89d2ad78dc66200c52208c9335a0f4a1a20d178ad60e069