diff options
Diffstat (limited to 'async-await/src/hyper.rs')
-rw-r--r-- | async-await/src/hyper.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/async-await/src/hyper.rs b/async-await/src/hyper.rs index c86481b4..37332ee4 100644 --- a/async-await/src/hyper.rs +++ b/async-await/src/hyper.rs @@ -1,6 +1,6 @@ #![feature(await_macro, async_await)] -use tokio::await; +use tokio::async_wait; use tokio::prelude::*; use hyper::Client; @@ -13,7 +13,7 @@ async fn main() { let uri = "http://httpbin.org/ip".parse().unwrap(); - let response = await!({ + let response = async_wait!({ client.get(uri) .timeout(Duration::from_secs(10)) }).unwrap(); @@ -22,7 +22,7 @@ async fn main() { let mut body = response.into_body(); - while let Some(chunk) = await!(body.next()) { + while let Some(chunk) = async_wait!(body.next()) { let chunk = chunk.unwrap(); println!("chunk = {}", str::from_utf8(&chunk[..]).unwrap()); } |