for s in split { println!("{}", s) } let vec = split.collect::<Vec<&str>>(); // OR let vec: Vec<&str> = split.collect();