mirror of https://github.com/KaiserY/trpl-zh-cn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
329 B
14 lines
329 B
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);
|
|
|
|
let team_name = String::from("Blue");
|
|
let score = scores.get(&team_name).copied().unwrap_or(0);
|
|
// ANCHOR_END: here
|
|
}
|