@@ -39,7 +39,7 @@ pub trait TryStreamExt: TryStream {
39
39
/// ```
40
40
/// #![feature(async_await, await_macro)]
41
41
/// # futures::executor::block_on(async {
42
- /// use futures::{ stream, TryStreamExt};
42
+ /// use futures::stream::{self , TryStreamExt};
43
43
///
44
44
/// let mut stream =
45
45
/// stream::iter(vec![Ok(()), Err(5i32)])
@@ -65,7 +65,7 @@ pub trait TryStreamExt: TryStream {
65
65
/// ```
66
66
/// #![feature(async_await, await_macro)]
67
67
/// # futures::executor::block_on(async {
68
- /// use futures::{ stream, TryStreamExt};
68
+ /// use futures::stream::{self , TryStreamExt};
69
69
///
70
70
/// let mut stream =
71
71
/// stream::iter(vec![Ok(5), Err(0)])
@@ -91,7 +91,7 @@ pub trait TryStreamExt: TryStream {
91
91
/// ```
92
92
/// #![feature(async_await, await_macro)]
93
93
/// # futures::executor::block_on(async {
94
- /// use futures::{ stream, TryStreamExt};
94
+ /// use futures::stream::{self , TryStreamExt};
95
95
///
96
96
/// let mut stream =
97
97
/// stream::iter(vec![Ok(5), Err(0)])
@@ -122,7 +122,7 @@ pub trait TryStreamExt: TryStream {
122
122
/// ```
123
123
/// #![feature(async_await, await_macro)]
124
124
/// # futures::executor::block_on(async {
125
- /// use futures::{ stream, TryStreamExt};
125
+ /// use futures::stream::{self , TryStreamExt};
126
126
///
127
127
/// let mut stream = stream::iter(vec![Ok(()), Err(())]);
128
128
///
@@ -154,7 +154,8 @@ pub trait TryStreamExt: TryStream {
154
154
/// ```
155
155
/// #![feature(async_await, await_macro)]
156
156
/// # futures::executor::block_on(async {
157
- /// use futures::{future, stream, TryStreamExt};
157
+ /// use futures::future;
158
+ /// use futures::stream::{self, TryStreamExt};
158
159
///
159
160
/// let mut x = 0i32;
160
161
///
@@ -192,12 +193,12 @@ pub trait TryStreamExt: TryStream {
192
193
/// # Examples
193
194
///
194
195
/// ```
195
- /// # extern crate futures;
196
- /// use std::thread;
197
- ///
198
- /// use futures::prelude::*;
196
+ /// #![feature(async_await, await_macro)]
197
+ /// # futures::executor::block_on(async {
199
198
/// use futures::channel::mpsc;
200
199
/// use futures::executor::block_on;
200
+ /// use futures::stream::TryStreamExt;
201
+ /// use std::thread;
201
202
///
202
203
/// let (mut tx, rx) = mpsc::unbounded();
203
204
///
@@ -208,8 +209,9 @@ pub trait TryStreamExt: TryStream {
208
209
/// tx.unbounded_send(Err(6)).unwrap();
209
210
/// });
210
211
///
211
- /// let output: Result<Vec<i32>, i32> = block_on (rx.try_collect());
212
+ /// let output: Result<Vec<i32>, i32> = await! (rx.try_collect());
212
213
/// assert_eq!(output, Err(6));
214
+ /// # })
213
215
/// ```
214
216
#[ cfg( feature = "std" ) ]
215
217
fn try_collect < C : Default + Extend < Self :: Ok > > ( self ) -> TryCollect < Self , C >
0 commit comments