Skip to content

Commit ca2813d

Browse files
Copilotgfauredev
andauthored
refactor(analytics): remove unreachable volume fallback in totals
Agent-Logs-Url: https://github.com/gfauredev/LogOut/sessions/71104b9b-78e8-4caf-bac5-93182234d723 Co-authored-by: gfauredev <19304085+gfauredev@users.noreply.github.com>
1 parent 5646325 commit ca2813d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • src/components/analytics

src/components/analytics/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ mod selector;
1212
pub use chart::{ChartView, SeriesData};
1313
pub use selector::MetricSelector;
1414

15+
/// One color per metric–exercise pair selector slot (max 8 visible series).
1516
const COLORS: [&str; 8] = [
1617
"#3498db", "#e74c3c", "#2ecc71", "#9b59b6", "#e67e22", "#f1c40f", "#16a085", "#e91e63",
1718
];
@@ -235,7 +236,9 @@ pub fn Analytics() -> Element {
235236
Metric::Reps | Metric::Distance | Metric::Duration => {
236237
values.iter().sum()
237238
}
238-
Metric::Volume => 0.0,
239+
Metric::Volume => unreachable!(
240+
"volume is handled by the dedicated branch above"
241+
),
239242
};
240243
#[allow(clippy::cast_precision_loss)]
241244
points.push((session.start_time as f64, total));

0 commit comments

Comments
 (0)