diff --git a/src/day04.rs b/src/day04.rs index 28348ca..e47a44e 100644 --- a/src/day04.rs +++ b/src/day04.rs @@ -11,13 +11,12 @@ struct Board(Vec>>); impl Day for Day04 { fn init(content: String) -> Self where Self: Sized { - let mut l = content.lines().collect::>(); - let first = l[0]; - let a = l.drain(0..2); - drop(a); + let l = content.lines().collect::>(); + let (a, b) = l.split_at(2); + let first = a[0]; let nums = first.split(',').map(|x| x.parse::().expect("wat?")).collect(); - let split = l.split(|x| x.is_empty()); + let split = b.split(|x| x.is_empty()); let boards = split.map(|vecs| vecs.iter().map(