fn main() {
let conversation = vec!["hello","bye","why go so fast", "i dont like u", "----"];
for word in &conversation {
println!("{}",word);
}
for word in conversation.iter() {
println!("{}",word);
}
}
Output:
hello
bye
why go so fast
i dont like u
----
hello
bye
why go so fast
i dont like u
----
Errors:
Compiling playground v0.0.1 (/playground)
Finished dev [unoptimized + debuginfo] target(s) in 1.10s
Running `target/debug/playground`