Strings In Depth2 / 18
Up next

Build a String by pushing

fn main() {
    let mut s = String::new();
    // append a slice, then a single char
    s.push_str("ru");
    s.push('s');
    s.push('t');
    println!("{s}");
}
What you're solving

push_str and push grow in place