From 464da9d78778106cd7d563889a3bbd8550f51f46 Mon Sep 17 00:00:00 2001 From: Keenan Tims Date: Fri, 4 Dec 2026 00:16:24 -0700 Subject: [PATCH] 2026/day3: cleanup --- 2026/src/day3.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/2026/src/day3.rs b/2026/src/day3.rs index 55b6b1b..e6963f8 100644 --- a/2026/src/day3.rs +++ b/2026/src/day3.rs @@ -18,15 +18,15 @@ fn part1(input: &Grid) -> u64 { for tree in input.find_all(&b'#') { for size in 1..(biggest_square - tree.x as usize) { if input - .get(&(tree + &Coord2d { x: size as i64, y: 0 })) + .get(&(tree + Coord2d { x: size as i64, y: 0 })) .is_some_and(|c| *c == b'#') && input - .get(&(tree + &Coord2d { y: size as i64, x: 0 })) + .get(&(tree + Coord2d { y: size as i64, x: 0 })) .is_some_and(|c| *c == b'#') && input .get( &(tree - + &Coord2d { + + Coord2d { x: size as i64, y: size as i64, }), @@ -77,13 +77,13 @@ fn other_two(a: &Coord2d, b: &Coord2d) -> [Coord2d; 2] { #[aoc(day3, part2, Pairwise)] fn part2_pairwise(input: &Grid) -> u64 { let trees: Vec = input.find_all(&b'#').collect(); - return trees + trees .iter() .tuple_combinations::<(_, _)>() .filter(|(a, b)| (*b - *a).x >= 0 && (*b - *a).y > 0) - .map(|(a, b)| other_two(&a, &b)) + .map(|(a, b)| other_two(a, b)) .filter(|corners| corners.iter().all(|pos| input.get(&pos) == Some(&b'#'))) - .count() as u64; + .count() as u64 } #[aoc(day3, part2, Brute)]