We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b7f3fe commit 452ab26Copy full SHA for 452ab26
exercises/conversions/using_as.rs
@@ -8,7 +8,7 @@
8
// I AM NOT DONE
9
10
fn average(values: &[f64]) -> f64 {
11
- let total = values.iter().fold(0.0, |a, b| a + b);
+ let total = values.iter().sum::<f64>();
12
total / values.len()
13
}
14
0 commit comments