mirror of
https://github.com/ArthurDanjou/rustlings.git
synced 2026-01-14 12:14:37 +01:00
chore: Run rustfmt on exercises
This commit is contained in:
@@ -82,5 +82,4 @@ mod tests {
|
||||
fn missing_name_and_invalid_age() {
|
||||
",one".parse::<Person>().unwrap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Basically, this is the same as From. The main difference is that this should return a Result type
|
||||
// instead of the target type itself.
|
||||
// You can read more about it at https://doc.rust-lang.org/std/convert/trait.TryFrom.html
|
||||
use std::convert::{TryInto, TryFrom};
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Color {
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
// I AM NOT DONE
|
||||
|
||||
fn average(values: &[f64]) -> f64 {
|
||||
let total = values
|
||||
.iter()
|
||||
.fold(0.0, |a, b| a + b);
|
||||
let total = values.iter().fold(0.0, |a, b| a + b);
|
||||
total / values.len()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user