Enumerate over vector uses tuples
examples/tuples/enumerate-vector/src/main.rs
fn main() { let fruits = vec!["apple", "banana", "peach"]; for (index, name) in fruits.iter().enumerate() { println!("{index}) {name}"); } }
0) apple 1) banana 2) peach
fn main() { let fruits = vec!["apple", "banana", "peach"]; for (index, name) in fruits.iter().enumerate() { println!("{index}) {name}"); } }
0) apple 1) banana 2) peach