Skip to content

Commit 8faca58

Browse files
committed
refactor: Apply iterators api usage to parse_input func
1 parent f4c6cf5 commit 8faca58

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/day01.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ fn parse_input(input: &str) -> (Vec<i32>, Vec<i32>) {
2828
let mut left: Vec<i32> = vec![];
2929
let mut right: Vec<i32> = vec![];
3030

31-
for line in input.lines() {
31+
input.lines().for_each(|line| {
3232
let mut iter = line.split_whitespace();
3333
left.push(iter.next().unwrap().parse().unwrap());
3434
right.push(iter.next().unwrap().parse().unwrap());
35-
}
35+
});
3636

3737
(left, right)
3838
}

0 commit comments

Comments
 (0)