]> git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch08-common-collections/listing-08-24/src/main.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / doc / book / listings / ch08-common-collections / listing-08-24 / src / main.rs
1 fn main() {
2 // ANCHOR: here
3 use std::collections::HashMap;
4
5 let mut scores = HashMap::new();
6 scores.insert(String::from("Blue"), 10);
7
8 scores.entry(String::from("Yellow")).or_insert(50);
9 scores.entry(String::from("Blue")).or_insert(50);
10
11 println!("{:?}", scores);
12 // ANCHOR_END: here
13 }