Format eases.rs

This commit is contained in:
user1823 2025-04-06 15:39:03 +05:30 committed by GitHub
parent 1ae6536728
commit e57c880bd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,7 +28,7 @@ impl GraphsContext {
ease_values.push(card.ease_factor as f32);
}
}
eases.average = median(&mut ease_values) / 10.0;
difficulty.average = median(&mut difficulty_values) * 100.0;
@ -37,7 +37,7 @@ impl GraphsContext {
}
/// Helper function to calculate the median of a vector
fn median(data: &mut Vec<f32>) -> f32 {
fn median(data: &mut [f32]) -> f32 {
if data.is_empty() {
return 0.0;
}