File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1139,6 +1139,10 @@ pub trait StreamExt: Stream {
1139
1139
1140
1140
/// Maps items while `predicate` returns [`Some`].
1141
1141
///
1142
+ /// This stream is not fused. After the predicate returns [`None`] the stream still
1143
+ /// contains remaining items that can be obtained by subsequent `next` calls.
1144
+ /// You can [`fuse`](StreamExt::fuse) the stream if this behavior is undesirable.
1145
+ ///
1142
1146
/// # Examples
1143
1147
///
1144
1148
/// ```
@@ -1151,6 +1155,10 @@ pub trait StreamExt: Stream {
1151
1155
/// assert_eq!(s.next().await, Some(0));
1152
1156
/// assert_eq!(s.next().await, Some(1));
1153
1157
/// assert_eq!(s.next().await, None);
1158
+ ///
1159
+ /// // Continue to iterate the stream.
1160
+ /// assert_eq!(s.next().await, Some(2));
1161
+ /// assert_eq!(s.next().await, None);
1154
1162
/// # });
1155
1163
/// ```
1156
1164
fn map_while < B , P > ( self , predicate : P ) -> MapWhile < Self , P >
You can’t perform that action at this time.
0 commit comments