diff --git a/actix-codec/Cargo.toml b/actix-codec/Cargo.toml index d647ab70..cab79a9e 100644 --- a/actix-codec/Cargo.toml +++ b/actix-codec/Cargo.toml @@ -19,8 +19,8 @@ path = "src/lib.rs" [dependencies] bitflags = "1.2.1" bytes = "0.5.2" -futures-core = "0.3.1" -futures-sink = "0.3.1" +futures-core = { version = "0.3.4", default-features = false } +futures-sink = { version = "0.3.4", default-features = false } tokio = { version = "0.2.4", default-features=false } tokio-util = { version = "0.2.0", default-features=false, features=["codec"] } log = "0.4" diff --git a/actix-connect/Cargo.toml b/actix-connect/Cargo.toml index fb1674e5..739dfee8 100644 --- a/actix-connect/Cargo.toml +++ b/actix-connect/Cargo.toml @@ -37,7 +37,7 @@ actix-utils = "1.0.6" actix-rt = "1.0.0" derive_more = "0.99.2" either = "1.5.3" -futures = "0.3.1" +futures-util = { version = "0.3.4", default-features = false } http = { version = "0.2.0", optional = true } log = "0.4" trust-dns-proto = { version = "0.19", default-features = false, features = ["tokio-runtime"] } diff --git a/actix-connect/src/connector.rs b/actix-connect/src/connector.rs index e2ed8e2b..d631d684 100644 --- a/actix-connect/src/connector.rs +++ b/actix-connect/src/connector.rs @@ -8,7 +8,7 @@ use std::task::{Context, Poll}; use actix_rt::net::TcpStream; use actix_service::{Service, ServiceFactory}; -use futures::future::{err, ok, BoxFuture, Either, FutureExt, Ready}; +use futures_util::future::{err, ok, BoxFuture, Either, FutureExt, Ready}; use super::connect::{Address, Connect, Connection}; use super::error::ConnectError; diff --git a/actix-connect/src/resolve.rs b/actix-connect/src/resolve.rs index 70dd511a..faf68a19 100644 --- a/actix-connect/src/resolve.rs +++ b/actix-connect/src/resolve.rs @@ -5,7 +5,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; use actix_service::{Service, ServiceFactory}; -use futures::future::{ok, Either, Ready}; +use futures_util::future::{ok, Either, Ready}; use trust_dns_resolver::TokioAsyncResolver as AsyncResolver; use trust_dns_resolver::{error::ResolveError, lookup_ip::LookupIp}; diff --git a/actix-connect/src/service.rs b/actix-connect/src/service.rs index dcd03d2c..f337382b 100644 --- a/actix-connect/src/service.rs +++ b/actix-connect/src/service.rs @@ -5,7 +5,7 @@ use std::task::{Context, Poll}; use actix_rt::net::TcpStream; use actix_service::{Service, ServiceFactory}; use either::Either; -use futures::future::{ok, Ready}; +use futures_util::future::{ok, Ready}; use trust_dns_resolver::TokioAsyncResolver as AsyncResolver; use crate::connect::{Address, Connect, Connection}; diff --git a/actix-connect/src/ssl/openssl.rs b/actix-connect/src/ssl/openssl.rs index c9cf666e..6858adbe 100644 --- a/actix-connect/src/ssl/openssl.rs +++ b/actix-connect/src/ssl/openssl.rs @@ -10,7 +10,7 @@ pub use tokio_openssl::{HandshakeError, SslStream}; use actix_codec::{AsyncRead, AsyncWrite}; use actix_rt::net::TcpStream; use actix_service::{Service, ServiceFactory}; -use futures::future::{err, ok, Either, FutureExt, LocalBoxFuture, Ready}; +use futures_util::future::{err, ok, Either, FutureExt, LocalBoxFuture, Ready}; use trust_dns_resolver::TokioAsyncResolver as AsyncResolver; use crate::{ @@ -243,7 +243,7 @@ impl Future for OpensslConnectServiceResponse { fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { if let Some(ref mut fut) = self.fut1 { - match futures::ready!(Pin::new(fut).poll(cx)) { + match futures_util::ready!(Pin::new(fut).poll(cx)) { Ok(res) => { let _ = self.fut1.take(); self.fut2 = Some(self.openssl.call(res)); @@ -253,7 +253,7 @@ impl Future for OpensslConnectServiceResponse { } if let Some(ref mut fut) = self.fut2 { - match futures::ready!(Pin::new(fut).poll(cx)) { + match futures_util::ready!(Pin::new(fut).poll(cx)) { Ok(connect) => Poll::Ready(Ok(connect.into_parts().0)), Err(e) => Poll::Ready(Err(ConnectError::Io(io::Error::new( io::ErrorKind::Other, diff --git a/actix-connect/src/ssl/rustls.rs b/actix-connect/src/ssl/rustls.rs index 1964b3aa..3e646082 100644 --- a/actix-connect/src/ssl/rustls.rs +++ b/actix-connect/src/ssl/rustls.rs @@ -10,7 +10,7 @@ pub use tokio_rustls::{client::TlsStream, rustls::ClientConfig}; use actix_codec::{AsyncRead, AsyncWrite}; use actix_service::{Service, ServiceFactory}; -use futures::future::{ok, Ready}; +use futures_util::future::{ok, Ready}; use tokio_rustls::{Connect, TlsConnector}; use webpki::DNSNameRef; @@ -126,7 +126,7 @@ where fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.get_mut(); Poll::Ready( - futures::ready!(Pin::new(&mut this.fut).poll(cx)).map(|stream| { + futures_util::ready!(Pin::new(&mut this.fut).poll(cx)).map(|stream| { let s = this.stream.take().unwrap(); trace!("SSL Handshake success: {:?}", s.host()); s.replace(stream).1 diff --git a/actix-connect/tests/test_connect.rs b/actix-connect/tests/test_connect.rs index 1712bf49..549d559f 100644 --- a/actix-connect/tests/test_connect.rs +++ b/actix-connect/tests/test_connect.rs @@ -5,7 +5,7 @@ use actix_rt::net::TcpStream; use actix_service::{fn_service, Service, ServiceFactory}; use actix_testing::TestServer; use bytes::Bytes; -use futures::SinkExt; +use futures_util::sink::SinkExt; use actix_connect::resolver::{ResolverConfig, ResolverOpts}; use actix_connect::Connect; 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}; diff --git a/actix-rt/Cargo.toml b/actix-rt/Cargo.toml index a7918a99..3f7b50b3 100644 --- a/actix-rt/Cargo.toml +++ b/actix-rt/Cargo.toml @@ -18,7 +18,7 @@ path = "src/lib.rs" [dependencies] actix-macros = "0.1.0" actix-threadpool = "0.3" -futures-channel = { version = "0.3.1", default-features = false } -futures-util = { version = "0.3.1", default-features = false } +futures-channel = { version = "0.3.4", default-features = false } +futures-util = { version = "0.3.4", default-features = false, features = ["alloc"] } copyless = "0.1.4" tokio = { version = "0.2.6", default-features = false, features = ["rt-core", "rt-util", "io-driver", "tcp", "uds", "udp", "time", "signal", "stream"] } diff --git a/actix-server/Cargo.toml b/actix-server/Cargo.toml index eef518e6..bf9ee344 100644 --- a/actix-server/Cargo.toml +++ b/actix-server/Cargo.toml @@ -30,7 +30,8 @@ log = "0.4" num_cpus = "1.11" mio = "0.6.19" net2 = "0.2" -futures = "0.3.1" +futures-channel = { version = "0.3.4", default-features = false } +futures-util = { version = "0.3.4", default-features = false, features = ["sink"] } slab = "0.4" # unix domain sockets @@ -40,4 +41,4 @@ mio-uds = { version = "0.6.7" } [dev-dependencies] bytes = "0.5" env_logger = "0.7" -actix-testing = "1.0.0" \ No newline at end of file +actix-testing = "1.0.0" diff --git a/actix-server/src/builder.rs b/actix-server/src/builder.rs index ecc3e4e7..27475cfc 100644 --- a/actix-server/src/builder.rs +++ b/actix-server/src/builder.rs @@ -6,11 +6,11 @@ use std::{io, mem, net}; use actix_rt::net::TcpStream; use actix_rt::time::{delay_until, Instant}; use actix_rt::{spawn, System}; -use futures::channel::mpsc::{unbounded, UnboundedReceiver}; -use futures::channel::oneshot; -use futures::future::ready; -use futures::stream::FuturesUnordered; -use futures::{ready, Future, FutureExt, Stream, StreamExt}; +use futures_channel::mpsc::{unbounded, UnboundedReceiver}; +use futures_channel::oneshot; +use futures_util::future::ready; +use futures_util::stream::FuturesUnordered; +use futures_util::{ready, future::Future, FutureExt, stream::Stream, StreamExt}; use log::{error, info}; use net2::TcpBuilder; diff --git a/actix-server/src/config.rs b/actix-server/src/config.rs index 464635b1..e09a567b 100644 --- a/actix-server/src/config.rs +++ b/actix-server/src/config.rs @@ -4,7 +4,7 @@ use std::{fmt, io, net}; use actix_rt::net::TcpStream; use actix_service as actix; use actix_utils::counter::CounterGuard; -use futures::future::{ok, Future, FutureExt, LocalBoxFuture}; +use futures_util::future::{ok, Future, FutureExt, LocalBoxFuture}; use log::error; use super::builder::bind_addr; diff --git a/actix-server/src/server.rs b/actix-server/src/server.rs index 6ba2547f..b29a9e02 100644 --- a/actix-server/src/server.rs +++ b/actix-server/src/server.rs @@ -3,9 +3,9 @@ use std::io; use std::pin::Pin; use std::task::{Context, Poll}; -use futures::channel::mpsc::UnboundedSender; -use futures::channel::oneshot; -use futures::FutureExt; +use futures_channel::mpsc::UnboundedSender; +use futures_channel::oneshot; +use futures_util::FutureExt; use crate::builder::ServerBuilder; use crate::signals::Signal; diff --git a/actix-server/src/service.rs b/actix-server/src/service.rs index c46126a8..bf429185 100644 --- a/actix-server/src/service.rs +++ b/actix-server/src/service.rs @@ -6,8 +6,8 @@ use std::time::Duration; use actix_rt::spawn; use actix_service::{self as actix, Service, ServiceFactory as ActixServiceFactory}; use actix_utils::counter::CounterGuard; -use futures::future::{err, ok, LocalBoxFuture, Ready}; -use futures::{FutureExt, TryFutureExt}; +use futures_util::future::{err, ok, LocalBoxFuture, Ready}; +use futures_util::{FutureExt, TryFutureExt}; use log::error; use super::Token; diff --git a/actix-server/src/signals.rs b/actix-server/src/signals.rs index db226585..b6339621 100644 --- a/actix-server/src/signals.rs +++ b/actix-server/src/signals.rs @@ -3,7 +3,7 @@ use std::io; use std::pin::Pin; use std::task::{Context, Poll}; -use futures::future::lazy; +use futures_util::future::lazy; use crate::server::Server; diff --git a/actix-server/src/worker.rs b/actix-server/src/worker.rs index f51fd310..820a79bf 100644 --- a/actix-server/src/worker.rs +++ b/actix-server/src/worker.rs @@ -7,10 +7,10 @@ use std::time; use actix_rt::time::{delay_until, Delay, Instant}; use actix_rt::{spawn, Arbiter}; use actix_utils::counter::Counter; -use futures::channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender}; -use futures::channel::oneshot; -use futures::future::{join_all, LocalBoxFuture, MapOk}; -use futures::{Future, FutureExt, Stream, TryFutureExt}; +use futures_channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender}; +use futures_channel::oneshot; +use futures_util::future::{join_all, LocalBoxFuture, MapOk}; +use futures_util::{future::Future, FutureExt, stream::Stream, TryFutureExt}; use log::{error, info, trace}; use crate::accept::AcceptNotify; diff --git a/actix-server/tests/test_server.rs b/actix-server/tests/test_server.rs index c5aa70bc..e150f56b 100644 --- a/actix-server/tests/test_server.rs +++ b/actix-server/tests/test_server.rs @@ -4,7 +4,7 @@ use std::{net, thread, time}; use actix_server::Server; use actix_service::fn_service; -use futures::future::{lazy, ok}; +use futures_util::future::{lazy, ok}; use net2::TcpBuilder; fn unused_addr() -> net::SocketAddr { @@ -71,7 +71,7 @@ fn test_start() { use actix_codec::{BytesCodec, Framed}; use actix_rt::net::TcpStream; use bytes::Bytes; - use futures::SinkExt; + use futures_util::sink::SinkExt; use std::io::Read; let addr = unused_addr(); diff --git a/actix-testing/Cargo.toml b/actix-testing/Cargo.toml index 6c0f96c7..4c1891c9 100644 --- a/actix-testing/Cargo.toml +++ b/actix-testing/Cargo.toml @@ -24,4 +24,3 @@ actix-service = "1.0.0" log = "0.4" net2 = "0.2" -futures = "0.3.1" 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)), diff --git a/actix-tracing/Cargo.toml b/actix-tracing/Cargo.toml index 055cd11c..a8782361 100644 --- a/actix-tracing/Cargo.toml +++ b/actix-tracing/Cargo.toml @@ -17,7 +17,7 @@ path = "src/lib.rs" [dependencies] actix-service = "1.0.4" -futures-util = "0.3.1" +futures-util = { version = "0.3.4", default-features = false } tracing = "0.1" tracing-futures = "0.2" diff --git a/actix-utils/Cargo.toml b/actix-utils/Cargo.toml index 62207b36..4c55da05 100644 --- a/actix-utils/Cargo.toml +++ b/actix-utils/Cargo.toml @@ -22,7 +22,9 @@ actix-codec = "0.2.0" bitflags = "1.2" bytes = "0.5.3" either = "1.5.3" -futures = "0.3.1" +futures-channel = { version = "0.3.4", default-features = false } +futures-sink = { version = "0.3.4", default-features = false } +futures-util = { version = "0.3.4", default-features = false } pin-project = "0.4.6" log = "0.4" slab = "0.4" diff --git a/actix-utils/src/condition.rs b/actix-utils/src/condition.rs index 097034da..fe459cf7 100644 --- a/actix-utils/src/condition.rs +++ b/actix-utils/src/condition.rs @@ -96,7 +96,7 @@ impl Drop for Waiter { #[cfg(test)] mod tests { use super::*; - use futures::future::lazy; + use futures_util::future::lazy; #[actix_rt::test] async fn test_condition() { diff --git a/actix-utils/src/either.rs b/actix-utils/src/either.rs index 0aeecf89..53d6e86e 100644 --- a/actix-utils/src/either.rs +++ b/actix-utils/src/either.rs @@ -3,7 +3,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; use actix_service::{Service, ServiceFactory}; -use futures::{future, ready, Future}; +use futures_util::{future, ready, future::Future}; /// Combine two different service types into a single type. /// diff --git a/actix-utils/src/framed.rs b/actix-utils/src/framed.rs index 9def5992..1663db9d 100644 --- a/actix-utils/src/framed.rs +++ b/actix-utils/src/framed.rs @@ -6,7 +6,7 @@ use std::{fmt, mem}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed}; use actix_service::{IntoService, Service}; -use futures::{Future, FutureExt, Stream}; +use futures_util::{future::Future, FutureExt, stream::Stream}; use log::debug; use crate::mpsc; diff --git a/actix-utils/src/inflight.rs b/actix-utils/src/inflight.rs index 3f547db2..f07e4592 100644 --- a/actix-utils/src/inflight.rs +++ b/actix-utils/src/inflight.rs @@ -4,7 +4,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; use actix_service::{IntoService, Service, Transform}; -use futures::future::{ok, Ready}; +use futures_util::future::{ok, Ready}; use super::counter::{Counter, CounterGuard}; @@ -116,7 +116,7 @@ mod tests { use super::*; use actix_service::{apply, fn_factory, Service, ServiceFactory}; - use futures::future::{lazy, ok, FutureExt, LocalBoxFuture}; + use futures_util::future::{lazy, ok, FutureExt, LocalBoxFuture}; struct SleepService(Duration); diff --git a/actix-utils/src/keepalive.rs b/actix-utils/src/keepalive.rs index 9d4f8712..4413dcd5 100644 --- a/actix-utils/src/keepalive.rs +++ b/actix-utils/src/keepalive.rs @@ -7,7 +7,7 @@ use std::time::Duration; use actix_rt::time::{delay_until, Delay, Instant}; use actix_service::{Service, ServiceFactory}; -use futures::future::{ok, Ready}; +use futures_util::future::{ok, Ready}; use super::time::{LowResTime, LowResTimeService}; diff --git a/actix-utils/src/mpsc.rs b/actix-utils/src/mpsc.rs index 07014835..531c9684 100644 --- a/actix-utils/src/mpsc.rs +++ b/actix-utils/src/mpsc.rs @@ -6,7 +6,8 @@ use std::fmt; use std::pin::Pin; use std::task::{Context, Poll}; -use futures::{Sink, Stream}; +use futures_sink::Sink; +use futures_util::stream::Stream; use crate::cell::Cell; use crate::task::LocalWaker; @@ -180,8 +181,8 @@ impl SendError { #[cfg(test)] mod tests { use super::*; - use futures::future::lazy; - use futures::{Stream, StreamExt}; + use futures_util::future::lazy; + use futures_util::{stream::Stream, StreamExt}; #[actix_rt::test] async fn test_mpsc() { diff --git a/actix-utils/src/oneshot.rs b/actix-utils/src/oneshot.rs index 533167c9..9945e5d3 100644 --- a/actix-utils/src/oneshot.rs +++ b/actix-utils/src/oneshot.rs @@ -3,7 +3,7 @@ use std::future::Future; use std::pin::Pin; use std::task::{Context, Poll}; -pub use futures::channel::oneshot::Canceled; +pub use futures_channel::oneshot::Canceled; use slab::Slab; use crate::cell::Cell; @@ -253,7 +253,7 @@ impl Future for PReceiver { #[cfg(test)] mod tests { use super::*; - use futures::future::lazy; + use futures_util::future::lazy; #[actix_rt::test] async fn test_oneshot() { diff --git a/actix-utils/src/order.rs b/actix-utils/src/order.rs index 7dd4e2fc..ba589f30 100644 --- a/actix-utils/src/order.rs +++ b/actix-utils/src/order.rs @@ -8,7 +8,7 @@ use std::rc::Rc; use std::task::{Context, Poll}; use actix_service::{IntoService, Service, Transform}; -use futures::future::{ok, Ready}; +use futures_util::future::{ok, Ready}; use crate::oneshot; use crate::task::LocalWaker; @@ -210,8 +210,8 @@ mod tests { use super::*; use actix_service::Service; - use futures::channel::oneshot; - use futures::future::{lazy, poll_fn, FutureExt, LocalBoxFuture}; + use futures_channel::oneshot; + use futures_util::future::{lazy, poll_fn, FutureExt, LocalBoxFuture}; struct Srv; diff --git a/actix-utils/src/stream.rs b/actix-utils/src/stream.rs index b7f008e4..90df8c2f 100644 --- a/actix-utils/src/stream.rs +++ b/actix-utils/src/stream.rs @@ -3,7 +3,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; use actix_service::{IntoService, Service}; -use futures::{FutureExt, Stream}; +use futures_util::{FutureExt, stream::Stream}; use crate::mpsc; diff --git a/actix-utils/src/time.rs b/actix-utils/src/time.rs index 49d6283a..c7bfa922 100644 --- a/actix-utils/src/time.rs +++ b/actix-utils/src/time.rs @@ -4,7 +4,7 @@ use std::time::{self, Duration, Instant}; use actix_rt::time::delay_for; use actix_service::{Service, ServiceFactory}; -use futures::future::{ok, ready, FutureExt, Ready}; +use futures_util::future::{ok, ready, FutureExt, Ready}; use super::cell::Cell; diff --git a/actix-utils/src/timeout.rs b/actix-utils/src/timeout.rs index cb8c24b4..83fbb84f 100644 --- a/actix-utils/src/timeout.rs +++ b/actix-utils/src/timeout.rs @@ -10,7 +10,7 @@ use std::{fmt, time}; use actix_rt::time::{delay_for, Delay}; use actix_service::{IntoService, Service, Transform}; -use futures::future::{ok, Ready}; +use futures_util::future::{ok, Ready}; /// Applies a timeout to requests. #[derive(Debug)] @@ -183,7 +183,7 @@ mod tests { use super::*; use actix_service::{apply, fn_factory, Service, ServiceFactory}; - use futures::future::{ok, FutureExt, LocalBoxFuture}; + use futures_util::future::{ok, FutureExt, LocalBoxFuture}; struct SleepService(Duration); diff --git a/examples/basic.rs b/examples/basic.rs index 5ff109d2..3de6d212 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -11,7 +11,7 @@ use actix_codec::{AsyncRead, AsyncWrite}; use actix_rt::System; use actix_server::{Io, Server}; use actix_service::{service_fn, NewService}; -use futures::{future, Future}; +use futures_util::{future, Future}; use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod}; use tokio_openssl::SslAcceptorExt; diff --git a/examples/ssl.rs b/examples/ssl.rs index b7b70f1d..d15ed77a 100644 --- a/examples/ssl.rs +++ b/examples/ssl.rs @@ -7,7 +7,7 @@ use std::sync::{ use actix_rt::System; use actix_server::{ssl, Server}; use actix_service::NewService; -use futures::future; +use futures_util::future; use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod}; #[derive(Debug)]