fn new(name: String, age: i64) -> User {
        yellow_ln!("[new] name: {}", name);
        // at this point ownership transfered to User
        let user = User { name, age };
        // println!("[new] name: {}", name); // ! err
        // new method doesn't own name anymore

        yellow_ln!("[new] age: {}", age);
        return user;
    }
// the below new fn get ownership of name & age
// it is responsible for destroying or passing
the below new fn get ownership of name & age
it is responsible for destroying or passing
the below new fn get ownership of name & age it is responsible for destroying or passing
fn new(name: String, age: i64) -> User {
        yellow_ln!("[new] name: {}", name);
        // at this point ownership transfered to User
        let user = User { name, age };
        // println!("[new] name: {}", name); // ! err
        // new method doesn't own name anymore
        yellow_ln!("[new] age: {}", age);
        return user;
    }
fn new ( name : String , age : i64 ) -> User { yellow_ln ! ( " " name ) ; // at this point ownership transfered to User let user = User { name , age } ; // println!("[new] name: {}", name); // ! err // new method doesn't own name anymore yellow_ln ! ( " " age ) ; return user ; }
the below new fn get ownership of name & age
it is responsible for destroying or passing
the below new fn get ownership of name & age it is responsible for destroying or passing
name
String
age
i64