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

Update futures-preview to 0.3.0-alpha.16 #28

Merged
merged 2 commits into from
May 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: rust
rust:
- nightly-2019-04-25
- nightly-2019-05-09

before_script: |
rustup component add rustfmt clippy
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ http = "0.1.17"
http-service-hyper = { path = "http-service-hyper", version = "0.2.0" }

[dependencies.futures-preview]
version = "0.3.0-alpha.15"
version = "0.3.0-alpha.16"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</div>

## About
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.
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.

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

Expand All @@ -70,7 +70,7 @@ version = "0.1.1"

**main.rs**
```rust
#![feature(futures_api, async_await, await_macro, existential_type)]
#![feature(async_await, existential_type)]

use futures::future::{self, FutureObj};
use http_service::{HttpService, Response};
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_response.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await, await_macro, existential_type)]
#![feature(async_await, existential_type)]

use futures::future::{self, FutureObj};
use http_service::{HttpService, Response};
Expand Down
2 changes: 1 addition & 1 deletion http-service-hyper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ hyper = "0.12.27"

[dependencies.futures-preview]
features = ["compat"]
version = "0.3.0-alpha.15"
version = "0.3.0-alpha.16"
6 changes: 3 additions & 3 deletions http-service-hyper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#![deny(missing_debug_implementations, nonstandard_style)]
#![warn(missing_docs, missing_doc_code_examples)]
#![cfg_attr(test, deny(warnings))]
#![feature(async_await, await_macro)]
#![feature(async_await)]

use futures::{
compat::{Compat, Compat01As03, Future01CompatExt},
Expand Down Expand Up @@ -40,7 +40,7 @@ where
let service = self.service.clone();
let error = std::io::Error::from(std::io::ErrorKind::Other);
async move {
let connection = await!(service.connect().into_future()).map_err(|_| error)?;
let connection = service.connect().into_future().await.map_err(|_| error)?;
Ok(WrapConnection {
service,
connection,
Expand Down Expand Up @@ -72,7 +72,7 @@ where
let fut = self.service.respond(&mut self.connection, req);

async move {
let res: http::Response<_> = await!(fut.into_future()).map_err(|_| error)?;
let res: http::Response<_> = fut.into_future().await.map_err(|_| error)?;
Ok(res.map(|body| hyper::Body::wrap_stream(body.compat())))
}
.boxed()
Expand Down
2 changes: 1 addition & 1 deletion http-service-mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ version = "0.2.0"
http-service = { version = "0.2.0", path = ".." }

[dependencies.futures-preview]
version = "0.3.0-alpha.15"
version = "0.3.0-alpha.16"
11 changes: 4 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//!
//! ## Example
//! ```no_run, rust, ignore
//! #![feature(futures_api, async_await, await_macro, existential_type)]
//! #![feature(async_await, existential_type)]
//!
//! use futures::{
//! future::{self, FutureObj},
Expand Down Expand Up @@ -57,19 +57,17 @@
#![deny(missing_debug_implementations, nonstandard_style)]
#![warn(missing_docs, missing_doc_code_examples)]
#![cfg_attr(test, deny(warnings))]
#![feature(async_await, await_macro, arbitrary_self_types)]
#![feature(async_await, arbitrary_self_types)]

use bytes::Bytes;
use futures::{
future,
prelude::*,
stream::{self, BoxStream},
task::Context,
Poll,
task::{Context, Poll},
};

use std::fmt;
use std::marker::Unpin;
use std::pin::Pin;

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

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