Also, we make it debuggable
fn main() {
let user = User {
active: true,
username: String::from("someusername123"),
email: String::from("someone@example.com"),
sign_in_count: 1,
};
println!("{:?}", user);
let user2 = User {
email: String::from("another@example.com"),
..user.clone()
};
println!("{:?}", user2);
}
// This is where the magic happens!
#[derive(Clone, Debug)]
struct User {
active: bool,
username: String,
email: String,
sign_in_count: u64,
}