@@ -1080,8 +1080,8 @@ pub trait Iterator {
1080
1080
/// let iter = a.iter().map_while(|x| u32::try_from(*x).ok());
1081
1081
/// let vec = iter.collect::<Vec<_>>();
1082
1082
///
1083
- /// // We have more elements which could fit in u32 (4, 5), but `map_while`
1084
- /// // has stopped on the first `None` from predicate (when working with `-3`)
1083
+ /// // We have more elements which could fit in u32 (4, 5), but `map_while` returned `None` for `-3`
1084
+ /// // (as the `predicate` returned `None`) and `collect` stops at the first `None` entcountered.
1085
1085
/// assert_eq!(vec, vec![0, 1, 2]);
1086
1086
/// ```
1087
1087
///
@@ -1110,18 +1110,8 @@ pub trait Iterator {
1110
1110
/// The `-3` is no longer there, because it was consumed in order to see if
1111
1111
/// the iteration should stop, but wasn't placed back into the iterator.
1112
1112
///
1113
- /// Note that unlike [`take_while`] this iterator is **not** fused:
1114
- ///
1115
- /// ```
1116
- /// #![feature(iter_map_while)]
1117
- /// use std::convert::identity;
1118
- ///
1119
- /// let mut iter = vec![Some(0), None, Some(1)].into_iter().map_while(identity);
1120
- /// assert_eq!(iter.next(), Some(0));
1121
- /// assert_eq!(iter.next(), None);
1122
- /// assert_eq!(iter.next(), Some(1));
1123
- /// ```
1124
- ///
1113
+ /// Note that unlike [`take_while`] this iterator is **not** fused.
1114
+ /// It is also not specified what this iterator returns after the first` None` is returned.
1125
1115
/// If you need fused iterator, use [`fuse`].
1126
1116
///
1127
1117
/// [`Some`]: ../../std/option/enum.Option.html#variant.Some
0 commit comments