Applied clippy suggestions
This commit is contained in:
@@ -27,17 +27,17 @@ impl Solution for Day06 {
|
||||
input: &mut Vec<String>,
|
||||
) -> Result<Box<dyn std::fmt::Display + Sync>, Box<dyn std::error::Error>> {
|
||||
let times = vec![input[0]
|
||||
.split(":")
|
||||
.split(':')
|
||||
.nth(1)
|
||||
.unwrap()
|
||||
.replace(" ", "")
|
||||
.replace(' ', "")
|
||||
.parse::<u64>()?];
|
||||
|
||||
let distances = vec![input[1]
|
||||
.split(":")
|
||||
.split(':')
|
||||
.nth(1)
|
||||
.unwrap()
|
||||
.replace(" ", "")
|
||||
.replace(' ', "")
|
||||
.parse::<u64>()?];
|
||||
|
||||
Ok(Box::new(self.num_winning_races(×, &distances)?))
|
||||
@@ -66,7 +66,7 @@ impl Day06 {
|
||||
beats.push(count);
|
||||
}
|
||||
|
||||
Ok(beats.iter().fold(1, |acc, &b| acc * b))
|
||||
Ok(beats.iter().product::<u32>())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user