From a637e849f4db31fa4407f7d3a36415abec3356a2 Mon Sep 17 00:00:00 2001 From: Geoffrey Allott Date: Sat, 17 Jun 2023 23:20:07 +0100 Subject: [PATCH] run cargo fmt --- src/game/action.rs | 2 +- src/game/whist.rs | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/game/action.rs b/src/game/action.rs index 68da1c4..8725b9e 100644 --- a/src/game/action.rs +++ b/src/game/action.rs @@ -26,7 +26,7 @@ impl ValidatedUserAction { Action::PutInBox { .. } if username != self.0.username => Action::PutInBox { card: None }, Action::DealBox { .. } => Action::DealBox { card: None }, action => action.clone(), - } + }, } } } diff --git a/src/game/whist.rs b/src/game/whist.rs index 131070b..de5b51e 100644 --- a/src/game/whist.rs +++ b/src/game/whist.rs @@ -357,10 +357,8 @@ impl Game for KnockOutWhist { State::ChoosingTrumps => DealerAction::WaitForPlayer, State::Playing => { if !self.winners.is_empty() { - let knocked_out_player = self.seats.player_set() - .into_iter() - .filter(|username| matches!(self.tricks_won.get(username), Some(0) | None)) - .min(); + let knocked_out_player = + self.seats.player_set().into_iter().filter(|username| matches!(self.tricks_won.get(username), Some(0) | None)).min(); if let Some(username) = knocked_out_player { return DealerAction::TakeAction(ValidatedUserAction(UserAction { timestamp, username, action: Action::KnockedOut })); } @@ -380,10 +378,7 @@ impl Game for KnockOutWhist { } } State::CutForCall => { - let knocked_out_player = self.seats.player_set() - .into_iter() - .filter(|username| matches!(self.tricks_won.get(username), Some(0) | None)) - .min(); + let knocked_out_player = self.seats.player_set().into_iter().filter(|username| matches!(self.tricks_won.get(username), Some(0) | None)).min(); if let Some(username) = knocked_out_player { return DealerAction::TakeAction(ValidatedUserAction(UserAction { timestamp, username, action: Action::KnockedOut })); } -- 2.34.1