Skip to content

Commit 4bddb76

Browse files
authored
Add example of using the indexing operator to BTreeMap docs
1 parent 51fdc2b commit 4bddb76

File tree

1 file changed

+3
-0
lines changed
  • src/liballoc/collections/btree

1 file changed

+3
-0
lines changed

src/liballoc/collections/btree/map.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ use self::Entry::*;
9797
/// }
9898
/// }
9999
///
100+
/// // Look up the value for a key (will panic if the key is not found).
101+
/// println!("Review for Jane: {}", book_reviews["Pride and Prejudice"]);
102+
///
100103
/// // iterate over everything.
101104
/// for (movie, review) in &movie_reviews {
102105
/// println!("{}: \"{}\"", movie, review);

0 commit comments

Comments
 (0)