diff --git a/rectangles/src/main.rs b/rectangles/src/main.rs index 506fa3d..b6b4fe1 100644 --- a/rectangles/src/main.rs +++ b/rectangles/src/main.rs @@ -6,8 +6,19 @@ fn main() { "The area of the rectangle is {} square pixels.", area(width1, height1) ); + + let rect = (30, 50); + + println!( + "The area of the rectangle is {} square pixels.", + area_tuple(rect) + ); } fn area(width: u32, height: u32) -> u32 { width * height } + +fn area_tuple(dimensions: (u32, u32)) -> u32 { + dimensions.0 * dimensions.1 +}