trpl-zh-cn/listings/ch05-using-structs-to-structure-related-data/listing-05-12/src/main.rs
2022-02-06 16:43:51 +08:00

15 lines
199 B
Rust
Executable File

#[derive(Debug)]
struct Rectangle {
width: u32,
height: u32,
}
fn main() {
let rect1 = Rectangle {
width: 30,
height: 50,
};
println!("rect1 is {:?}", rect1);
}