Quiz · Ownership · lesson 6 of 8
Quiz — a clone is independent
What does the program print?
fn main() {
let mut s1 = String::from("hi");
let s2 = s1.clone();
s1.push('!');
println!("{s1} {s2}");
}What does the program print?
fn main() {
let mut s1 = String::from("hi");
let s2 = s1.clone();
s1.push('!');
println!("{s1} {s2}");
}