Structs Init Shorthand 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);
    
    let email = String::from("g.fioletti@codermine.com");
    
    
    //Init shorthand
    
    let user_2 = User {
        username: String::from("Gianluca"),
        email,
        active: true,
    };
    
    println!("{:?}", user_2);
}