From 4e806b3e3f7e3bc33581b80f3ebb41ceb98aac64 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 12 Mar 2020 04:30:32 +0900 Subject: [PATCH] actix-tls: Minimize `futures-*` dependencies --- actix-tls/Cargo.toml | 2 +- actix-tls/src/nativetls.rs | 2 +- actix-tls/src/openssl.rs | 4 ++-- actix-tls/src/rustls.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/actix-tls/Cargo.toml b/actix-tls/Cargo.toml index 58baadc1..0d235e22 100644 --- a/actix-tls/Cargo.toml +++ b/actix-tls/Cargo.toml @@ -38,7 +38,7 @@ actix-utils = "1.0.0" actix-rt = "1.0.0" derive_more = "0.99.2" either = "1.5.2" -futures = "0.3.1" +futures-util = { version = "0.3.4", default-features = false } log = "0.4" # openssl diff --git a/actix-tls/src/nativetls.rs b/actix-tls/src/nativetls.rs index 8b2c7cee..a4780db1 100644 --- a/actix-tls/src/nativetls.rs +++ b/actix-tls/src/nativetls.rs @@ -4,7 +4,7 @@ use std::task::{Context, Poll}; use actix_codec::{AsyncRead, AsyncWrite}; use actix_service::{Service, ServiceFactory}; use actix_utils::counter::Counter; -use futures::future::{self, FutureExt, LocalBoxFuture, TryFutureExt}; +use futures_util::future::{self, FutureExt, LocalBoxFuture, TryFutureExt}; pub use native_tls::Error; pub use tokio_tls::{TlsAcceptor, TlsStream}; diff --git a/actix-tls/src/openssl.rs b/actix-tls/src/openssl.rs index 3da8bfc6..3b98e2fe 100644 --- a/actix-tls/src/openssl.rs +++ b/actix-tls/src/openssl.rs @@ -9,7 +9,7 @@ pub use tokio_openssl::{HandshakeError, SslStream}; use actix_codec::{AsyncRead, AsyncWrite}; use actix_service::{Service, ServiceFactory}; use actix_utils::counter::{Counter, CounterGuard}; -use futures::future::{ok, FutureExt, LocalBoxFuture, Ready}; +use futures_util::future::{ok, FutureExt, LocalBoxFuture, Ready}; use crate::MAX_CONN_COUNTER; @@ -105,7 +105,7 @@ impl Future for AcceptorServiceResponse { type Output = Result, HandshakeError>; fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let io = futures::ready!(Pin::new(&mut self.fut).poll(cx))?; + let io = futures_util::ready!(Pin::new(&mut self.fut).poll(cx))?; Poll::Ready(Ok(io)) } } diff --git a/actix-tls/src/rustls.rs b/actix-tls/src/rustls.rs index b71e22a1..4546c24b 100644 --- a/actix-tls/src/rustls.rs +++ b/actix-tls/src/rustls.rs @@ -8,7 +8,7 @@ use std::task::{Context, Poll}; use actix_codec::{AsyncRead, AsyncWrite}; use actix_service::{Service, ServiceFactory}; use actix_utils::counter::{Counter, CounterGuard}; -use futures::future::{ok, Ready}; +use futures_util::future::{ok, Ready}; use tokio_rustls::{Accept, TlsAcceptor}; pub use rust_tls::{ServerConfig, Session}; @@ -108,7 +108,7 @@ impl Future for AcceptorServiceFut { fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.get_mut(); - let res = futures::ready!(Pin::new(&mut this.fut).poll(cx)); + let res = futures_util::ready!(Pin::new(&mut this.fut).poll(cx)); match res { Ok(io) => Poll::Ready(Ok(io)), Err(e) => Poll::Ready(Err(e)),