From dd3bec83bfdfdc9e7917024f0670db67dcbcce67 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 12 Mar 2020 04:23:04 +0900 Subject: [PATCH] actix-ioframe: Minimize `futures-*` dependencies --- actix-ioframe/Cargo.toml | 4 +++- actix-ioframe/src/connect.rs | 4 ++-- actix-ioframe/src/dispatcher.rs | 2 +- actix-ioframe/src/service.rs | 2 +- actix-ioframe/tests/test_server.rs | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/actix-ioframe/Cargo.toml b/actix-ioframe/Cargo.toml index 555efada..f9c144a7 100644 --- a/actix-ioframe/Cargo.toml +++ b/actix-ioframe/Cargo.toml @@ -22,10 +22,12 @@ actix-utils = "1.0.4" actix-rt = "1.0.0" bytes = "0.5.3" either = "1.5.3" -futures = "0.3.1" +futures-sink = { version = "0.3.4", default-features = false } +futures-core = { version = "0.3.4", default-features = false } pin-project = "0.4.6" log = "0.4" [dev-dependencies] actix-connect = "2.0.0-alpha.2" actix-testing = "1.0.0" +futures-util = { version = "0.3.4", default-features = false } diff --git a/actix-ioframe/src/connect.rs b/actix-ioframe/src/connect.rs index 85248fe4..4e2980d1 100644 --- a/actix-ioframe/src/connect.rs +++ b/actix-ioframe/src/connect.rs @@ -4,7 +4,7 @@ use std::task::{Context, Poll}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed}; use actix_utils::mpsc::Receiver; -use futures::Stream; +use futures_core::stream::Stream; pub struct Connect where @@ -90,7 +90,7 @@ where } } -impl futures::Sink<::Item> +impl futures_sink::Sink<::Item> for ConnectResult where Io: AsyncRead + AsyncWrite, diff --git a/actix-ioframe/src/dispatcher.rs b/actix-ioframe/src/dispatcher.rs index 3be8963a..b7d5dd9f 100644 --- a/actix-ioframe/src/dispatcher.rs +++ b/actix-ioframe/src/dispatcher.rs @@ -5,7 +5,7 @@ use std::task::{Context, Poll}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed}; use actix_service::Service; use actix_utils::mpsc; -use futures::Stream; +use futures_core::stream::Stream; use pin_project::pin_project; use log::debug; diff --git a/actix-ioframe/src/service.rs b/actix-ioframe/src/service.rs index d679b45b..a562fbb5 100644 --- a/actix-ioframe/src/service.rs +++ b/actix-ioframe/src/service.rs @@ -7,7 +7,7 @@ use std::task::{Context, Poll}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed}; use actix_service::{IntoService, IntoServiceFactory, Service, ServiceFactory}; use either::Either; -use futures::{ready, Stream}; +use futures_core::{ready, stream::Stream}; use pin_project::project; use crate::connect::{Connect, ConnectResult}; diff --git a/actix-ioframe/tests/test_server.rs b/actix-ioframe/tests/test_server.rs index b1f7f301..9d3775b3 100644 --- a/actix-ioframe/tests/test_server.rs +++ b/actix-ioframe/tests/test_server.rs @@ -6,7 +6,7 @@ use actix_service::{fn_factory_with_config, fn_service, IntoService, Service}; use actix_testing::TestServer; use actix_utils::mpsc; use bytes::{Bytes, BytesMut}; -use futures::future::ok; +use futures_util::future::ok; use actix_ioframe::{Builder, Connect, FactoryBuilder};