Skip to content

Commit

Permalink
Improve iter_mut example. Add that it is fused iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
JustForFun88 committed Apr 4, 2022
1 parent 7f8aed8 commit 25d8a9e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,10 @@ impl<K1, K2, V> FusedIterator for Iter<'_, K1, K2, V> {}
/// iter.next().map(|(_, _, v)| v.push_str(" coin"));
/// iter.next().map(|(_, _, v)| v.push_str(" coin"));
///
/// // It is fused iterator
/// assert_eq!(iter.next(), None);
/// assert_eq!(iter.next(), None);
///
/// assert_eq!(map.get_key1(&1).unwrap(), &"One coin".to_owned() );
/// assert_eq!(map.get_key1(&2).unwrap(), &"Two coin".to_owned() );
/// assert_eq!(map.get_key1(&3).unwrap(), &"Three coin".to_owned());
Expand Down

0 comments on commit 25d8a9e

Please sign in to comment.