Demonstrate the use of the dbg macro

This commit is contained in:
Manuel Thalmann 2024-11-26 00:11:17 +01:00
parent f9841faa16
commit d9963ced18

View file

@ -5,10 +5,11 @@ struct Rectangle {
}
fn main() {
let scale = 2;
let rect1 = Rectangle {
width: 30,
width: dbg!(30 * scale),
height: 50,
};
println!("rect1 is {rect1:#?}");
dbg!(&rect1);
}