From 4bddb763c5982bcce93b1683d4e26dbbc92a5ea6 Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 4 Dec 2018 11:49:39 -0800 Subject: Add example of using the indexing operator to BTreeMap docs --- src/liballoc/collections/btree/map.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/liballoc') 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); -- cgit 1.4.1-3-g733a5