From 8ceeb0bf7ace0527b03dd23b28bffa61d4d92bd8 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Wed, 5 Dec 2018 22:09:10 +0200 Subject: Added a convenient debug macro Prints the expression along with it's value. Thanks to Steve Donovan for giving me the idea at the Rust meetup! --- src/bin/day_5.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bin/day_5.rs') diff --git a/src/bin/day_5.rs b/src/bin/day_5.rs index d689e34..2b24d4c 100644 --- a/src/bin/day_5.rs +++ b/src/bin/day_5.rs @@ -17,7 +17,7 @@ fn main() -> Result<(), Box> { polymer }; - println!("Base length after reducing: {}", polymer.len()); + debug!(polymer.len()); let mut min_length = polymer.len(); @@ -28,7 +28,7 @@ fn main() -> Result<(), Box> { min_length = cmp::min(min_length, polymer_without_char.len()); } - println!("Minimum length found: {}", min_length); + debug!(min_length); Ok(()) } -- cgit v1.2.3