struct Rectangle {
width:u32, height:u32
}
impl Rectangle {
fn area(&self)->u32 {
self.width * self.height
}
}
fn main() {
let r = Rectangle {
width:27,
height:13
};
println!("width:{} - height:{} - area:{}", r.width, r.height, r.area());
}
/*
run:
width:27 - height:13 - area:351
*/