Add example of using the indexing operator to BTreeMap docs
This commit is contained in:
parent
51fdc2bf14
commit
4bddb763c5
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue