Skip to content
Quiz · Ownership · lesson 8 of 8

Quiz — passing a String

What happens when this program is built and run?

Rust
fn take(s: String) {
    println!("{s}");
}

fn main() {
    let s = String::from("hi");
    take(s);
    println!("{s}");
}