Structs Update Syntax Example

#[derive(Debug)]
struct User {
    username: String,
    email: String,
    active: bool,
}

fn main() {

    let user_1 = User {
        username: String::from("Ferris"),
        email: String::from("ferris@codermine.com"),
        active: true,
    };

    println!("{:?}", user_1);

    
    //Struct update syntax

    let user_2 = User {
        username: String::from("rust"),
        ..user_1
    };
    println!("{:?}", user_2);
}