[INFO] fetching crate twentyone 0.2.0... [INFO] linting twentyone-0.2.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate twentyone 0.2.0 into /workspace/builds/worker-4-tc1/source [INFO] started tweaking crates.io crate twentyone 0.2.0 [INFO] finished tweaking crates.io crate twentyone 0.2.0 [INFO] tweaked toml for crates.io crate twentyone 0.2.0 written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate twentyone 0.2.0 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 crates.io crate twentyone 0.2.0 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 libc v0.2.86 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 0d0bbb0b1875ac7db3e862ae0de6a8fbf279cb0e746ec971821c9b009cae6cac [INFO] running `Command { std: "docker" "start" "-a" "0d0bbb0b1875ac7db3e862ae0de6a8fbf279cb0e746ec971821c9b009cae6cac", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "0d0bbb0b1875ac7db3e862ae0de6a8fbf279cb0e746ec971821c9b009cae6cac", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0d0bbb0b1875ac7db3e862ae0de6a8fbf279cb0e746ec971821c9b009cae6cac", kill_on_drop: false }` [INFO] [stdout] 0d0bbb0b1875ac7db3e862ae0de6a8fbf279cb0e746ec971821c9b009cae6cac [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 48c71e15aeb2404cf5c79dbe47a0b0a763fc4bfbb17ac3b6138065dc5919a2a7 [INFO] running `Command { std: "docker" "start" "-a" "48c71e15aeb2404cf5c79dbe47a0b0a763fc4bfbb17ac3b6138065dc5919a2a7", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.86 [INFO] [stderr] Compiling getrandom v0.2.2 [INFO] [stderr] Checking rand_core v0.6.2 [INFO] [stderr] Checking rand_chacha v0.3.0 [INFO] [stderr] Checking rand v0.8.3 [INFO] [stderr] Checking twentyone v0.2.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/game.rs:160:13 [INFO] [stdout] | [INFO] [stdout] 160 | shoe: shoe, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `shoe` [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.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | callback: callback, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `callback` [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.rs:481:13 [INFO] [stdout] | [INFO] [stdout] 481 | money: money, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `money` [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.rs:160:13 [INFO] [stdout] | [INFO] [stdout] 160 | shoe: shoe, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `shoe` [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.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | callback: callback, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `callback` [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.rs:481:13 [INFO] [stdout] | [INFO] [stdout] 481 | money: money, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `money` [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: the loop variable `i` is only used to index `suits` [INFO] [stdout] --> src/cards.rs:20:14 [INFO] [stdout] | [INFO] [stdout] 20 | for i in 0..4 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 20 - for i in 0..4 { [INFO] [stdout] 20 + for in &suits { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `values` [INFO] [stdout] --> src/cards.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | for j in 0..13 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for j in 0..13 { [INFO] [stdout] 21 + for in &values { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/cards.rs:62:27 [INFO] [stdout] | [INFO] [stdout] 62 | pub fn shuffle_deck(deck: &mut Vec<[char; 2]>) { [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] 62 - pub fn shuffle_deck(deck: &mut Vec<[char; 2]>) { [INFO] [stdout] 62 + pub fn shuffle_deck(deck: &mut [[char; 2]]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/cards.rs:80:1 [INFO] [stdout] | [INFO] [stdout] 80 | pub fn draw_card(deck: &mut Vec<[char; 2]>) -> Result<[char; 2], ()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cards.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | if deck.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!deck.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: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/game.rs:153:16 [INFO] [stdout] | [INFO] [stdout] 153 | pub fn new<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 156 | callback: &'a dyn Fn(DealerRequest, Option<&Player>, &Dealer) -> PlayerAction, [INFO] [stdout] | ^^ [INFO] [stdout] 157 | ) -> Dealer { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 153 ~ pub fn new( [INFO] [stdout] 154 | shoe: Vec<[char; 2]>, [INFO] [stdout] 155 | game_config: GameConfig, [INFO] [stdout] 156 ~ callback: &dyn Fn(DealerRequest, Option<&Player>, &Dealer) -> PlayerAction, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:242:87 [INFO] [stdout] | [INFO] [stdout] 242 | let bet = (self.callback)(DealerRequest::Bet, Some(&self.players[i]), &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:255:33 [INFO] [stdout] | [INFO] [stdout] 255 | ... &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:260:94 [INFO] [stdout] | [INFO] [stdout] 260 | (self.callback)(DealerRequest::Error(error), Some(&self.players[i]), &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:264:90 [INFO] [stdout] | [INFO] [stdout] 264 | (self.callback)(DealerRequest::Error(error), Some(&self.players[i]), &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:273:68 [INFO] [stdout] | [INFO] [stdout] 273 | (self.callback)(DealerRequest::UpCard(self.hand[1]), None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `player_bets` [INFO] [stdout] --> src/game.rs:276:18 [INFO] [stdout] | [INFO] [stdout] 276 | for i in 0..self.players.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 276 - for i in 0..self.players.len() { [INFO] [stdout] 276 + for (i, ) in player_bets.iter_mut().enumerate().take(self.players.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:308:68 [INFO] [stdout] | [INFO] [stdout] 308 | (self.callback)(DealerRequest::LowCards, None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:319:89 [INFO] [stdout] | [INFO] [stdout] 319 | (self.callback)(DealerRequest::Play(j), Some(&self.players[i]), &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:339:37 [INFO] [stdout] | [INFO] [stdout] 339 | ... &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:371:37 [INFO] [stdout] | [INFO] [stdout] 371 | ... &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:380:33 [INFO] [stdout] | [INFO] [stdout] 380 | ... &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:410:77 [INFO] [stdout] | [INFO] [stdout] 410 | (self.callback)(DealerRequest::HitCard(card), None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:419:69 [INFO] [stdout] | [INFO] [stdout] 419 | (self.callback)(DealerRequest::HitCard(card), None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `player_bets` [INFO] [stdout] --> src/game.rs:425:18 [INFO] [stdout] | [INFO] [stdout] 425 | for i in 0..self.players.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 425 - for i in 0..self.players.len() { [INFO] [stdout] 425 + for (i, ) in player_bets.iter().enumerate().take(self.players.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:461:77 [INFO] [stdout] | [INFO] [stdout] 461 | (self.callback)(DealerRequest::DealerHand(self.hand.clone()), None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/game.rs:524:29 [INFO] [stdout] | [INFO] [stdout] 524 | pub fn get_hand_value(hand: &Vec<[char; 2]>, auto_aces: bool) -> u8 { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 524 - pub fn get_hand_value(hand: &Vec<[char; 2]>, auto_aces: bool) -> u8 { [INFO] [stdout] 524 + pub fn get_hand_value(hand: &[[char; 2]], auto_aces: bool) -> u8 { [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/game.rs:578:24 [INFO] [stdout] | [INFO] [stdout] 578 | pub fn can_split(hand: &Vec<[char; 2]>) -> bool { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 578 - pub fn can_split(hand: &Vec<[char; 2]>) -> bool { [INFO] [stdout] 578 + pub fn can_split(hand: &[[char; 2]]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/game.rs:157:10 [INFO] [stdout] | [INFO] [stdout] 156 | callback: &'a dyn Fn(DealerRequest, Option<&Player>, &Dealer) -> PlayerAction, [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 157 | ) -> Dealer { [INFO] [stdout] | ^^^^^^ the same lifetime is hidden here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 157 | ) -> Dealer<'a> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `suits` [INFO] [stdout] --> src/cards.rs:20:14 [INFO] [stdout] | [INFO] [stdout] 20 | for i in 0..4 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 20 - for i in 0..4 { [INFO] [stdout] 20 + for in &suits { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `values` [INFO] [stdout] --> src/cards.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | for j in 0..13 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for j in 0..13 { [INFO] [stdout] 21 + for in &values { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/cards.rs:62:27 [INFO] [stdout] | [INFO] [stdout] 62 | pub fn shuffle_deck(deck: &mut Vec<[char; 2]>) { [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] 62 - pub fn shuffle_deck(deck: &mut Vec<[char; 2]>) { [INFO] [stdout] 62 + pub fn shuffle_deck(deck: &mut [[char; 2]]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/cards.rs:80:1 [INFO] [stdout] | [INFO] [stdout] 80 | pub fn draw_card(deck: &mut Vec<[char; 2]>) -> Result<[char; 2], ()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cards.rs:81:8 [INFO] [stdout] | [INFO] [stdout] 81 | if deck.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!deck.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: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/game.rs:153:16 [INFO] [stdout] | [INFO] [stdout] 153 | pub fn new<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 156 | callback: &'a dyn Fn(DealerRequest, Option<&Player>, &Dealer) -> PlayerAction, [INFO] [stdout] | ^^ [INFO] [stdout] 157 | ) -> Dealer { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 153 ~ pub fn new( [INFO] [stdout] 154 | shoe: Vec<[char; 2]>, [INFO] [stdout] 155 | game_config: GameConfig, [INFO] [stdout] 156 ~ callback: &dyn Fn(DealerRequest, Option<&Player>, &Dealer) -> PlayerAction, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:242:87 [INFO] [stdout] | [INFO] [stdout] 242 | let bet = (self.callback)(DealerRequest::Bet, Some(&self.players[i]), &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:255:33 [INFO] [stdout] | [INFO] [stdout] 255 | ... &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:260:94 [INFO] [stdout] | [INFO] [stdout] 260 | (self.callback)(DealerRequest::Error(error), Some(&self.players[i]), &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:264:90 [INFO] [stdout] | [INFO] [stdout] 264 | (self.callback)(DealerRequest::Error(error), Some(&self.players[i]), &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:273:68 [INFO] [stdout] | [INFO] [stdout] 273 | (self.callback)(DealerRequest::UpCard(self.hand[1]), None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `player_bets` [INFO] [stdout] --> src/game.rs:276:18 [INFO] [stdout] | [INFO] [stdout] 276 | for i in 0..self.players.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 276 - for i in 0..self.players.len() { [INFO] [stdout] 276 + for (i, ) in player_bets.iter_mut().enumerate().take(self.players.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:308:68 [INFO] [stdout] | [INFO] [stdout] 308 | (self.callback)(DealerRequest::LowCards, None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:319:89 [INFO] [stdout] | [INFO] [stdout] 319 | (self.callback)(DealerRequest::Play(j), Some(&self.players[i]), &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:339:37 [INFO] [stdout] | [INFO] [stdout] 339 | ... &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:371:37 [INFO] [stdout] | [INFO] [stdout] 371 | ... &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:380:33 [INFO] [stdout] | [INFO] [stdout] 380 | ... &self, [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:410:77 [INFO] [stdout] | [INFO] [stdout] 410 | (self.callback)(DealerRequest::HitCard(card), None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:419:69 [INFO] [stdout] | [INFO] [stdout] 419 | (self.callback)(DealerRequest::HitCard(card), None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `player_bets` [INFO] [stdout] --> src/game.rs:425:18 [INFO] [stdout] | [INFO] [stdout] 425 | for i in 0..self.players.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 425 - for i in 0..self.players.len() { [INFO] [stdout] 425 + for (i, ) in player_bets.iter().enumerate().take(self.players.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:461:77 [INFO] [stdout] | [INFO] [stdout] 461 | (self.callback)(DealerRequest::DealerHand(self.hand.clone()), None, &self); [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/game.rs:524:29 [INFO] [stdout] | [INFO] [stdout] 524 | pub fn get_hand_value(hand: &Vec<[char; 2]>, auto_aces: bool) -> u8 { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 524 - pub fn get_hand_value(hand: &Vec<[char; 2]>, auto_aces: bool) -> u8 { [INFO] [stdout] 524 + pub fn get_hand_value(hand: &[[char; 2]], auto_aces: bool) -> u8 { [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/game.rs:578:24 [INFO] [stdout] | [INFO] [stdout] 578 | pub fn can_split(hand: &Vec<[char; 2]>) -> bool { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 578 - pub fn can_split(hand: &Vec<[char; 2]>) -> bool { [INFO] [stdout] 578 + pub fn can_split(hand: &[[char; 2]]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> src/game.rs:157:10 [INFO] [stdout] | [INFO] [stdout] 156 | callback: &'a dyn Fn(DealerRequest, Option<&Player>, &Dealer) -> PlayerAction, [INFO] [stdout] | -- the lifetime is named here [INFO] [stdout] 157 | ) -> Dealer { [INFO] [stdout] | ^^^^^^ the same lifetime is hidden here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 157 | ) -> Dealer<'a> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[char; 2]` which implements the `Copy` trait [INFO] [stdout] --> tests/tests.rs:10:20 [INFO] [stdout] | [INFO] [stdout] 10 | let card = deck.get(0).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*deck.get(0).unwrap()` [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: accessing first element with `deck.get(0)` [INFO] [stdout] --> tests/tests.rs:10:20 [INFO] [stdout] | [INFO] [stdout] 10 | let card = deck.get(0).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `deck.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[char; 2]` which implements the `Copy` trait [INFO] [stdout] --> tests/tests.rs:21:20 [INFO] [stdout] | [INFO] [stdout] 21 | let card = shoe.get(0).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*shoe.get(0).unwrap()` [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: accessing first element with `shoe.get(0)` [INFO] [stdout] --> tests/tests.rs:21:20 [INFO] [stdout] | [INFO] [stdout] 21 | let card = shoe.get(0).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `shoe.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[char; 2]` which implements the `Copy` trait [INFO] [stdout] --> tests/tests.rs:33:20 [INFO] [stdout] | [INFO] [stdout] 33 | let card = deck.get(0).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*deck.get(0).unwrap()` [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: accessing first element with `deck.get(0)` [INFO] [stdout] --> tests/tests.rs:33:20 [INFO] [stdout] | [INFO] [stdout] 33 | let card = deck.get(0).unwrap().clone(); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `deck.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `iter().cloned().collect()` on a slice to create a `Vec`. Calling `to_vec()` is both faster and more readable [INFO] [stdout] --> tests/tests.rs:43:37 [INFO] [stdout] | [INFO] [stdout] 43 | let deck_slice = &deck[..13].iter().cloned().collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.to_vec()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect [INFO] [stdout] = note: `#[warn(clippy::iter_cloned_collect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> tests/tests.rs:44:41 [INFO] [stdout] | [INFO] [stdout] 44 | assert_eq!(game::get_hand_value(&deck_slice, false), 95); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `deck_slice` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> examples/solo_cli.rs:91:20 [INFO] [stdout] | [INFO] [stdout] 91 | if player_value > dealer_value && player_value <= 21 [INFO] [stdout] | ____________________^ [INFO] [stdout] 92 | | || (player_value <= 21 && dealer_value > 21) [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] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 91 - if player_value > dealer_value && player_value <= 21 [INFO] [stdout] 92 - || (player_value <= 21 && dealer_value > 21) [INFO] [stdout] 91 + if !(player_value > 21 || player_value <= dealer_value && dealer_value <= 21) [INFO] [stdout] | [INFO] [stdout] 91 - if player_value > dealer_value && player_value <= 21 [INFO] [stdout] 92 - || (player_value <= 21 && dealer_value > 21) [INFO] [stdout] 91 + if (dealer_value > 21 || player_value > dealer_value) && player_value <= 21 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.73s [INFO] running `Command { std: "docker" "inspect" "48c71e15aeb2404cf5c79dbe47a0b0a763fc4bfbb17ac3b6138065dc5919a2a7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "48c71e15aeb2404cf5c79dbe47a0b0a763fc4bfbb17ac3b6138065dc5919a2a7", kill_on_drop: false }` [INFO] [stdout] 48c71e15aeb2404cf5c79dbe47a0b0a763fc4bfbb17ac3b6138065dc5919a2a7