Skip to content

Commit f672963

Browse files
authored
Merge pull request rust-lang#68 from dwrensha/stream-into-future-doc
clarification about Stream::into_future()
2 parents 6dfd2db + b796be8 commit f672963

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/stream/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,13 @@ pub trait Stream: 'static {
188188

189189
/// Converts this stream into a `Future`.
190190
///
191-
/// A stream can be viewed as simply a future which will resolve to the next
192-
/// element of the stream as well as the stream itself. The returned future
193-
/// can be used to compose streams and futures together by placing
194-
/// everything into the "world of futures".
191+
/// A stream can be viewed as a future which will resolve to a pair containing
192+
/// the next element of the stream plus the remaining stream. If the stream
193+
/// terminates, then the next element is `None` and the remaining stream is
194+
/// still passed back, to allow reclamation of its resources.
195+
///
196+
/// The returned future can be used to compose streams and futures together by
197+
/// placing everything into the "world of futures".
195198
fn into_future(self) -> StreamFuture<Self>
196199
where Self: Sized
197200
{

0 commit comments

Comments
 (0)