style: cargo fmt
Test / test (pull_request) Successful in 37m46s

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-07-13 13:11:54 -07:00
parent 560470b86b
commit fc87b13e5b
2 changed files with 38 additions and 18 deletions
+31 -17
View File
@@ -569,20 +569,21 @@ fn build_home_context<'a>(
// additionally requires at least one move — a fresh untouched deal // additionally requires at least one move — a fresh untouched deal
// is indistinguishable from "New Game" and doesn't earn a card. // is indistinguishable from "New Game" and doesn't earn a card.
let game_live = game.is_some_and(|g| !g.0.is_won()); let game_live = game.is_some_and(|g| !g.0.is_won());
let continue_info = game let continue_info = game.filter(|g| game_live && g.0.move_count() > 0).map(|g| {
.filter(|g| game_live && g.0.move_count() > 0) let g = &g.0;
.map(|g| { let mut caption = format!(
let g = &g.0; "{} \u{2022} {}",
let mut caption = format!( game_mode_label(g.mode),
"{} \u{2022} {}", format_elapsed(g.elapsed_seconds)
game_mode_label(g.mode), );
format_elapsed(g.elapsed_seconds) if g.mode != GameMode::Zen {
); caption.push_str(&format!(
if g.mode != GameMode::Zen { " \u{2022} Score {}",
caption.push_str(&format!(" \u{2022} Score {}", format_compact(g.score() as u64))); format_compact(g.score() as u64)
} ));
ContinueInfo { caption } }
}); ContinueInfo { caption }
});
let wide = sources let wide = sources
.windows .windows
@@ -1023,7 +1024,12 @@ fn handle_home_digit_keys(
} }
if let Some(game_mode) = mode.to_game_mode() { 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); writers.dispatch(mode);
@@ -1325,7 +1331,11 @@ fn spawn_new_game_hero(parent: &mut ChildSpawnerCommands, ctx: &HomeContext<'_>)
HighContrastBorder::with_default(BORDER_STRONG), HighContrastBorder::with_default(BORDER_STRONG),
)) ))
.with_children(|c| { .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))); 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(), font_label.clone(),
TextColor(TEXT_SECONDARY), 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() { if let Some(goal) = today.goal.as_ref() {
c.spawn(( c.spawn((
Text::new(format!("Goal: {goal}")), Text::new(format!("Goal: {goal}")),
+7 -1
View File
@@ -181,7 +181,13 @@ pub fn spawn_modal<M: Component, F>(
where where
F: FnOnce(&mut ChildSpawnerCommands), 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`] /// Default maximum card width in logical pixels — every [`spawn_modal`]