box-o-sand/rustbyexample/hello.d/print.d/print_debug2.rs

15 lines
217 B
Rust
Raw Normal View History

2023-09-24 14:57:16 +00:00
#[allow(dead_code)]
2020-06-19 02:56:06 +00:00
#[derive(Debug)]
struct Person<'a> {
name: &'a str,
age: u8,
}
fn main() {
let name = "Peter";
let age = 27;
let peter = Person { name, age };
println!("{:#?}", peter);
}