Rust - Ownership - Clone


To create a deep copy of a variable, using the clone method is required.

let s1 = String::from("Daltie");
let s2 = s1.clone();

println!("s1 = {}, s2 = {}", s1, s2);