fix: use try_from for i64/u64 casts; split format_notification into helpers

This commit is contained in:
damocles 2026-05-22 19:09:03 +02:00
commit bbe2112dc9
3 changed files with 166 additions and 139 deletions

View file

@ -335,8 +335,7 @@ async fn api_stats(
// Pass the window span to the reminder-stats RPC so the broker
// filters its counts to the same time range as the chart data.
let window_secs = window.span_secs();
#[allow(clippy::cast_sign_loss)] // window span is always a positive duration
let window_secs_u = window_secs.max(0) as u64;
let window_secs_u = u64::try_from(window_secs).unwrap_or(0);
snapshot.reminder_stats = fetch_reminder_stats(&state.socket, state.flavor(), window_secs_u).await;
axum::Json(snapshot)
}