diff options
| author | bors <bors@rust-lang.org> | 2018-12-28 06:52:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-12-28 06:52:15 +0000 |
| commit | ee49bf8964492ad22f530cbcadcafc6704ec44c3 (patch) | |
| tree | a0ce7dd6363ddd204cc58731aed97471330e5d1e /src/libstd | |
| parent | e8ca35e63dda82a8b5fa8eb72cf3e490a5794a46 (diff) | |
| parent | adfc0667bc0e452aed0f5e65452c00f775b48ef4 (diff) | |
| download | rust-ee49bf8964492ad22f530cbcadcafc6704ec44c3.tar.gz rust-ee49bf8964492ad22f530cbcadcafc6704ec44c3.zip | |
Auto merge of #55519 - fhartwig:hashmap-index-example, r=Centril
Add example of using the indexing operator to HashMap docs Fixes #52575
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 86a8e0f5baf..91c4e990e00 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -309,6 +309,9 @@ const DISPLACEMENT_THRESHOLD: usize = 128; /// } /// } /// +/// // Look up the value for a key (will panic if the key is not found). +/// println!("Review for Jane: {}", book_reviews["Pride and Prejudice"]); +/// /// // Iterate over everything. /// for (book, review) in &book_reviews { /// println!("{}: \"{}\"", book, review); |
