Debug trait fun
This commit is contained in:
parent
68db30f013
commit
31e52d6224
@ -1,3 +1,4 @@
|
|||||||
|
#[derive(Debug)]
|
||||||
struct Rectangle {
|
struct Rectangle {
|
||||||
width: u32,
|
width: u32,
|
||||||
height: u32,
|
height: u32,
|
||||||
@ -6,6 +7,8 @@ struct Rectangle {
|
|||||||
fn main() {
|
fn main() {
|
||||||
let rect1 = Rectangle { width: 30, height: 50 };
|
let rect1 = Rectangle { width: 30, height: 50 };
|
||||||
|
|
||||||
|
println!("rect1 is {:?}", rect1);
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"The area of the rectangle is {} square pixels.",
|
"The area of the rectangle is {} square pixels.",
|
||||||
area(&rect1)
|
area(&rect1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user