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

16 lines
212 B
Rust
Executable File

#[derive(Debug)]
struct Rectangle {
width: u32,
height: u32,
}
fn main() {
let scale = 2;
let rect1 = Rectangle {
width: dbg!(30 * scale),
height: 50,
};
dbg!(&rect1);
}