fn main(){ let a = &[1, 2, 3]; for n in a.iter(){ println!("{}", n); } for (i, n) in a.iter().enumerate(){ println!("{}: {}", i, n); } for (i, n) in a.iter().skip(1).enumerate(){ println!("{}: {}", i, n); } let result : Vec<_> = a.iter().zip(a.iter().skip(1)).map(|(a, b)| a*b).collect(); println!("{:?}", result); }