Skip to content

Commit

Permalink
Add example of using the indexing operator to BTreeMap docs
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Dec 4, 2018
1 parent 51fdc2b commit 4bddb76
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/liballoc/collections/btree/map.rs
Expand Up @@ -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);
Expand Down

0 comments on commit 4bddb76

Please sign in to comment.