Skip to content

Commit 997e811

Browse files
authored
Merge pull request #402 from async-rs/fuse-docs
update Stream::fuse docs
2 parents 11d0577 + b3ae6f2 commit 997e811

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/stream/stream/fuse.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ use crate::stream::Stream;
66
use crate::task::{Context, Poll};
77

88
pin_project! {
9-
/// A `Stream` that is permanently closed once a single call to `poll` results in
10-
/// `Poll::Ready(None)`, returning `Poll::Ready(None)` for all future calls to `poll`.
9+
/// A stream that yields `None` forever after the underlying stream yields `None` once.
1110
///
1211
/// This `struct` is created by the [`fuse`] method on [`Stream`]. See its
1312
/// documentation for more.

src/stream/stream/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,11 @@ extension_trait! {
505505
}
506506

507507
#[doc = r#"
508-
Transforms this `Stream` into a "fused" `Stream` such that after the first time
509-
`poll` returns `Poll::Ready(None)`, all future calls to `poll` will also return
510-
`Poll::Ready(None)`.
508+
Creates a stream which ends after the first `None`.
509+
510+
After a stream returns `None`, future calls may or may not yield `Some(T)` again.
511+
`fuse()` adapts an iterator, ensuring that after a `None` is given, it will always
512+
return `None` forever.
511513
512514
# Examples
513515

0 commit comments

Comments
 (0)