Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mutable vector of strings

fn main() {
    let mut names = vec![String::from("snake")];
    names.push(String::from("crab"));
    println!("{:?}", names);
    for name in names {
        println!("{}", name);
    }
}
["snake", "crab"]
snake
crab