rust
This is an old revision of the document!
Rust
Debug attribute and println!
#[derive(Debug)] struct Rectangle { width: u32, height: u32, } fn main() { let rect1 = Rectangle { width: 30, height: 50, }; println!("rect1 is {:?}", rect1); // Or with pretty print :#? println!("rect1 is {:#?}", rect1); }
rust.1720638873.txt.gz · Last modified: 2024/07/10 19:14 by utedass
