about summary refs log tree commit diff
path: root/src/liballoc/collections
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2018-12-04 11:49:39 -0800
committerGitHub <noreply@github.com>2018-12-04 11:49:39 -0800
commit4bddb763c5982bcce93b1683d4e26dbbc92a5ea6 (patch)
treeb0da0fb5e316d08713d900d07b29652ff2b94e51 /src/liballoc/collections
parent51fdc2bf1431d6ac1f32531f820a937ddbb70048 (diff)
downloadrust-4bddb763c5982bcce93b1683d4e26dbbc92a5ea6.tar.gz
rust-4bddb763c5982bcce93b1683d4e26dbbc92a5ea6.zip
Add example of using the indexing operator to BTreeMap docs
Diffstat (limited to 'src/liballoc/collections')
-rw-r--r--src/liballoc/collections/btree/map.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs
index 24c8fd3a969..0441b180afb 100644
--- a/src/liballoc/collections/btree/map.rs
+++ b/src/liballoc/collections/btree/map.rs
@@ -97,6 +97,9 @@ use self::Entry::*;
 ///     }
 /// }
 ///
+/// // 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 (movie, review) in &movie_reviews {
 ///     println!("{}: \"{}\"", movie, review);