From fc8e07b947b40d76dc9d251be9ba4392ee8a4df8 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Mon, 18 May 2020 11:46:02 +0900 Subject: [PATCH] actors: Minimize `futures` dependencies --- actix-web-actors/Cargo.toml | 4 +++- actix-web-actors/src/context.rs | 5 +++-- actix-web-actors/src/ws.rs | 5 +++-- actix-web-actors/tests/test_ws.rs | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/actix-web-actors/Cargo.toml b/actix-web-actors/Cargo.toml index f9bcc65d..b6261695 100644 --- a/actix-web-actors/Cargo.toml +++ b/actix-web-actors/Cargo.toml @@ -21,9 +21,11 @@ actix-web = "3.0.0-alpha.2" actix-http = "2.0.0-alpha.3" actix-codec = "0.2.0" bytes = "0.5.2" -futures = "0.3.1" +futures-channel = { version = "0.3.5", default-features = false } +futures-core = { version = "0.3.5", default-features = false } pin-project = "0.4.6" [dev-dependencies] actix-rt = "1.0.0" env_logger = "0.7" +futures-util = { version = "0.3.5", default-features = false } diff --git a/actix-web-actors/src/context.rs b/actix-web-actors/src/context.rs index c889092d..0839a428 100644 --- a/actix-web-actors/src/context.rs +++ b/actix-web-actors/src/context.rs @@ -1,4 +1,5 @@ use std::collections::VecDeque; +use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll}; @@ -11,8 +12,8 @@ use actix::{ }; use actix_web::error::Error; use bytes::Bytes; -use futures::channel::oneshot::Sender; -use futures::{Future, Stream}; +use futures_channel::oneshot::Sender; +use futures_core::Stream; /// Execution context for http actors pub struct HttpContext diff --git a/actix-web-actors/src/ws.rs b/actix-web-actors/src/ws.rs index b28aeade..3f597253 100644 --- a/actix-web-actors/src/ws.rs +++ b/actix-web-actors/src/ws.rs @@ -1,5 +1,6 @@ //! Websocket integration use std::collections::VecDeque; +use std::future::Future; use std::io; use std::pin::Pin; use std::task::{Context, Poll}; @@ -23,8 +24,8 @@ use actix_web::error::{Error, PayloadError}; use actix_web::http::{header, Method, StatusCode}; use actix_web::{HttpRequest, HttpResponse}; use bytes::{Bytes, BytesMut}; -use futures::channel::oneshot::Sender; -use futures::{Future, Stream}; +use futures_channel::oneshot::Sender; +use futures_core::Stream; /// Do websocket handshake and start ws actor. pub fn start(actor: A, req: &HttpRequest, stream: T) -> Result diff --git a/actix-web-actors/tests/test_ws.rs b/actix-web-actors/tests/test_ws.rs index 076e375d..25977c2c 100644 --- a/actix-web-actors/tests/test_ws.rs +++ b/actix-web-actors/tests/test_ws.rs @@ -2,7 +2,7 @@ use actix::prelude::*; use actix_web::{test, web, App, HttpRequest}; use actix_web_actors::*; use bytes::Bytes; -use futures::{SinkExt, StreamExt}; +use futures_util::{SinkExt, StreamExt}; struct Ws;