Skip to content
This repository was archived by the owner on Jun 21, 2020. It is now read-only.

Commit ace0d8a

Browse files
committed
Replace await! macro with await syntax
1 parent 9cad3a4 commit ace0d8a

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: rust
22
rust:
3-
- nightly-2019-04-25
3+
- nightly-2019-05-09
44

55
before_script: |
66
rustup component add rustfmt clippy

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ version = "0.1.1"
7070

7171
**main.rs**
7272
```rust
73-
#![feature(futures_api, async_await, await_macro, existential_type)]
73+
#![feature(futures_api, async_await, existential_type)]
7474

7575
use futures::future::{self, FutureObj};
7676
use http_service::{HttpService, Response};

examples/simple_response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(async_await, await_macro, existential_type)]
1+
#![feature(async_await, existential_type)]
22

33
use futures::future::{self, FutureObj};
44
use http_service::{HttpService, Response};

http-service-hyper/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#![deny(missing_debug_implementations, nonstandard_style)]
55
#![warn(missing_docs, missing_doc_code_examples)]
66
#![cfg_attr(test, deny(warnings))]
7-
#![feature(async_await, await_macro)]
7+
#![feature(async_await)]
88

99
use futures::{
1010
compat::{Compat, Compat01As03, Future01CompatExt},
@@ -40,7 +40,7 @@ where
4040
let service = self.service.clone();
4141
let error = std::io::Error::from(std::io::ErrorKind::Other);
4242
async move {
43-
let connection = await!(service.connect().into_future()).map_err(|_| error)?;
43+
let connection = service.connect().into_future().await.map_err(|_| error)?;
4444
Ok(WrapConnection {
4545
service,
4646
connection,
@@ -72,7 +72,7 @@ where
7272
let fut = self.service.respond(&mut self.connection, req);
7373

7474
async move {
75-
let res: http::Response<_> = await!(fut.into_future()).map_err(|_| error)?;
75+
let res: http::Response<_> = fut.into_future().await.map_err(|_| error)?;
7676
Ok(res.map(|body| hyper::Body::wrap_stream(body.compat())))
7777
}
7878
.boxed()

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//!
44
//! ## Example
55
//! ```no_run, rust, ignore
6-
//! #![feature(futures_api, async_await, await_macro, existential_type)]
6+
//! #![feature(futures_api, async_await, existential_type)]
77
//!
88
//! use futures::{
99
//! future::{self, FutureObj},
@@ -57,7 +57,7 @@
5757
#![deny(missing_debug_implementations, nonstandard_style)]
5858
#![warn(missing_docs, missing_doc_code_examples)]
5959
#![cfg_attr(test, deny(warnings))]
60-
#![feature(async_await, await_macro, arbitrary_self_types)]
60+
#![feature(async_await, arbitrary_self_types)]
6161

6262
use bytes::Bytes;
6363
use futures::{
@@ -99,7 +99,7 @@ impl Body {
9999
#[allow(clippy::wrong_self_convention)] // https://github.com/rust-lang/rust-clippy/issues/4037
100100
pub async fn into_vec(mut self) -> std::io::Result<Vec<u8>> {
101101
let mut bytes = Vec::new();
102-
while let Some(chunk) = await!(self.next()) {
102+
while let Some(chunk) = self.next().await {
103103
bytes.extend(chunk?);
104104
}
105105
Ok(bytes)

0 commit comments

Comments
 (0)