diff --git a/solitaire_engine/src/home_plugin.rs b/solitaire_engine/src/home_plugin.rs index bf1a880..721c31f 100644 --- a/solitaire_engine/src/home_plugin.rs +++ b/solitaire_engine/src/home_plugin.rs @@ -569,20 +569,21 @@ fn build_home_context<'a>( // additionally requires at least one move — a fresh untouched deal // is indistinguishable from "New Game" and doesn't earn a card. let game_live = game.is_some_and(|g| !g.0.is_won()); - let continue_info = game - .filter(|g| game_live && g.0.move_count() > 0) - .map(|g| { - let g = &g.0; - let mut caption = format!( - "{} \u{2022} {}", - game_mode_label(g.mode), - format_elapsed(g.elapsed_seconds) - ); - if g.mode != GameMode::Zen { - caption.push_str(&format!(" \u{2022} Score {}", format_compact(g.score() as u64))); - } - ContinueInfo { caption } - }); + let continue_info = game.filter(|g| game_live && g.0.move_count() > 0).map(|g| { + let g = &g.0; + let mut caption = format!( + "{} \u{2022} {}", + game_mode_label(g.mode), + format_elapsed(g.elapsed_seconds) + ); + if g.mode != GameMode::Zen { + caption.push_str(&format!( + " \u{2022} Score {}", + format_compact(g.score() as u64) + )); + } + ContinueInfo { caption } + }); let wide = sources .windows @@ -1023,7 +1024,12 @@ fn handle_home_digit_keys( } if let Some(game_mode) = mode.to_game_mode() { - persist_last_mode(game_mode, &mut settings, storage_path.as_deref(), &mut changed); + persist_last_mode( + game_mode, + &mut settings, + storage_path.as_deref(), + &mut changed, + ); } writers.dispatch(mode); @@ -1325,7 +1331,11 @@ fn spawn_new_game_hero(parent: &mut ChildSpawnerCommands, ctx: &HomeContext<'_>) HighContrastBorder::with_default(BORDER_STRONG), )) .with_children(|c| { - c.spawn((Text::new("New Game"), font_title.clone(), TextColor(BG_BASE))); + c.spawn(( + Text::new("New Game"), + font_title.clone(), + TextColor(BG_BASE), + )); c.spawn((Text::new(caption), font_caption.clone(), TextColor(BG_BASE))); }); } @@ -1381,7 +1391,11 @@ fn spawn_daily_callout(parent: &mut ChildSpawnerCommands, ctx: &HomeContext<'_>) font_label.clone(), TextColor(TEXT_SECONDARY), )); - c.spawn((Text::new(date_text), font_value.clone(), TextColor(date_color))); + c.spawn(( + Text::new(date_text), + font_value.clone(), + TextColor(date_color), + )); if let Some(goal) = today.goal.as_ref() { c.spawn(( Text::new(format!("Goal: {goal}")), diff --git a/solitaire_engine/src/ui_modal.rs b/solitaire_engine/src/ui_modal.rs index 021c6d4..9973da1 100644 --- a/solitaire_engine/src/ui_modal.rs +++ b/solitaire_engine/src/ui_modal.rs @@ -181,7 +181,13 @@ pub fn spawn_modal( where F: FnOnce(&mut ChildSpawnerCommands), { - spawn_modal_sized(commands, plugin_marker, z_panel, MODAL_CARD_MAX_WIDTH, build_card) + spawn_modal_sized( + commands, + plugin_marker, + z_panel, + MODAL_CARD_MAX_WIDTH, + build_card, + ) } /// Default maximum card width in logical pixels — every [`spawn_modal`]