docs(body): wrap_stream using futures_util

This commit is contained in:
Weihang Lo
2019-07-13 19:10:31 +08:00
committed by Sean McArthur
parent 47407f5c01
commit e6a7e33cf4

View File

@@ -129,17 +129,16 @@ impl Body {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// # extern crate futures;
/// # extern crate hyper;
/// # use hyper::Body; /// # use hyper::Body;
/// # use futures_util;
/// # fn main() { /// # fn main() {
/// let chunks = vec![ /// let chunks: Vec<Result<_, ::std::io::Error>> = vec![
/// "hello", /// Ok("hello"),
/// " ", /// Ok(" "),
/// "world", /// Ok("world"),
/// ]; /// ];
/// ///
/// let stream = futures::stream::iter_ok::<_, ::std::io::Error>(chunks); /// let stream = futures_util::stream::iter(chunks);
/// ///
/// let body = Body::wrap_stream(stream); /// let body = Body::wrap_stream(stream);
/// # } /// # }