diff --git a/src/ch05-00-structs.md b/src/ch05-00-structs.md index 6e54d2db4..d4e55a139 100644 --- a/src/ch05-00-structs.md +++ b/src/ch05-00-structs.md @@ -79,7 +79,10 @@ fn main() { let length1 = 50; let width1 = 30; - println!("The area of the rectangle is {}", area(length1, width1)); + println!( + "The area of the rectangle is {} square pixels.", + area(length1, width1) + ); } fn area(length: u32, width: u32) -> u32 { @@ -90,7 +93,7 @@ fn area(length: u32, width: u32) -> u32 { Let's try running this program with `cargo run`: ```bash -The area of the rectangle is 1500 +The area of the rectangle is 1500 square pixels. ``` ### Refactoring with Tuples @@ -120,7 +123,10 @@ Filename: src/main.rs fn main() { let rect1 = (50, 30); - println!("The area of the rectangle is {}", area(rect1)); + println!( + "The area of the rectangle is {} square pixels.", + area(rect1) + ); } fn area(dimensions: (u32, u32)) -> u32 { @@ -161,7 +167,10 @@ struct Rectangle { fn main() { let rect1 = Rectangle { length: 50, width: 30 }; - println!("The area of the rectangle is {}", area(&rect1)); + println!( + "The area of the rectangle is {} square pixels.", + area(&rect1) + ); } fn area(rectangle: &Rectangle) -> u32 {