From bc0de9955c375cf27d52c9934403964205afc182 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 29 Oct 2026 22:16:15 +0100 Subject: formatting --- src/client/core.rs | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) (limited to 'src/client/core.rs') diff --git a/src/client/core.rs b/src/client/core.rs index 5f8c513..06d9c42 100644 --- a/src/client/core.rs +++ b/src/client/core.rs @@ -3,8 +3,8 @@ use crate::client::games::response::{ parse_blackjack_response, parse_crash_response, parse_roulette_response, parse_spin_response, }; use crate::client::ui::{ - command_names, completion_lines, display_width, help_lines, input_cursor_column, - parse_bet_arg, record_history, + command_names, completion_lines, display_width, help_lines, input_cursor_column, parse_bet_arg, + record_history, }; use crate::crash::{multiplier_at, CrashState}; use crate::roulette::{Bets, NumberBet}; @@ -225,10 +225,7 @@ impl ClientCore { "Game exited. Active hand forfeited ({} PLN lost).", state.bet ); - vec![ - Effect::ClearRegion, - Effect::Print(vec![message]), - ] + vec![Effect::ClearRegion, Effect::Print(vec![message])] } Err(message) => { self.game.set_error(message); @@ -258,10 +255,7 @@ impl ClientCore { Ok(state) => { self.crash_started = None; self.game.end_game(); - let message = format!( - "Game exited. Round forfeited ({} PLN lost).", - state.bet - ); + let message = format!("Game exited. Round forfeited ({} PLN lost).", state.bet); vec![Effect::ClearRegion, Effect::Print(vec![message])] } Err(_) if self.game.crash_status() != "running" => { @@ -286,9 +280,7 @@ impl ClientCore { self.logged_in = None; vec![ Effect::Disconnect, - Effect::Print(vec![ - "Connection lost".to_string(), - ]), + Effect::Print(vec!["Connection lost".to_string()]), ] } } @@ -531,27 +523,20 @@ impl ClientCore { } } Key::Char(' ') => self.start_blackjack(), - Key::Char('h') - if hand.as_ref().is_some_and(|hand| hand.phase == "player") => - { + Key::Char('h') if hand.as_ref().is_some_and(|hand| hand.phase == "player") => { self.blackjack_action("hit") } - Key::Char('s') - if hand.as_ref().is_some_and(|hand| hand.phase == "player") => - { + Key::Char('s') if hand.as_ref().is_some_and(|hand| hand.phase == "player") => { self.blackjack_action("stand") } Key::Char('d') if hand.as_ref().is_some_and(|hand| { - hand.phase == "player" - && hand.actions.iter().any(|action| action == "double") + hand.phase == "player" && hand.actions.iter().any(|action| action == "double") }) => { self.blackjack_action("double") } - Key::Char('+') | Key::Char('=') - if matches!(status.as_str(), "ready" | "done") => - { + Key::Char('+') | Key::Char('=') if matches!(status.as_str(), "ready" | "done") => { let _ = self.game.adjust_bet(10); self.board_effects() } @@ -602,9 +587,7 @@ impl ClientCore { if hand.phase != "player" { return Vec::new(); } - if action == "double" - && !hand.actions.iter().any(|available| available == "double") - { + if action == "double" && !hand.actions.iter().any(|available| available == "double") { return Vec::new(); } self.pending = Some(Pending::BlackjackAction); @@ -914,9 +897,9 @@ impl ClientCore { Some(fingerprint) => { effects.push(Effect::Print(vec![format!("Fingerprint: {fingerprint}")])) } - None => effects.push(Effect::Print(vec![ - "Fingerprint: (not trusted)".to_string(), - ])), + None => effects.push(Effect::Print( + vec!["Fingerprint: (not trusted)".to_string()], + )), } self.pending = Some(Pending::Info); -- cgit v1.2.3