rust get index of element in array code example
Example: rust get items in a list with index and value
for (i, x) in items.iter().enumerate() {
println!("Item {} = {}", i, x);
}
for (i, x) in items.iter().enumerate() {
println!("Item {} = {}", i, x);
}