From 2b3f04ce4cb9cd0286757f29d9cecbf2b3036a8c Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Mon, 25 Nov 2024 23:59:14 +0100 Subject: [PATCH] Add code for printing the details of the rectangle --- rectangles/src/main.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rectangles/src/main.rs b/rectangles/src/main.rs index 62ef9ac..67e0b92 100644 --- a/rectangles/src/main.rs +++ b/rectangles/src/main.rs @@ -1,3 +1,4 @@ +#[derive(Debug)] struct Rectangle { width: u32, height: u32, @@ -9,12 +10,5 @@ fn main() { height: 50, }; - println!( - "The area of the rectangle is {} square pixels.", - area(&rect1) - ); -} - -fn area(rectangle: &Rectangle) -> u32 { - rectangle.width * rectangle.height + println!("rect1 is {rect1:?}"); }