trpl-zh-cn/listings/ch18-patterns-and-matching/listing-18-03/src/main.rs

10 lines
200 B
Rust
Raw Normal View History

2022-02-06 16:43:51 +08:00
fn main() {
// ANCHOR: here
let v = vec!['a', 'b', 'c'];
for (index, value) in v.iter().enumerate() {
println!("{} is at index {}", value, index);
}
// ANCHOR_END: here
}