We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 561401e commit 9b8ee4bCopy full SHA for 9b8ee4b
src/bin/01.rs
@@ -4,16 +4,13 @@ use advent_of_code::maneatingape::hash::*;
4
use advent_of_code::maneatingape::parse::*;
5
6
fn parse_data(input: &str) -> (Vec<u32>, Vec<u32>) {
7
- let first = input
+ input
8
.lines()
9
- .map(|line| line.iter_unsigned().next().unwrap())
10
- .collect();
11
- let second = input
12
- .lines()
13
- .map(|line| line.iter_unsigned().nth(1).unwrap())
14
15
-
16
- (first, second)
+ .map(|line| {
+ let mut iter = line.iter_unsigned::<u32>();
+ (iter.next().unwrap(), iter.next().unwrap())
+ })
+ .unzip()
17
}
18
19
pub fn part_one(input: &str) -> Option<u32> {
0 commit comments