1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-04 15:41:57 +02:00

fix an error in hashmap.md (#2339)

There is a small syntax error.
This commit is contained in:
vegetabledogdog 2024-09-03 21:42:12 +08:00 committed by GitHub
parent 30ae1f4f0d
commit cab287849b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,7 +51,7 @@ fn main() {
.get("Harry Potter and the Sorcerer's Stone")
.unwrap_or(&336);
let pc2 = page_counts
.entry("The Hunger Games".to_string())
.entry("The Hunger Games")
.or_insert(374);
```
- Unlike `vec!`, there is unfortunately no standard `hashmap!` macro.