chore: Ran cargo fmt

This commit is contained in:
Joel Therrien 2024-12-28 22:35:59 -08:00
parent 710499b664
commit 3e187b57fb

View file

@ -124,15 +124,12 @@ async fn incoming_message_handler<E: std::fmt::Display>(
let game = room.game.as_mut().unwrap();
let result = match r#move {
GameMove::Pass => game.pass(&player),
GameMove::Exchange { tiles } => {
game.exchange(&player, tiles)
}
GameMove::Exchange { tiles } => game.exchange(&player, tiles),
GameMove::Play {
played_tiles,
commit_move,
} => {
let result =
game.play(&player, played_tiles, commit_move);
let result = game.play(&player, played_tiles, commit_move);
if result.is_ok() & !commit_move {
let event = ServerToClientMessage::GameEvent {
event: GameEvent::TurnAction {
@ -308,7 +305,13 @@ async fn room(
let mut room = d.write().await;
// check if player is already in the room. If they are, don't allow the new connection
if room.party_info.players.iter().map(|f| f.to_lowercase()).contains(&player.to_lowercase()) {
if room
.party_info
.players
.iter()
.map(|f| f.to_lowercase())
.contains(&player.to_lowercase())
{
return reject_websocket_with_reason(
ws,
CloseCode::Protocol,
@ -317,12 +320,7 @@ async fn room(
}
if let Some(game) = &room.game {
if game
.0
.player_states
.get_player_state(&player)
.is_none()
{
if game.0.player_states.get_player_state(&player).is_none() {
// Game is in progress and our new player isn't a member
return reject_websocket_with_reason(
ws,