File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -637,16 +637,15 @@ pub trait Iterator {
637
637
/// let a = ["1", "2", "lol"];
638
638
///
639
639
/// let mut iter = a.iter()
640
- /// .map(|s| s.parse().ok())
641
- /// .filter(|s| s.is_some());
640
+ /// .map(|s| s.parse())
641
+ /// .filter(|s| s.is_ok())
642
+ /// .map(|s| s.unwrap());
642
643
///
643
- /// assert_eq!(iter.next(), Some(Some(1) ));
644
- /// assert_eq!(iter.next(), Some(Some(2) ));
644
+ /// assert_eq!(iter.next(), Some(1 ));
645
+ /// assert_eq!(iter.next(), Some(2 ));
645
646
/// assert_eq!(iter.next(), None);
646
647
/// ```
647
648
///
648
- /// There's an extra layer of [`Some`] in there.
649
- ///
650
649
/// [`Option<T>`]: ../../std/option/enum.Option.html
651
650
/// [`Some`]: ../../std/option/enum.Option.html#variant.Some
652
651
/// [`None`]: ../../std/option/enum.Option.html#variant.None
You can’t perform that action at this time.
0 commit comments