Quiz · Borrowing · lesson 4 of 11
Quiz — &mut to a let
What happens when this program is built and run?
fn main() {
let s = String::from("hi");
let r = &mut s;
r.push('!');
println!("{s}");
}What happens when this program is built and run?
fn main() {
let s = String::from("hi");
let r = &mut s;
r.push('!');
println!("{s}");
}