As mentioned in Basics, we can use anything which implements IntoIterator with the for loop:
let vector = vec!["foo", "bar", "baz"]; // vectors implement IntoIterator
for val in vector {
println!("{}", val);
}
Expected output:
foo
bar
baz
...