Skip to content

Commit e6a7e33

Browse files
weihangloseanmonstar
authored andcommitted
docs(body): wrap_stream using futures_util
1 parent 47407f5 commit e6a7e33

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/body/body.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,16 @@ impl Body {
129129
/// # Example
130130
///
131131
/// ```
132-
/// # extern crate futures;
133-
/// # extern crate hyper;
134132
/// # use hyper::Body;
133+
/// # use futures_util;
135134
/// # fn main() {
136-
/// let chunks = vec![
137-
/// "hello",
138-
/// " ",
139-
/// "world",
135+
/// let chunks: Vec<Result<_, ::std::io::Error>> = vec![
136+
/// Ok("hello"),
137+
/// Ok(" "),
138+
/// Ok("world"),
140139
/// ];
141140
///
142-
/// let stream = futures::stream::iter_ok::<_, ::std::io::Error>(chunks);
141+
/// let stream = futures_util::stream::iter(chunks);
143142
///
144143
/// let body = Body::wrap_stream(stream);
145144
/// # }

0 commit comments

Comments
 (0)