cargo fmt
parent
7f02eb867c
commit
9a4ecb0907
|
@ -21,7 +21,11 @@ pub fn run() -> Result<()> {
|
|||
|
||||
let mut sorted_calories = calories.clone();
|
||||
sorted_calories.sort_by(|a, b| b.cmp(a));
|
||||
let top_three: u32 = sorted_calories.get(0..3).expect("Not able to be sorted").iter().sum();
|
||||
let top_three: u32 = sorted_calories
|
||||
.get(0..3)
|
||||
.expect("Not able to be sorted")
|
||||
.iter()
|
||||
.sum();
|
||||
println!("Top 3 calories {}", top_three);
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue