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

Commit 1174639

Browse files
taiki-eyoshuawuyts
authored andcommitted
Update futures-preview to 0.3.0-alpha.16 (#28)
* Replace await! macro with await syntax * Update futures-preview to 0.3.0-alpha.16
1 parent 6b9b298 commit 1174639

File tree

8 files changed

+14
-17
lines changed

8 files changed

+14
-17
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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ http = "0.1.17"
1818
http-service-hyper = { path = "http-service-hyper", version = "0.2.0" }
1919

2020
[dependencies.futures-preview]
21-
version = "0.3.0-alpha.15"
21+
version = "0.3.0-alpha.16"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
</div>
4848

4949
## About
50-
The crate `http-service` provides the necessary types and traits to implement your own HTTP Server. It uses `hyper` for the lower level TCP abstraction.
50+
The crate `http-service` provides the necessary types and traits to implement your own HTTP Server. It uses `hyper` for the lower level TCP abstraction.
5151

5252
You can use the workspace member [`http-service-hyper`](https://crates.io/crates/http-service-hyper) to run your HTTP Server.
5353

@@ -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(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/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ hyper = "0.12.27"
1818

1919
[dependencies.futures-preview]
2020
features = ["compat"]
21-
version = "0.3.0-alpha.15"
21+
version = "0.3.0-alpha.16"

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()

http-service-mock/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ version = "0.2.0"
1414
http-service = { version = "0.2.0", path = ".." }
1515

1616
[dependencies.futures-preview]
17-
version = "0.3.0-alpha.15"
17+
version = "0.3.0-alpha.16"

src/lib.rs

Lines changed: 4 additions & 7 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(async_await, existential_type)]
77
//!
88
//! use futures::{
99
//! future::{self, FutureObj},
@@ -57,19 +57,17 @@
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::{
6464
future,
6565
prelude::*,
6666
stream::{self, BoxStream},
67-
task::Context,
68-
Poll,
67+
task::{Context, Poll},
6968
};
7069

7170
use std::fmt;
72-
use std::marker::Unpin;
7371
use std::pin::Pin;
7472

7573
/// The raw body of an http request or response.
@@ -96,11 +94,10 @@ impl Body {
9694
}
9795

9896
/// Reads the stream into a new `Vec`.
99-
#[allow(unused_mut)]
10097
#[allow(clippy::wrong_self_convention)] // https://github.com/rust-lang/rust-clippy/issues/4037
10198
pub async fn into_vec(mut self) -> std::io::Result<Vec<u8>> {
10299
let mut bytes = Vec::new();
103-
while let Some(chunk) = await!(self.next()) {
100+
while let Some(chunk) = self.next().await {
104101
bytes.extend(chunk?);
105102
}
106103
Ok(bytes)

0 commit comments

Comments
 (0)