Strings In Depth4 / 18
Up next

Build without moving

fn main() {
    let first = String::from("Ada");
    let last = String::from("Lovelace");
    // format! borrows, so first and last stay usable
    let full = format!("{first} {last}");
    println!("{full} <- {first}");
}
What you're solving

format! borrows all its inputs