Add example of using the indexing operator to BTreeMap docs

This commit is contained in:
Corey Farwell 2018-12-04 11:49:39 -08:00 committed by GitHub
parent 51fdc2bf14
commit 4bddb763c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);