From dbe738c17ead7d66977ab345b39e9ec453df9c99 Mon Sep 17 00:00:00 2001 From: Ishan Jain Date: Tue, 5 Dec 2023 16:41:25 +0530 Subject: [PATCH] day5: fix build error --- src/day5/2.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/day5/2.rs b/src/day5/2.rs index 20e26a0..8ea6e79 100644 --- a/src/day5/2.rs +++ b/src/day5/2.rs @@ -31,15 +31,13 @@ fn process(data: &str) -> i64 { .lines() .skip(1) .map(|line| { - line.split_ascii_whitespace() + let y: Vec = line + .split_ascii_whitespace() .map(|y| y.parse::().unwrap()) - .array_chunks::<2>() - .map(|y| { - let size = y[2]; + .collect(); + let size = y[2]; - (y[1]..y[1] + size, y[0]..y[0] + size) - }) - .collect() + (y[1]..y[1] + size, y[0]..y[0] + size) }) .collect() })