From 344f08f6dec6ddf57e6d1218188d03552833a0e0 Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Thu, 22 Dec 2022 08:31:00 +0100 Subject: [PATCH] 2022 day 22 part 1 --- 2022/rust/src/solutions/day22.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/2022/rust/src/solutions/day22.rs b/2022/rust/src/solutions/day22.rs index 9ce9bf9..75c0351 100644 --- a/2022/rust/src/solutions/day22.rs +++ b/2022/rust/src/solutions/day22.rs @@ -64,8 +64,8 @@ impl<'a> Dungeon<'a> { let (row_bounds, col_bounds) = map.keys() .fold((HashMap::::new(), HashMap::::new()), |(mut rows, mut cols), &(r, c)| { - rows.entry(r).and_modify(|mut x| *x = (x.0.min(c), x.1.max(c))).or_insert((c, c)); - cols.entry(c).and_modify(|mut x| *x = (x.0.min(r), x.1.max(r))).or_insert((r, r)); + rows.entry(r).and_modify(|x| *x = (x.0.min(c), x.1.max(c))).or_insert((c, c)); + cols.entry(c).and_modify(|x| *x = (x.0.min(r), x.1.max(r))).or_insert((r, r)); (rows, cols) }); Self { map, pos, dir, row_bounds, col_bounds } @@ -200,7 +200,7 @@ mod tests { #[test] fn part1() { let data = parse_data(DATA); - assert_eq!(1, solve1(&data)); + assert_eq!(6032, solve1(&data)); } #[test]