trpl-zh-cn/listings/ch08-common-collections/listing-08-21/src/main.rs
2022-02-06 16:43:51 +08:00

12 lines
307 B
Rust
Executable File

fn main() {
// ANCHOR: here
use std::collections::HashMap;
let teams = vec![String::from("Blue"), String::from("Yellow")];
let initial_scores = vec![10, 50];
let mut scores: HashMap<_, _> =
teams.into_iter().zip(initial_scores.into_iter()).collect();
// ANCHOR_END: here
}