fn main() {
    struct Person {
        first_name : String,
        last_name : String,
    }
    
    let mut per : Person = Person{
        first_name : "Tejkiran".to_string(),
        last_name : "manoharan".to_string(),
    };
    
    let per1 = per_return(& mut per);
    
    println!("{}",per1.first_name);
    println!("{}",per.first_name);
}

fn per_return<T>(per : & mut T) -> &T{
    per
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: