diff --git a/src/bin/p02.rs b/src/bin/p02.rs index d0b8dcd..19ce5c1 100644 --- a/src/bin/p02.rs +++ b/src/bin/p02.rs @@ -88,10 +88,10 @@ fn main() { reader.rewind().expect("Can't rewind"); println!("\n PART TWO ---------------"); - part2(reader.by_ref().lines()); + part2(reader.lines()); } -fn part1(lines: std::io::Lines<&mut io::BufReader>) { +fn part1(lines: impl Iterator>) { let mut total_score: u32 = 0; for l in lines { let line = l.expect("Can't read line."); @@ -118,7 +118,7 @@ fn part1(lines: std::io::Lines<&mut io::BufReader>) { println!("Total score is {}", total_score); } -fn part2(lines: std::io::Lines<&mut io::BufReader>) { +fn part2(lines: impl Iterator>) { let mut total_score: u32 = 0; for l in lines { let line = l.expect("Can't read line.");