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
318 B
14 lines
318 B
3 years ago
|
fn main() {
|
||
|
// ANCHOR: here
|
||
|
use std::collections::HashMap;
|
||
|
|
||
|
let mut scores = HashMap::new();
|
||
|
scores.insert(String::from("Blue"), 10);
|
||
|
|
||
|
scores.entry(String::from("Yellow")).or_insert(50);
|
||
|
scores.entry(String::from("Blue")).or_insert(50);
|
||
|
|
||
|
println!("{:?}", scores);
|
||
|
// ANCHOR_END: here
|
||
|
}
|