Applied clippy suggestions

This commit is contained in:
2024-01-12 14:26:05 +00:00
parent 760881cbc3
commit 9609c69c9e
13 changed files with 29 additions and 33 deletions

View File

@@ -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(&times, &distances)?))
@@ -66,7 +66,7 @@ impl Day06 {
beats.push(count);
}
Ok(beats.iter().fold(1, |acc, &b| acc * b))
Ok(beats.iter().product::<u32>())
}
}