diff --git a/Cargo.toml b/Cargo.toml index 1e3e7aacaf..456e005fba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ futures-core = { version = "0.3", default-features = false } futures-channel = "0.3" futures-util = { version = "0.3", default-features = false } http = "0.2" -http-body = "0.2" +http-body = "0.3" httparse = "1.0" h2 = "0.2" itoa = "0.4.1" @@ -49,7 +49,7 @@ spmc = "0.3" serde = "1.0" serde_derive = "1.0" serde_json = "1.0" -tokio = { version = "0.2.2", features = ["fs", "macros", "rt-util", "sync", "time", "test-util"] } +tokio = { version = "0.2.2", features = ["fs", "macros", "io-std", "rt-util", "sync", "time", "test-util"] } tokio-test = "0.2" url = "1.0" diff --git a/benches/end_to_end.rs b/benches/end_to_end.rs index 0f217b1645..68ee7f053d 100644 --- a/benches/end_to_end.rs +++ b/benches/end_to_end.rs @@ -319,7 +319,7 @@ impl Opts { async { let res = fut.await.expect("client wait"); let mut body = res.into_body(); - while let Some(_chunk) = body.next().await {} + while let Some(_chunk) = body.data().await {} } }; @@ -356,7 +356,7 @@ fn spawn_server(rt: &mut tokio::runtime::Runtime, opts: &Opts) -> SocketAddr { .serve(make_service_fn( move |_| async move { Ok::<_, hyper::Error>(service_fn(move |req: Request
| async move { let mut req_body = req.into_body(); - while let Some(_chunk) = req_body.next().await {} + while let Some(_chunk) = req_body.data().await {} Ok::<_, hyper::Error>(Response::new(Body::from(body))) })) })) diff --git a/examples/client.rs b/examples/client.rs index f488bc8916..f60990e024 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -1,9 +1,9 @@ #![deny(warnings)] #![warn(rust_2018_idioms)] use std::env; -use std::io::{self, Write}; use hyper::{Client, body::HttpBody as _}; +use tokio::io::{self, AsyncWriteExt as _}; // A simple type alias so as to DRY. type Result