From ab0889b661790737ceeb6a03c10d13aa467cad81 Mon Sep 17 00:00:00 2001 From: Max Nuding Date: Thu, 8 Dec 2022 07:58:50 +0000 Subject: [PATCH] moved final calculations to their respective parts --- src/day08/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/day08/mod.rs b/src/day08/mod.rs index e9ff9bf..3c4ae76 100644 --- a/src/day08/mod.rs +++ b/src/day08/mod.rs @@ -76,16 +76,15 @@ pub fn run() { }) .collect::>(); - let count = res.iter().filter(|e| e.0).count(); - let max_score = res.iter().map(|e| e.1).max().unwrap(); - #[cfg(feature = "part1")] { + let count = res.iter().filter(|e| e.0).count(); println!("Day 8, Part 01: {}", count); } #[cfg(feature = "part2")] { + let max_score = res.iter().map(|e| e.1).max().unwrap(); println!("Day 8, Part 02: {}", max_score); } }