Skip to content

Commit 71d088d

Browse files
ComputerDruidseanmonstar
authored andcommitted
chore(dependencies): update futures to 0.3.1
1 parent 9d9233c commit 71d088d

File tree

10 files changed

+29
-36
lines changed

10 files changed

+29
-36
lines changed

Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ include = [
2121

2222
[dependencies]
2323
bytes = "0.4.6"
24-
futures-core-preview = "=0.3.0-alpha.19"
25-
futures-channel-preview = "=0.3.0-alpha.19"
26-
futures-util-preview = "=0.3.0-alpha.19"
24+
futures-core = "0.3.1"
25+
futures-channel = "0.3.1"
26+
futures-util = "0.3.1"
2727
http = "0.1.15"
2828
http-body = "=0.2.0-alpha.3"
2929
httparse = "1.0"
@@ -48,6 +48,7 @@ tokio-timer = { version = "=0.3.0-alpha.6", optional = true }
4848

4949

5050
[dev-dependencies]
51+
futures-util-a19 = { version = "=0.3.0-alpha.19", package = "futures-util-preview" }
5152
matches = "0.1"
5253
num_cpus = "1.0"
5354
pretty_env_logger = "0.3"

src/body/body.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ impl From<Cow<'static, str>> for Body {
487487
impl Sender {
488488
/// Check to see if this `Sender` can send more data.
489489
pub fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll<crate::Result<()>> {
490-
match self.abort_tx.poll_cancel(cx) {
490+
match self.abort_tx.poll_canceled(cx) {
491491
Poll::Ready(()) => return Poll::Ready(Err(crate::Error::new_closed())),
492492
Poll::Pending => (), // fallthrough
493493
}

src/client/dispatch.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ impl<T, U> Callback<T, U> {
194194
}
195195
}
196196

197-
pub(crate) fn poll_cancel(&mut self, cx: &mut task::Context<'_>) -> Poll<()> {
197+
pub(crate) fn poll_canceled(&mut self, cx: &mut task::Context<'_>) -> Poll<()> {
198198
match *self {
199-
Callback::Retry(ref mut tx) => tx.poll_cancel(cx),
200-
Callback::NoRetry(ref mut tx) => tx.poll_cancel(cx),
199+
Callback::Retry(ref mut tx) => tx.poll_canceled(cx),
200+
Callback::NoRetry(ref mut tx) => tx.poll_canceled(cx),
201201
}
202202
}
203203

@@ -229,7 +229,7 @@ impl<T, U> Callback<T, U> {
229229
},
230230
Poll::Pending => {
231231
// check if the callback is canceled
232-
ready!(cb.as_mut().unwrap().poll_cancel(cx));
232+
ready!(cb.as_mut().unwrap().poll_canceled(cx));
233233
trace!("send_when canceled");
234234
Poll::Ready(())
235235
},

src/client/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ use std::sync::Arc;
6464
use std::time::Duration;
6565

6666
use futures_channel::oneshot;
67-
use futures_util::future::{self, FutureExt as _, Either};
68-
use futures_util::try_future::TryFutureExt as _;
67+
use futures_util::future::{self, FutureExt as _, TryFutureExt as _, Either};
6968
use http::{Method, Request, Response, Uri, Version};
7069
use http::header::{HeaderValue, HOST};
7170
use http::uri::Scheme;

src/client/pool.rs

-3
Original file line numberDiff line numberDiff line change
@@ -733,9 +733,6 @@ impl<T: Poolable + 'static> Future for IdleTask<T> {
733733
type Output = ();
734734

735735
fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<Self::Output> {
736-
// Interval is a Stream
737-
use futures_core::Stream;
738-
739736
loop {
740737
match Pin::new(&mut self.pool_drop_notifier).poll(cx) {
741738
Poll::Ready(Ok(n)) => match n {},

src/proto/h1/dispatch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ where
511511
match self.rx.poll_next(cx) {
512512
Poll::Ready(Some((req, mut cb))) => {
513513
// check that future hasn't been canceled already
514-
match cb.poll_cancel(cx) {
514+
match cb.poll_canceled(cx) {
515515
Poll::Ready(()) => {
516516
trace!("request canceled");
517517
Poll::Ready(None)
@@ -579,7 +579,7 @@ where
579579

580580
fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll<Result<(), ()>> {
581581
match self.callback {
582-
Some(ref mut cb) => match cb.poll_cancel(cx) {
582+
Some(ref mut cb) => match cb.poll_canceled(cx) {
583583
Poll::Ready(()) => {
584584
trace!("callback receiver has dropped");
585585
Poll::Ready(Err(()))

src/proto/h2/client.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use futures_channel::{mpsc, oneshot};
2-
use futures_util::future::{self, FutureExt as _, Either};
2+
use futures_util::future::{self, FutureExt as _, TryFutureExt as _, Either};
33
use futures_util::stream::StreamExt as _;
4-
use futures_util::try_future::TryFutureExt as _;
54
use h2::client::{Builder, SendRequest};
65
use tokio_io::{AsyncRead, AsyncWrite};
76

tests/client.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ use hyper::{Body, Client, Method, Request, StatusCode};
1414

1515
use futures_core::{Future, Stream, TryFuture};
1616
use futures_channel::oneshot;
17-
use futures_util::future::{self, FutureExt};
18-
use futures_util::try_future::{self, TryFutureExt};
19-
use futures_util::try_stream::TryStreamExt;
17+
use futures_util::future::{self, FutureExt, TryFutureExt};
18+
use futures_util::stream::TryStreamExt;
2019
use tokio::runtime::current_thread::Runtime;
2120
use tokio_net::tcp::TcpStream;
2221

@@ -256,7 +255,7 @@ macro_rules! test {
256255

257256
let rx = rx.expect("thread panicked");
258257

259-
rt.block_on(try_future::try_join(res, rx).map_ok(|r| r.0)).map(move |mut resp| {
258+
rt.block_on(future::try_join(res, rx).map_ok(|r| r.0)).map(move |mut resp| {
260259
// Always check that HttpConnector has set the "extra" info...
261260
let extra = resp
262261
.extensions_mut()
@@ -931,10 +930,8 @@ mod dispatch_impl {
931930

932931
use futures_core::{self, Future};
933932
use futures_channel::{mpsc, oneshot};
934-
use futures_util::future::FutureExt;
935-
use futures_util::stream::StreamExt;
936-
use futures_util::try_future::TryFutureExt;
937-
use futures_util::try_stream::TryStreamExt;
933+
use futures_util::future::{FutureExt, TryFutureExt};
934+
use futures_util::stream::{StreamExt, TryStreamExt};
938935
use tokio::runtime::current_thread::Runtime;
939936
use tokio_io::{AsyncRead, AsyncWrite};
940937
use tokio_net::tcp::TcpStream;
@@ -1673,7 +1670,7 @@ mod dispatch_impl {
16731670
let res1 = client.get(url.clone());
16741671
let res2 = client.get(url.clone());
16751672
let res3 = client.get(url.clone());
1676-
rt.block_on(try_future::try_join3(res1, res2, res3)).unwrap();
1673+
rt.block_on(future::try_join3(res1, res2, res3)).unwrap();
16771674

16781675
// Since the client doesn't know it can ALPN at first, it will have
16791676
// started 3 connections. But, the server above will only handle 1,
@@ -1792,9 +1789,8 @@ mod conn {
17921789
use std::time::{Duration};
17931790

17941791
use futures_channel::oneshot;
1795-
use futures_util::future::{self, poll_fn, FutureExt};
1796-
use futures_util::try_future::TryFutureExt;
1797-
use futures_util::try_stream::TryStreamExt;
1792+
use futures_util::future::{self, poll_fn, FutureExt, TryFutureExt};
1793+
use futures_util::stream::TryStreamExt;
17981794
use tokio::runtime::current_thread::Runtime;
17991795
use tokio_io::{AsyncRead, AsyncReadExt as _, AsyncWrite, AsyncWriteExt as _};
18001796
use tokio_net::tcp::{TcpListener as TkTcpListener, TcpStream};

tests/server.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ use std::time::Duration;
1515
use futures_channel::oneshot;
1616
use futures_core::ready;
1717
use futures_core::future::BoxFuture;
18-
use futures_util::future::{self, Either, FutureExt};
19-
use futures_util::stream::StreamExt;
20-
use futures_util::try_future::{self, TryFutureExt};
21-
//use futures_util::try_stream::TryStreamExt;
18+
use futures_util::future::{self, Either, FutureExt, TryFutureExt};
19+
#[cfg(feature = "unstable-stream")]
20+
use futures_util::stream::StreamExt as _;
21+
// TODO: remove once tokio is updated to futures 0.3
22+
use futures_util_a19::stream::StreamExt as _;
2223
use http::header::{HeaderName, HeaderValue};
2324
use tokio_net::driver::Handle;
2425
use tokio_net::tcp::{TcpListener, TcpStream as TkTcpStream};
@@ -879,7 +880,7 @@ fn disable_keep_alive_mid_request() {
879880
.map_err(|_| unreachable!())
880881
.and_then(|socket| {
881882
let srv = Http::new().serve_connection(socket, HelloWorld);
882-
try_future::try_select(srv, rx1)
883+
future::try_select(srv, rx1)
883884
.then(|r| {
884885
match r {
885886
Ok(Either::Left(_)) => panic!("expected rx first"),
@@ -938,7 +939,7 @@ fn disable_keep_alive_post_request() {
938939
_debug: dropped2,
939940
};
940941
let server = Http::new().serve_connection(transport, HelloWorld);
941-
try_future::try_select(server, rx1)
942+
future::try_select(server, rx1)
942943
.then(|r| {
943944
match r {
944945
Ok(Either::Left(_)) => panic!("expected rx first"),

tests/support/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use hyper::client::HttpConnector;
88
use hyper::service::{make_service_fn, service_fn};
99

1010
pub use std::net::SocketAddr;
11-
pub use futures_util::{future, try_future, FutureExt as _, StreamExt as _, TryFutureExt as _, TryStreamExt as _};
11+
pub use futures_util::{future, FutureExt as _, StreamExt as _, TryFutureExt as _, TryStreamExt as _};
1212
//pub use self::futures_channel::oneshot;
1313
pub use hyper::{HeaderMap, StatusCode};
1414
pub use tokio::runtime::current_thread::Runtime;

0 commit comments

Comments
 (0)