Skip to content
Quiz · Borrowing · lesson 4 of 11

Quiz — &mut to a let

What happens when this program is built and run?

Rust
fn main() {
    let s = String::from("hi");
    let r = &mut s;
    r.push('!');
    println!("{s}");
}