chore: use into for answers
This commit is contained in:
parent
a67033d39b
commit
6a54618880
7 changed files with 33 additions and 48 deletions
|
@ -10,20 +10,19 @@ impl Solution for Day02 {
|
|||
}
|
||||
|
||||
fn part_a(&self, input: &str) -> Answer {
|
||||
let reports = input
|
||||
input
|
||||
.lines()
|
||||
.filter(|l| {
|
||||
let nums = l.split_whitespace().map(|n| n.parse::<i32>().unwrap());
|
||||
|
||||
is_valid(&nums)
|
||||
})
|
||||
.count();
|
||||
|
||||
Answer::Number(reports as u64)
|
||||
.count()
|
||||
.into()
|
||||
}
|
||||
|
||||
fn part_b(&self, input: &str) -> Answer {
|
||||
let reports = input
|
||||
input
|
||||
.lines()
|
||||
.filter(|l| {
|
||||
let nums = l.split_whitespace().map(|n| n.parse::<i32>().unwrap());
|
||||
|
@ -45,9 +44,8 @@ impl Solution for Day02 {
|
|||
|
||||
valid
|
||||
})
|
||||
.count();
|
||||
|
||||
Answer::Number(reports as u64)
|
||||
.count()
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue