book/listings/ch04-understanding-ownership/no-listing-05-clone/src/main.rs

9 lines
158 B
Rust

fn main() {
// ANCHOR: here
let s1 = String::from("hello");
let s2 = s1.clone();
println!("s1 = {s1}, s2 = {s2}");
// ANCHOR_END: here
}