mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-05-01 18:58:44 +08:00
15 lines
305 B
Rust
15 lines
305 B
Rust
|
fn main() {
|
||
|
// ANCHOR: here
|
||
|
use std::collections::HashMap;
|
||
|
|
||
|
let mut scores = HashMap::new();
|
||
|
|
||
|
scores.insert(String::from("Blue"), 10);
|
||
|
scores.insert(String::from("Yellow"), 50);
|
||
|
|
||
|
for (key, value) in &scores {
|
||
|
println!("{}: {}", key, value);
|
||
|
}
|
||
|
// ANCHOR_END: here
|
||
|
}
|