From d9963ced183b1bccfebd8c1804f58f4c87c08ac5 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 26 Nov 2024 00:11:17 +0100 Subject: [PATCH] Demonstrate the use of the `dbg` macro --- rectangles/src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rectangles/src/main.rs b/rectangles/src/main.rs index f763b50..dd03429 100644 --- a/rectangles/src/main.rs +++ b/rectangles/src/main.rs @@ -5,10 +5,11 @@ struct Rectangle { } fn main() { + let scale = 2; let rect1 = Rectangle { - width: 30, + width: dbg!(30 * scale), height: 50, }; - println!("rect1 is {rect1:#?}"); + dbg!(&rect1); }