Clone
fn main(){ let s1 = String::from("hello"); let s2 = s1.clone(); println!("s1 is {}", s1); println!("s1 is {}", s2); }
- No automatic deep copy
fn main(){ let s1 = String::from("hello"); let s2 = s1.clone(); println!("s1 is {}", s1); println!("s1 is {}", s2); }