📅  最后修改于: 2022-03-11 14:49:25.930000             🧑  作者: Mango
// note: slice indices are of type `usize`
let numbers: Vec = vec!(1,2,3,4);
// Use the operator "as usize" to index inside a for loop or similar.
for i in 0..4 {
println!("{}", numbers[i as usize]);
}