2021 day1/rust: prettify

This commit is contained in:
Xiretza 2021-12-04 12:18:49 +01:00
parent ba68214754
commit 59714dd83d

View file

@ -1,3 +1,4 @@
#![warn(clippy::pedantic)]
use itertools::Itertools;
use std::io::{self, BufRead};
@ -18,7 +19,7 @@ fn main() {
count_increasing(
numbers
.windows(3)
.map(|window| -> usize { window.iter().sum() })
.map(|window| window.iter().sum::<usize>())
)
);
}