[INFO] cloning repository https://github.com/TanKimzeg/uno [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/TanKimzeg/uno" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTanKimzeg%2Funo", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTanKimzeg%2Funo'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c522ea5f51ac68ca250f52bfb5c6a84a47b9f0c0 [INFO] linting TanKimzeg/uno against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FTanKimzeg%2Funo" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/TanKimzeg/uno [INFO] finished tweaking git repo https://github.com/TanKimzeg/uno [INFO] tweaked toml for git repo https://github.com/TanKimzeg/uno written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/TanKimzeg/uno 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/TanKimzeg/uno 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 proc-macro2 v1.0.97 [INFO] [stderr] Downloaded stability v0.2.1 [INFO] [stderr] Downloaded io-uring v0.7.9 [INFO] [stderr] Downloaded serde_json v1.0.142 [INFO] [stderr] Downloaded ratatui v0.26.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] abc7a00f6b4c680577d984917108b115ebd049551385534abb54fc4335924c8d [INFO] running `Command { std: "docker" "start" "-a" "abc7a00f6b4c680577d984917108b115ebd049551385534abb54fc4335924c8d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "abc7a00f6b4c680577d984917108b115ebd049551385534abb54fc4335924c8d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "abc7a00f6b4c680577d984917108b115ebd049551385534abb54fc4335924c8d", kill_on_drop: false }` [INFO] [stdout] abc7a00f6b4c680577d984917108b115ebd049551385534abb54fc4335924c8d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 65e32012c3bef77cdd837cda3d8caea6f3cf58c55fa94ecf0c70760f05e24e62 [INFO] running `Command { std: "docker" "start" "-a" "65e32012c3bef77cdd837cda3d8caea6f3cf58c55fa94ecf0c70760f05e24e62", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.175 [INFO] [stderr] Compiling proc-macro2 v1.0.97 [INFO] [stderr] Checking cfg-if v1.0.1 [INFO] [stderr] Compiling zerocopy v0.8.26 [INFO] [stderr] Checking futures-channel v0.3.31 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Checking castaway v0.2.4 [INFO] [stderr] Compiling serde_json v1.0.142 [INFO] [stderr] Compiling anyhow v1.0.99 [INFO] [stderr] Checking bitflags v2.9.1 [INFO] [stderr] Checking compact_str v0.7.1 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking signal-hook-registry v1.4.6 [INFO] [stderr] Checking parking_lot_core v0.9.11 [INFO] [stderr] Checking mio v0.8.11 [INFO] [stderr] Checking socket2 v0.6.0 [INFO] [stderr] Compiling syn v2.0.104 [INFO] [stderr] Checking parking_lot v0.12.4 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking signal-hook v0.3.18 [INFO] [stderr] Checking mio v1.0.4 [INFO] [stderr] Checking nanorand v0.7.0 [INFO] [stderr] Checking signal-hook-mio v0.2.4 [INFO] [stderr] Checking unicode-truncate v1.1.0 [INFO] [stderr] Checking flume v0.11.1 [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 futures-macro v0.3.31 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling stability v0.2.1 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking tokio v1.47.1 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Checking ratatui v0.26.3 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking serde v1.0.219 [INFO] [stderr] Checking tokio-util v0.7.16 [INFO] [stderr] Checking uno v0.2.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `uno_game` [INFO] [stdout] --> src/game/uno_game.rs:1:29 [INFO] [stdout] | [INFO] [stdout] 1 | use crate::game::{cards::*, uno_game}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | player_id: player_id, card: card.clone() }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:228:38 [INFO] [stdout] | [INFO] [stdout] 228 | ev.push(GE::UnoPenalty { player_id: player_id }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:231:37 [INFO] [stdout] | [INFO] [stdout] 231 | ev.push(GE::UnoCalled { player_id: player_id }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:257:25 [INFO] [stdout] | [INFO] [stdout] 257 | player_id: player_id, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:273:36 [INFO] [stdout] | [INFO] [stdout] 273 | ev.push(GE::PlayerPassed { player_id: player_id }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `uno_game` [INFO] [stdout] --> src/game/uno_game.rs:1:29 [INFO] [stdout] | [INFO] [stdout] 1 | use crate::game::{cards::*, uno_game}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | player_id: player_id, card: card.clone() }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:228:38 [INFO] [stdout] | [INFO] [stdout] 228 | ev.push(GE::UnoPenalty { player_id: player_id }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:231:37 [INFO] [stdout] | [INFO] [stdout] 231 | ev.push(GE::UnoCalled { player_id: player_id }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:257:25 [INFO] [stdout] | [INFO] [stdout] 257 | player_id: player_id, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game/uno_game.rs:273:36 [INFO] [stdout] | [INFO] [stdout] 273 | ev.push(GE::PlayerPassed { player_id: player_id }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `player_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `previous_player` and `challenge` are never used [INFO] [stdout] --> src/game/uno_game.rs:127:8 [INFO] [stdout] | [INFO] [stdout] 14 | impl UnoGame { [INFO] [stdout] | ------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 127 | fn previous_player(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 306 | fn challenge(&mut self, challenger_id: usize, challenged_id: usize) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UnoGame` [INFO] [stdout] --> src/game/uno_game.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / pub fn new() -> UnoGame{ [INFO] [stdout] 16 | | let mut d = UnoDeck::new(); [INFO] [stdout] 17 | | d.shuffle(); [INFO] [stdout] 18 | | UnoGame { [INFO] [stdout] ... | [INFO] [stdout] 26 | | } [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] 14 + impl Default for UnoGame { [INFO] [stdout] 15 + fn default() -> Self { [INFO] [stdout] 16 + Self::new() [INFO] [stdout] 17 + } [INFO] [stdout] 18 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `previous_player` and `challenge` are never used [INFO] [stdout] --> src/game/uno_game.rs:127:8 [INFO] [stdout] | [INFO] [stdout] 14 | impl UnoGame { [INFO] [stdout] | ------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 127 | fn previous_player(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 306 | fn challenge(&mut self, challenger_id: usize, challenged_id: usize) -> Vec { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UnoGame` [INFO] [stdout] --> src/game/uno_game.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / pub fn new() -> UnoGame{ [INFO] [stdout] 16 | | let mut d = UnoDeck::new(); [INFO] [stdout] 17 | | d.shuffle(); [INFO] [stdout] 18 | | UnoGame { [INFO] [stdout] ... | [INFO] [stdout] 26 | | } [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] 14 + impl Default for UnoGame { [INFO] [stdout] 15 + fn default() -> Self { [INFO] [stdout] 16 + Self::new() [INFO] [stdout] 17 + } [INFO] [stdout] 18 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/game/uno_game.rs:56:20 [INFO] [stdout] | [INFO] [stdout] 56 | if !card.get_number().is_none(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `card.get_number().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/game/uno_game.rs:56:20 [INFO] [stdout] | [INFO] [stdout] 56 | if !card.get_number().is_none(){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `card.get_number().is_some()` [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 `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:58:60 [INFO] [stdout] | [INFO] [stdout] 58 | ev.push(GE::TopCardChanged { top_card: self.top_card. [INFO] [stdout] | ____________________________________________________________^ [INFO] [stdout] 59 | | expect("Top card should be set").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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] help: try removing the `clone` call [INFO] [stdout] | [INFO] [stdout] 58 ~ ev.push(GE::TopCardChanged { top_card: self.top_card. [INFO] [stdout] 59 ~ expect("Top card should be set") }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game/uno_game.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | return Ok(card); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 112 - return Ok(card); [INFO] [stdout] 112 + Ok(card) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game/uno_game.rs:115:13 [INFO] [stdout] | [INFO] [stdout] 115 | return Err("No more cards in the deck to draw!".to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 115 - return Err("No more cards in the deck to draw!".to_string()); [INFO] [stdout] 115 + Err("No more cards in the deck to draw!".to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:156:20 [INFO] [stdout] | [INFO] [stdout] 156 | let card = hand[card_idx].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `hand[card_idx]` [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 `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:169:30 [INFO] [stdout] | [INFO] [stdout] 169 | self.top_card = Some(card.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `card` [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 `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:171:41 [INFO] [stdout] | [INFO] [stdout] 171 | player_id: player_id, card: card.clone() }); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `card` [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 `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:172:48 [INFO] [stdout] | [INFO] [stdout] 172 | ev.push(GE::TopCardChanged { top_card: self.top_card. [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 173 | | expect("Top card should be set").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] 172 ~ ev.push(GE::TopCardChanged { top_card: self.top_card. [INFO] [stdout] 173 ~ expect("Top card should be set") }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/uno_game.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | / match wt { [INFO] [stdout] 204 | | WildType::DRAWFOUR => { [INFO] [stdout] 205 | | let affected_player = self.next_player(); [INFO] [stdout] 206 | | ev.push(GE::DrawFourApplied { [INFO] [stdout] ... | [INFO] [stdout] 211 | | _ => { } [INFO] [stdout] 212 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/game/uno_game.rs:202:34 [INFO] [stdout] | [INFO] [stdout] 202 | UnoCard::WildCard(_, wt) => { [INFO] [stdout] | ^^ replace this binding [INFO] [stdout] 203 | match wt { [INFO] [stdout] 204 | WildType::DRAWFOUR => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:58:60 [INFO] [stdout] | [INFO] [stdout] 58 | ev.push(GE::TopCardChanged { top_card: self.top_card. [INFO] [stdout] | ____________________________________________________________^ [INFO] [stdout] 59 | | expect("Top card should be set").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] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] help: try removing the `clone` call [INFO] [stdout] | [INFO] [stdout] 58 ~ ev.push(GE::TopCardChanged { top_card: self.top_card. [INFO] [stdout] 59 ~ expect("Top card should be set") }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/game/uno_game.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | / match wt { [INFO] [stdout] 204 | | WildType::DRAWFOUR => { [INFO] [stdout] 205 | | let affected_player = self.next_player(); [INFO] [stdout] 206 | | ev.push(GE::DrawFourApplied { [INFO] [stdout] ... | [INFO] [stdout] 211 | | _ => { } [INFO] [stdout] 212 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 203 ~ if wt == WildType::DRAWFOUR { [INFO] [stdout] 204 + let affected_player = self.next_player(); [INFO] [stdout] 205 + ev.push(GE::DrawFourApplied { [INFO] [stdout] 206 + target_player_id: self.players[affected_player].id }); [INFO] [stdout] 207 + ev.extend( self.cards_distribution(affected_player, 4) ); [INFO] [stdout] 208 + self.current_player = self.next_player(); [INFO] [stdout] 209 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:253:61 [INFO] [stdout] | [INFO] [stdout] 253 | self.players[self.current_player].push_card(drawn_card.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `drawn_card` [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: unneeded `return` statement [INFO] [stdout] --> src/game/uno_game.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | return Ok(card); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 112 - return Ok(card); [INFO] [stdout] 112 + Ok(card) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game/uno_game.rs:115:13 [INFO] [stdout] | [INFO] [stdout] 115 | return Err("No more cards in the deck to draw!".to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 115 - return Err("No more cards in the deck to draw!".to_string()); [INFO] [stdout] 115 + Err("No more cards in the deck to draw!".to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/game/uno_game.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | scores.sort_by(|a, b| a.1.cmp(&b.1)); // 按分数升序排序 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 288 - scores.sort_by(|a, b| a.1.cmp(&b.1)); // 按分数升序排序 [INFO] [stdout] 288 + scores.sort_by_key(|a| a.1); // 按分数升序排序 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:156:20 [INFO] [stdout] | [INFO] [stdout] 156 | let card = hand[card_idx].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `hand[card_idx]` [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 `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:169:30 [INFO] [stdout] | [INFO] [stdout] 169 | self.top_card = Some(card.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `card` [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 `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:171:41 [INFO] [stdout] | [INFO] [stdout] 171 | player_id: player_id, card: card.clone() }); [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `card` [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 `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:172:48 [INFO] [stdout] | [INFO] [stdout] 172 | ev.push(GE::TopCardChanged { top_card: self.top_card. [INFO] [stdout] | ________________________________________________^ [INFO] [stdout] 173 | | expect("Top card should be set").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] 172 ~ ev.push(GE::TopCardChanged { top_card: self.top_card. [INFO] [stdout] 173 ~ expect("Top card should be set") }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/game/uno_game.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | / match wt { [INFO] [stdout] 204 | | WildType::DRAWFOUR => { [INFO] [stdout] 205 | | let affected_player = self.next_player(); [INFO] [stdout] 206 | | ev.push(GE::DrawFourApplied { [INFO] [stdout] ... | [INFO] [stdout] 211 | | _ => { } [INFO] [stdout] 212 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/game/uno_game.rs:202:34 [INFO] [stdout] | [INFO] [stdout] 202 | UnoCard::WildCard(_, wt) => { [INFO] [stdout] | ^^ replace this binding [INFO] [stdout] 203 | match wt { [INFO] [stdout] 204 | WildType::DRAWFOUR => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/game/uno_game.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | / match wt { [INFO] [stdout] 204 | | WildType::DRAWFOUR => { [INFO] [stdout] 205 | | let affected_player = self.next_player(); [INFO] [stdout] 206 | | ev.push(GE::DrawFourApplied { [INFO] [stdout] ... | [INFO] [stdout] 211 | | _ => { } [INFO] [stdout] 212 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 203 ~ if wt == WildType::DRAWFOUR { [INFO] [stdout] 204 + let affected_player = self.next_player(); [INFO] [stdout] 205 + ev.push(GE::DrawFourApplied { [INFO] [stdout] 206 + target_player_id: self.players[affected_player].id }); [INFO] [stdout] 207 + ev.extend( self.cards_distribution(affected_player, 4) ); [INFO] [stdout] 208 + self.current_player = self.next_player(); [INFO] [stdout] 209 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UnoCard` which implements the `Copy` trait [INFO] [stdout] --> src/game/uno_game.rs:253:61 [INFO] [stdout] | [INFO] [stdout] 253 | self.players[self.current_player].push_card(drawn_card.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `drawn_card` [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: consider using `sort_by_key` [INFO] [stdout] --> src/game/uno_game.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | scores.sort_by(|a, b| a.1.cmp(&b.1)); // 按分数升序排序 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 288 - scores.sort_by(|a, b| a.1.cmp(&b.1)); // 按分数升序排序 [INFO] [stdout] 288 + scores.sort_by_key(|a| a.1); // 按分数升序排序 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:49:22 [INFO] [stdout] | [INFO] [stdout] 49 | color.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:50:23 [INFO] [stdout] | [INFO] [stdout] 50 | number.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:53:54 [INFO] [stdout] | [INFO] [stdout] 53 | write!(f, "Action Card: {} {}", color.to_string(), action.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:53:74 [INFO] [stdout] | [INFO] [stdout] 53 | write!(f, "Action Card: {} {}", color.to_string(), action.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:57:54 [INFO] [stdout] | [INFO] [stdout] 57 | write!(f, " Wild Card: {} {}", c.to_string(), wild_type.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:57:77 [INFO] [stdout] | [INFO] [stdout] 57 | write!(f, " Wild Card: {} {}", c.to_string(), wild_type.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:59:59 [INFO] [stdout] | [INFO] [stdout] 59 | write!(f, " Wild Card: {}", wild_type.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/game/cards.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | / match card { [INFO] [stdout] 85 | | UnoCard::WildCard(_, _) => true, [INFO] [stdout] 86 | | _ => false, [INFO] [stdout] 87 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 84 - match card { [INFO] [stdout] 85 - UnoCard::WildCard(_, _) => true, [INFO] [stdout] 86 - _ => false, [INFO] [stdout] 87 - } [INFO] [stdout] 84 + matches!(card, UnoCard::WildCard(_, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/game/cards.rs:100:8 [INFO] [stdout] | [INFO] [stdout] 100 | if card_num == None || top_card_num == None || card.get_number() != top_card.get_number() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `card_num.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/game/cards.rs:100:28 [INFO] [stdout] | [INFO] [stdout] 100 | if card_num == None || top_card_num == None || card.get_number() != top_card.get_number() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `top_card_num.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:49:22 [INFO] [stdout] | [INFO] [stdout] 49 | color.to_string(), [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:50:23 [INFO] [stdout] | [INFO] [stdout] 50 | number.to_string() [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:53:54 [INFO] [stdout] | [INFO] [stdout] 53 | write!(f, "Action Card: {} {}", color.to_string(), action.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:53:74 [INFO] [stdout] | [INFO] [stdout] 53 | write!(f, "Action Card: {} {}", color.to_string(), action.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:218:45 [INFO] [stdout] | [INFO] [stdout] 218 | Number::ZERO => write!(f, "{}", "0")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] = note: `#[warn(clippy::write_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 218 - Number::ZERO => write!(f, "{}", "0")?, [INFO] [stdout] 218 + Number::ZERO => write!(f, "0")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:57:54 [INFO] [stdout] | [INFO] [stdout] 57 | write!(f, " Wild Card: {} {}", c.to_string(), wild_type.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:57:77 [INFO] [stdout] | [INFO] [stdout] 57 | write!(f, " Wild Card: {} {}", c.to_string(), wild_type.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:219:44 [INFO] [stdout] | [INFO] [stdout] 219 | Number::ONE => write!(f, "{}", "1")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 219 - Number::ONE => write!(f, "{}", "1")?, [INFO] [stdout] 219 + Number::ONE => write!(f, "1")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/cards.rs:59:59 [INFO] [stdout] | [INFO] [stdout] 59 | write!(f, " Wild Card: {}", wild_type.to_string())? [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:220:44 [INFO] [stdout] | [INFO] [stdout] 220 | Number::TWO => write!(f, "{}", "2")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 220 - Number::TWO => write!(f, "{}", "2")?, [INFO] [stdout] 220 + Number::TWO => write!(f, "2")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:221:46 [INFO] [stdout] | [INFO] [stdout] 221 | Number::THREE => write!(f, "{}", "3")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 221 - Number::THREE => write!(f, "{}", "3")?, [INFO] [stdout] 221 + Number::THREE => write!(f, "3")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/game/cards.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 84 | / match card { [INFO] [stdout] 85 | | UnoCard::WildCard(_, _) => true, [INFO] [stdout] 86 | | _ => false, [INFO] [stdout] 87 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 84 - match card { [INFO] [stdout] 85 - UnoCard::WildCard(_, _) => true, [INFO] [stdout] 86 - _ => false, [INFO] [stdout] 87 - } [INFO] [stdout] 84 + matches!(card, UnoCard::WildCard(_, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:222:45 [INFO] [stdout] | [INFO] [stdout] 222 | Number::FOUR => write!(f, "{}", "4")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 222 - Number::FOUR => write!(f, "{}", "4")?, [INFO] [stdout] 222 + Number::FOUR => write!(f, "4")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/game/cards.rs:100:8 [INFO] [stdout] | [INFO] [stdout] 100 | if card_num == None || top_card_num == None || card.get_number() != top_card.get_number() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `card_num.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:223:45 [INFO] [stdout] | [INFO] [stdout] 223 | Number::FIVE => write!(f, "{}", "5")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 223 - Number::FIVE => write!(f, "{}", "5")?, [INFO] [stdout] 223 + Number::FIVE => write!(f, "5")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/game/cards.rs:100:28 [INFO] [stdout] | [INFO] [stdout] 100 | if card_num == None || top_card_num == None || card.get_number() != top_card.get_number() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `top_card_num.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:224:44 [INFO] [stdout] | [INFO] [stdout] 224 | Number::SIX => write!(f, "{}", "6")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 224 - Number::SIX => write!(f, "{}", "6")?, [INFO] [stdout] 224 + Number::SIX => write!(f, "6")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:225:46 [INFO] [stdout] | [INFO] [stdout] 225 | Number::SEVEN => write!(f, "{}", "7")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 - Number::SEVEN => write!(f, "{}", "7")?, [INFO] [stdout] 225 + Number::SEVEN => write!(f, "7")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:226:46 [INFO] [stdout] | [INFO] [stdout] 226 | Number::EIGHT => write!(f, "{}", "8")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 226 - Number::EIGHT => write!(f, "{}", "8")?, [INFO] [stdout] 226 + Number::EIGHT => write!(f, "8")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:227:45 [INFO] [stdout] | [INFO] [stdout] 227 | Number::NINE => write!(f, "{}", "9")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 227 - Number::NINE => write!(f, "{}", "9")?, [INFO] [stdout] 227 + Number::NINE => write!(f, "9")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UnoDeck` [INFO] [stdout] --> src/game/cards.rs:292:5 [INFO] [stdout] | [INFO] [stdout] 292 | / pub fn new() -> UnoDeck { [INFO] [stdout] ... | [INFO] [stdout] 361 | | UnoDeck { cards } [INFO] [stdout] 362 | | } [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] help: try adding this [INFO] [stdout] | [INFO] [stdout] 291 + impl Default for UnoDeck { [INFO] [stdout] 292 + fn default() -> Self { [INFO] [stdout] 293 + Self::new() [INFO] [stdout] 294 + } [INFO] [stdout] 295 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:301:32 [INFO] [stdout] | [INFO] [stdout] 301 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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 `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:310:32 [INFO] [stdout] | [INFO] [stdout] 310 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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 `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:322:28 [INFO] [stdout] | [INFO] [stdout] 322 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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 `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:326:28 [INFO] [stdout] | [INFO] [stdout] 326 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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 `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:330:28 [INFO] [stdout] | [INFO] [stdout] 330 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:218:45 [INFO] [stdout] | [INFO] [stdout] 218 | Number::ZERO => write!(f, "{}", "0")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] = note: `#[warn(clippy::write_literal)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 218 - Number::ZERO => write!(f, "{}", "0")?, [INFO] [stdout] 218 + Number::ZERO => write!(f, "0")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:219:44 [INFO] [stdout] | [INFO] [stdout] 219 | Number::ONE => write!(f, "{}", "1")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 219 - Number::ONE => write!(f, "{}", "1")?, [INFO] [stdout] 219 + Number::ONE => write!(f, "1")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:220:44 [INFO] [stdout] | [INFO] [stdout] 220 | Number::TWO => write!(f, "{}", "2")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 220 - Number::TWO => write!(f, "{}", "2")?, [INFO] [stdout] 220 + Number::TWO => write!(f, "2")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:221:46 [INFO] [stdout] | [INFO] [stdout] 221 | Number::THREE => write!(f, "{}", "3")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 221 - Number::THREE => write!(f, "{}", "3")?, [INFO] [stdout] 221 + Number::THREE => write!(f, "3")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:222:45 [INFO] [stdout] | [INFO] [stdout] 222 | Number::FOUR => write!(f, "{}", "4")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 222 - Number::FOUR => write!(f, "{}", "4")?, [INFO] [stdout] 222 + Number::FOUR => write!(f, "4")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:223:45 [INFO] [stdout] | [INFO] [stdout] 223 | Number::FIVE => write!(f, "{}", "5")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 223 - Number::FIVE => write!(f, "{}", "5")?, [INFO] [stdout] 223 + Number::FIVE => write!(f, "5")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:224:44 [INFO] [stdout] | [INFO] [stdout] 224 | Number::SIX => write!(f, "{}", "6")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 224 - Number::SIX => write!(f, "{}", "6")?, [INFO] [stdout] 224 + Number::SIX => write!(f, "6")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:225:46 [INFO] [stdout] | [INFO] [stdout] 225 | Number::SEVEN => write!(f, "{}", "7")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 - Number::SEVEN => write!(f, "{}", "7")?, [INFO] [stdout] 225 + Number::SEVEN => write!(f, "7")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:226:46 [INFO] [stdout] | [INFO] [stdout] 226 | Number::EIGHT => write!(f, "{}", "8")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 226 - Number::EIGHT => write!(f, "{}", "8")?, [INFO] [stdout] 226 + Number::EIGHT => write!(f, "8")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: literal with an empty format string [INFO] [stdout] --> src/game/cards.rs:227:45 [INFO] [stdout] | [INFO] [stdout] 227 | Number::NINE => write!(f, "{}", "9")?, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_literal [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 227 - Number::NINE => write!(f, "{}", "9")?, [INFO] [stdout] 227 + Number::NINE => write!(f, "9")?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UnoDeck` [INFO] [stdout] --> src/game/cards.rs:292:5 [INFO] [stdout] | [INFO] [stdout] 292 | / pub fn new() -> UnoDeck { [INFO] [stdout] ... | [INFO] [stdout] 361 | | UnoDeck { cards } [INFO] [stdout] 362 | | } [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] help: try adding this [INFO] [stdout] | [INFO] [stdout] 291 + impl Default for UnoDeck { [INFO] [stdout] 292 + fn default() -> Self { [INFO] [stdout] 293 + Self::new() [INFO] [stdout] 294 + } [INFO] [stdout] 295 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:301:32 [INFO] [stdout] | [INFO] [stdout] 301 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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 `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:310:32 [INFO] [stdout] | [INFO] [stdout] 310 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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 `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:322:28 [INFO] [stdout] | [INFO] [stdout] 322 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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 `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:326:28 [INFO] [stdout] | [INFO] [stdout] 326 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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 `Color` which implements the `Copy` trait [INFO] [stdout] --> src/game/cards.rs:330:28 [INFO] [stdout] | [INFO] [stdout] 330 | color: color.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `color` [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: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/events.rs:92:72 [INFO] [stdout] | [INFO] [stdout] 92 | write!(f, "CardPlayed: id={}, card={}", player_id, card.to_string())?, [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/events.rs:95:70 [INFO] [stdout] | [INFO] [stdout] 95 | write!(f, "CardDraw: id={}, card={}", player_id, card.to_string())?, [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/events.rs:107:66 [INFO] [stdout] | [INFO] [stdout] 107 | write!(f, "TopCardChanged: top_card={}", top_card.to_string())?, [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `EventBus` [INFO] [stdout] --> src/ports/bus.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | / pub fn new() -> Self { [INFO] [stdout] 13 | | EventBus { [INFO] [stdout] 14 | | handlers: Vec::new(), [INFO] [stdout] 15 | | } [INFO] [stdout] 16 | | } [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] help: try adding this [INFO] [stdout] | [INFO] [stdout] 11 + impl Default for EventBus { [INFO] [stdout] 12 + fn default() -> Self { [INFO] [stdout] 13 + Self::new() [INFO] [stdout] 14 + } [INFO] [stdout] 15 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/events.rs:92:72 [INFO] [stdout] | [INFO] [stdout] 92 | write!(f, "CardPlayed: id={}, card={}", player_id, card.to_string())?, [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/events.rs:95:70 [INFO] [stdout] | [INFO] [stdout] 95 | write!(f, "CardDraw: id={}, card={}", player_id, card.to_string())?, [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `write!` args [INFO] [stdout] --> src/game/events.rs:107:66 [INFO] [stdout] | [INFO] [stdout] 107 | write!(f, "TopCardChanged: top_card={}", top_card.to_string())?, [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `EventBus` [INFO] [stdout] --> src/ports/bus.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | / pub fn new() -> Self { [INFO] [stdout] 13 | | EventBus { [INFO] [stdout] 14 | | handlers: Vec::new(), [INFO] [stdout] 15 | | } [INFO] [stdout] 16 | | } [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] help: try adding this [INFO] [stdout] | [INFO] [stdout] 11 + impl Default for EventBus { [INFO] [stdout] 12 + fn default() -> Self { [INFO] [stdout] 13 + Self::new() [INFO] [stdout] 14 + } [INFO] [stdout] 15 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/bin/server.rs:202:26 [INFO] [stdout] | [INFO] [stdout] 202 | message: format!("You start the game!").into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("You start the game!")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/server.rs:202:26 [INFO] [stdout] | [INFO] [stdout] 202 | message: format!("You start the game!").into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"You start the game!".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/bin/tui_client.rs:80:1 [INFO] [stdout] | [INFO] [stdout] 80 | impl Default for InputFocus { fn default() -> Self { InputFocus::Room } } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 79 + #[derive(Default)] [INFO] [stdout] 80 ~ enum InputFocus { #[default] [INFO] [stdout] 81 | Room, Name } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/tui_client.rs:257:13 [INFO] [stdout] | [INFO] [stdout] 257 | / if app.cursor > 0 { [INFO] [stdout] 258 | | app.cursor -= 1; [INFO] [stdout] 259 | | } [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] 256 ~ KeyCode::Up [INFO] [stdout] 257 ~ if app.cursor > 0 => { [INFO] [stdout] 258 | app.cursor -= 1; [INFO] [stdout] 259 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/tui_client.rs:641:13 [INFO] [stdout] | [INFO] [stdout] 641 | / if !c.is_control() { [INFO] [stdout] 642 | | match app.input_focus { [INFO] [stdout] 643 | | InputFocus::Room => if app.room_input.len() < 24 { app.room_input.push(c); }, [INFO] [stdout] 644 | | InputFocus::Name => if app.name_input.len() < 24 { app.name_input.push(c); }, [INFO] [stdout] 645 | | } [INFO] [stdout] 646 | | } [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] 640 ~ KeyCode::Char(c) [INFO] [stdout] 641 ~ if !c.is_control() => { [INFO] [stdout] 642 | match app.input_focus { [INFO] [stdout] ... [INFO] [stdout] 645 | } [INFO] [stdout] 646 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/tui_client.rs:757:76 [INFO] [stdout] | [INFO] [stdout] 757 | app.push_log(format!("Player {} played {}", player_id, card.to_string())) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/tui_client.rs:762:62 [INFO] [stdout] | [INFO] [stdout] 762 | app.push_log(format!("You drew: {}", card.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/tui_client.rs:768:17 [INFO] [stdout] | [INFO] [stdout] 768 | / if Some(*player_id) == app.game_state.player_id { [INFO] [stdout] 769 | | if !app.game_state.hand.is_empty() { [INFO] [stdout] 770 | | let idx = app.game_state.hand.len(); [INFO] [stdout] ... | [INFO] [stdout] 777 | | } [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] 768 ~ if Some(*player_id) == app.game_state.player_id [INFO] [stdout] 769 ~ && !app.game_state.hand.is_empty() { [INFO] [stdout] 770 | let idx = app.game_state.hand.len(); [INFO] [stdout] ... [INFO] [stdout] 775 | app.push_log("你刚摸的牌可立即出"); [INFO] [stdout] 776 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/bin/server.rs:202:26 [INFO] [stdout] | [INFO] [stdout] 202 | message: format!("You start the game!").into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("You start the game!")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/server.rs:202:26 [INFO] [stdout] | [INFO] [stdout] 202 | message: format!("You start the game!").into(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"You start the game!".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/async_server.rs:276:28 [INFO] [stdout] | [INFO] [stdout] 276 | async fn send_err(players: &Vec, conn_id: ConnId, msg: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 276 - async fn send_err(players: &Vec, conn_id: ConnId, msg: &str) { [INFO] [stdout] 276 + async fn send_err(players: &[PlayerSlot], conn_id: ConnId, msg: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/bin/tui_client.rs:80:1 [INFO] [stdout] | [INFO] [stdout] 80 | impl Default for InputFocus { fn default() -> Self { InputFocus::Room } } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 79 + #[derive(Default)] [INFO] [stdout] 80 ~ enum InputFocus { #[default] [INFO] [stdout] 81 | Room, Name } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/tui_client.rs:257:13 [INFO] [stdout] | [INFO] [stdout] 257 | / if app.cursor > 0 { [INFO] [stdout] 258 | | app.cursor -= 1; [INFO] [stdout] 259 | | } [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] 256 ~ KeyCode::Up [INFO] [stdout] 257 ~ if app.cursor > 0 => { [INFO] [stdout] 258 | app.cursor -= 1; [INFO] [stdout] 259 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/bin/tui_client.rs:641:13 [INFO] [stdout] | [INFO] [stdout] 641 | / if !c.is_control() { [INFO] [stdout] 642 | | match app.input_focus { [INFO] [stdout] 643 | | InputFocus::Room => if app.room_input.len() < 24 { app.room_input.push(c); }, [INFO] [stdout] 644 | | InputFocus::Name => if app.name_input.len() < 24 { app.name_input.push(c); }, [INFO] [stdout] 645 | | } [INFO] [stdout] 646 | | } [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] 640 ~ KeyCode::Char(c) [INFO] [stdout] 641 ~ if !c.is_control() => { [INFO] [stdout] 642 | match app.input_focus { [INFO] [stdout] ... [INFO] [stdout] 645 | } [INFO] [stdout] 646 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/async_server.rs:276:28 [INFO] [stdout] | [INFO] [stdout] 276 | async fn send_err(players: &Vec, conn_id: ConnId, msg: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 276 - async fn send_err(players: &Vec, conn_id: ConnId, msg: &str) { [INFO] [stdout] 276 + async fn send_err(players: &[PlayerSlot], conn_id: ConnId, msg: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/tui_client.rs:757:76 [INFO] [stdout] | [INFO] [stdout] 757 | app.push_log(format!("Player {} played {}", player_id, card.to_string())) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/bin/tui_client.rs:762:62 [INFO] [stdout] | [INFO] [stdout] 762 | app.push_log(format!("You drew: {}", card.to_string())); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/tui_client.rs:768:17 [INFO] [stdout] | [INFO] [stdout] 768 | / if Some(*player_id) == app.game_state.player_id { [INFO] [stdout] 769 | | if !app.game_state.hand.is_empty() { [INFO] [stdout] 770 | | let idx = app.game_state.hand.len(); [INFO] [stdout] ... | [INFO] [stdout] 777 | | } [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] 768 ~ if Some(*player_id) == app.game_state.player_id [INFO] [stdout] 769 ~ && !app.game_state.hand.is_empty() { [INFO] [stdout] 770 | let idx = app.game_state.hand.len(); [INFO] [stdout] ... [INFO] [stdout] 775 | app.push_log("你刚摸的牌可立即出"); [INFO] [stdout] 776 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 35.38s [INFO] running `Command { std: "docker" "inspect" "65e32012c3bef77cdd837cda3d8caea6f3cf58c55fa94ecf0c70760f05e24e62", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "65e32012c3bef77cdd837cda3d8caea6f3cf58c55fa94ecf0c70760f05e24e62", kill_on_drop: false }` [INFO] [stdout] 65e32012c3bef77cdd837cda3d8caea6f3cf58c55fa94ecf0c70760f05e24e62