1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-31 08:12:07 +01:00

Merge pull request #119 from JohnTitor/futures

Minimize `futures-*` dependencies
This commit is contained in:
Yuki Okushi 2020-03-13 05:12:37 +09:00 committed by GitHub
commit 7105091e51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 74 additions and 69 deletions

View File

@ -19,8 +19,8 @@ path = "src/lib.rs"
[dependencies] [dependencies]
bitflags = "1.2.1" bitflags = "1.2.1"
bytes = "0.5.2" bytes = "0.5.2"
futures-core = "0.3.1" futures-core = { version = "0.3.4", default-features = false }
futures-sink = "0.3.1" futures-sink = { version = "0.3.4", default-features = false }
tokio = { version = "0.2.4", default-features=false } tokio = { version = "0.2.4", default-features=false }
tokio-util = { version = "0.2.0", default-features=false, features=["codec"] } tokio-util = { version = "0.2.0", default-features=false, features=["codec"] }
log = "0.4" log = "0.4"

View File

@ -37,7 +37,7 @@ actix-utils = "1.0.6"
actix-rt = "1.0.0" actix-rt = "1.0.0"
derive_more = "0.99.2" derive_more = "0.99.2"
either = "1.5.3" either = "1.5.3"
futures = "0.3.1" futures-util = { version = "0.3.4", default-features = false }
http = { version = "0.2.0", optional = true } http = { version = "0.2.0", optional = true }
log = "0.4" log = "0.4"
trust-dns-proto = { version = "0.19", default-features = false, features = ["tokio-runtime"] } trust-dns-proto = { version = "0.19", default-features = false, features = ["tokio-runtime"] }

View File

@ -8,7 +8,7 @@ use std::task::{Context, Poll};
use actix_rt::net::TcpStream; use actix_rt::net::TcpStream;
use actix_service::{Service, ServiceFactory}; 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::connect::{Address, Connect, Connection};
use super::error::ConnectError; use super::error::ConnectError;

View File

@ -5,7 +5,7 @@ use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use actix_service::{Service, ServiceFactory}; 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::TokioAsyncResolver as AsyncResolver;
use trust_dns_resolver::{error::ResolveError, lookup_ip::LookupIp}; use trust_dns_resolver::{error::ResolveError, lookup_ip::LookupIp};

View File

@ -5,7 +5,7 @@ use std::task::{Context, Poll};
use actix_rt::net::TcpStream; use actix_rt::net::TcpStream;
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use either::Either; use either::Either;
use futures::future::{ok, Ready}; use futures_util::future::{ok, Ready};
use trust_dns_resolver::TokioAsyncResolver as AsyncResolver; use trust_dns_resolver::TokioAsyncResolver as AsyncResolver;
use crate::connect::{Address, Connect, Connection}; use crate::connect::{Address, Connect, Connection};

View File

@ -10,7 +10,7 @@ pub use tokio_openssl::{HandshakeError, SslStream};
use actix_codec::{AsyncRead, AsyncWrite}; use actix_codec::{AsyncRead, AsyncWrite};
use actix_rt::net::TcpStream; use actix_rt::net::TcpStream;
use actix_service::{Service, ServiceFactory}; 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 trust_dns_resolver::TokioAsyncResolver as AsyncResolver;
use crate::{ use crate::{
@ -243,7 +243,7 @@ impl<T: Address> Future for OpensslConnectServiceResponse<T> {
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
if let Some(ref mut fut) = self.fut1 { 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) => { Ok(res) => {
let _ = self.fut1.take(); let _ = self.fut1.take();
self.fut2 = Some(self.openssl.call(res)); self.fut2 = Some(self.openssl.call(res));
@ -253,7 +253,7 @@ impl<T: Address> Future for OpensslConnectServiceResponse<T> {
} }
if let Some(ref mut fut) = self.fut2 { 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)), Ok(connect) => Poll::Ready(Ok(connect.into_parts().0)),
Err(e) => Poll::Ready(Err(ConnectError::Io(io::Error::new( Err(e) => Poll::Ready(Err(ConnectError::Io(io::Error::new(
io::ErrorKind::Other, io::ErrorKind::Other,

View File

@ -10,7 +10,7 @@ pub use tokio_rustls::{client::TlsStream, rustls::ClientConfig};
use actix_codec::{AsyncRead, AsyncWrite}; use actix_codec::{AsyncRead, AsyncWrite};
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use futures::future::{ok, Ready}; use futures_util::future::{ok, Ready};
use tokio_rustls::{Connect, TlsConnector}; use tokio_rustls::{Connect, TlsConnector};
use webpki::DNSNameRef; use webpki::DNSNameRef;
@ -126,7 +126,7 @@ where
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.get_mut(); let this = self.get_mut();
Poll::Ready( 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(); let s = this.stream.take().unwrap();
trace!("SSL Handshake success: {:?}", s.host()); trace!("SSL Handshake success: {:?}", s.host());
s.replace(stream).1 s.replace(stream).1

View File

@ -5,7 +5,7 @@ use actix_rt::net::TcpStream;
use actix_service::{fn_service, Service, ServiceFactory}; use actix_service::{fn_service, Service, ServiceFactory};
use actix_testing::TestServer; use actix_testing::TestServer;
use bytes::Bytes; use bytes::Bytes;
use futures::SinkExt; use futures_util::sink::SinkExt;
use actix_connect::resolver::{ResolverConfig, ResolverOpts}; use actix_connect::resolver::{ResolverConfig, ResolverOpts};
use actix_connect::Connect; use actix_connect::Connect;

View File

@ -22,10 +22,12 @@ actix-utils = "1.0.4"
actix-rt = "1.0.0" actix-rt = "1.0.0"
bytes = "0.5.3" bytes = "0.5.3"
either = "1.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" pin-project = "0.4.6"
log = "0.4" log = "0.4"
[dev-dependencies] [dev-dependencies]
actix-connect = "2.0.0-alpha.2" actix-connect = "2.0.0-alpha.2"
actix-testing = "1.0.0" actix-testing = "1.0.0"
futures-util = { version = "0.3.4", default-features = false }

View File

@ -4,7 +4,7 @@ use std::task::{Context, Poll};
use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed};
use actix_utils::mpsc::Receiver; use actix_utils::mpsc::Receiver;
use futures::Stream; use futures_core::stream::Stream;
pub struct Connect<Io, Codec> pub struct Connect<Io, Codec>
where where
@ -90,7 +90,7 @@ where
} }
} }
impl<Io, St, Codec, Out> futures::Sink<<Codec as Encoder>::Item> impl<Io, St, Codec, Out> futures_sink::Sink<<Codec as Encoder>::Item>
for ConnectResult<Io, St, Codec, Out> for ConnectResult<Io, St, Codec, Out>
where where
Io: AsyncRead + AsyncWrite, Io: AsyncRead + AsyncWrite,

View File

@ -5,7 +5,7 @@ use std::task::{Context, Poll};
use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed};
use actix_service::Service; use actix_service::Service;
use actix_utils::mpsc; use actix_utils::mpsc;
use futures::Stream; use futures_core::stream::Stream;
use pin_project::pin_project; use pin_project::pin_project;
use log::debug; use log::debug;

View File

@ -7,7 +7,7 @@ use std::task::{Context, Poll};
use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed};
use actix_service::{IntoService, IntoServiceFactory, Service, ServiceFactory}; use actix_service::{IntoService, IntoServiceFactory, Service, ServiceFactory};
use either::Either; use either::Either;
use futures::{ready, Stream}; use futures_core::{ready, stream::Stream};
use pin_project::project; use pin_project::project;
use crate::connect::{Connect, ConnectResult}; use crate::connect::{Connect, ConnectResult};

View File

@ -6,7 +6,7 @@ use actix_service::{fn_factory_with_config, fn_service, IntoService, Service};
use actix_testing::TestServer; use actix_testing::TestServer;
use actix_utils::mpsc; use actix_utils::mpsc;
use bytes::{Bytes, BytesMut}; use bytes::{Bytes, BytesMut};
use futures::future::ok; use futures_util::future::ok;
use actix_ioframe::{Builder, Connect, FactoryBuilder}; use actix_ioframe::{Builder, Connect, FactoryBuilder};

View File

@ -18,7 +18,7 @@ path = "src/lib.rs"
[dependencies] [dependencies]
actix-macros = "0.1.0" actix-macros = "0.1.0"
actix-threadpool = "0.3" actix-threadpool = "0.3"
futures-channel = { version = "0.3.1", default-features = false } futures-channel = { version = "0.3.4", default-features = false }
futures-util = { version = "0.3.1", default-features = false } futures-util = { version = "0.3.4", default-features = false, features = ["alloc"] }
copyless = "0.1.4" 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"] } tokio = { version = "0.2.6", default-features = false, features = ["rt-core", "rt-util", "io-driver", "tcp", "uds", "udp", "time", "signal", "stream"] }

View File

@ -30,7 +30,8 @@ log = "0.4"
num_cpus = "1.11" num_cpus = "1.11"
mio = "0.6.19" mio = "0.6.19"
net2 = "0.2" 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" slab = "0.4"
# unix domain sockets # unix domain sockets
@ -40,4 +41,4 @@ mio-uds = { version = "0.6.7" }
[dev-dependencies] [dev-dependencies]
bytes = "0.5" bytes = "0.5"
env_logger = "0.7" env_logger = "0.7"
actix-testing = "1.0.0" actix-testing = "1.0.0"

View File

@ -6,11 +6,11 @@ use std::{io, mem, net};
use actix_rt::net::TcpStream; use actix_rt::net::TcpStream;
use actix_rt::time::{delay_until, Instant}; use actix_rt::time::{delay_until, Instant};
use actix_rt::{spawn, System}; use actix_rt::{spawn, System};
use futures::channel::mpsc::{unbounded, UnboundedReceiver}; use futures_channel::mpsc::{unbounded, UnboundedReceiver};
use futures::channel::oneshot; use futures_channel::oneshot;
use futures::future::ready; use futures_util::future::ready;
use futures::stream::FuturesUnordered; use futures_util::stream::FuturesUnordered;
use futures::{ready, Future, FutureExt, Stream, StreamExt}; use futures_util::{ready, future::Future, FutureExt, stream::Stream, StreamExt};
use log::{error, info}; use log::{error, info};
use net2::TcpBuilder; use net2::TcpBuilder;

View File

@ -4,7 +4,7 @@ use std::{fmt, io, net};
use actix_rt::net::TcpStream; use actix_rt::net::TcpStream;
use actix_service as actix; use actix_service as actix;
use actix_utils::counter::CounterGuard; use actix_utils::counter::CounterGuard;
use futures::future::{ok, Future, FutureExt, LocalBoxFuture}; use futures_util::future::{ok, Future, FutureExt, LocalBoxFuture};
use log::error; use log::error;
use super::builder::bind_addr; use super::builder::bind_addr;

View File

@ -3,9 +3,9 @@ use std::io;
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use futures::channel::mpsc::UnboundedSender; use futures_channel::mpsc::UnboundedSender;
use futures::channel::oneshot; use futures_channel::oneshot;
use futures::FutureExt; use futures_util::FutureExt;
use crate::builder::ServerBuilder; use crate::builder::ServerBuilder;
use crate::signals::Signal; use crate::signals::Signal;

View File

@ -6,8 +6,8 @@ use std::time::Duration;
use actix_rt::spawn; use actix_rt::spawn;
use actix_service::{self as actix, Service, ServiceFactory as ActixServiceFactory}; use actix_service::{self as actix, Service, ServiceFactory as ActixServiceFactory};
use actix_utils::counter::CounterGuard; use actix_utils::counter::CounterGuard;
use futures::future::{err, ok, LocalBoxFuture, Ready}; use futures_util::future::{err, ok, LocalBoxFuture, Ready};
use futures::{FutureExt, TryFutureExt}; use futures_util::{FutureExt, TryFutureExt};
use log::error; use log::error;
use super::Token; use super::Token;

View File

@ -3,7 +3,7 @@ use std::io;
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use futures::future::lazy; use futures_util::future::lazy;
use crate::server::Server; use crate::server::Server;

View File

@ -7,10 +7,10 @@ use std::time;
use actix_rt::time::{delay_until, Delay, Instant}; use actix_rt::time::{delay_until, Delay, Instant};
use actix_rt::{spawn, Arbiter}; use actix_rt::{spawn, Arbiter};
use actix_utils::counter::Counter; use actix_utils::counter::Counter;
use futures::channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender}; use futures_channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender};
use futures::channel::oneshot; use futures_channel::oneshot;
use futures::future::{join_all, LocalBoxFuture, MapOk}; use futures_util::future::{join_all, LocalBoxFuture, MapOk};
use futures::{Future, FutureExt, Stream, TryFutureExt}; use futures_util::{future::Future, FutureExt, stream::Stream, TryFutureExt};
use log::{error, info, trace}; use log::{error, info, trace};
use crate::accept::AcceptNotify; use crate::accept::AcceptNotify;

View File

@ -4,7 +4,7 @@ use std::{net, thread, time};
use actix_server::Server; use actix_server::Server;
use actix_service::fn_service; use actix_service::fn_service;
use futures::future::{lazy, ok}; use futures_util::future::{lazy, ok};
use net2::TcpBuilder; use net2::TcpBuilder;
fn unused_addr() -> net::SocketAddr { fn unused_addr() -> net::SocketAddr {
@ -71,7 +71,7 @@ fn test_start() {
use actix_codec::{BytesCodec, Framed}; use actix_codec::{BytesCodec, Framed};
use actix_rt::net::TcpStream; use actix_rt::net::TcpStream;
use bytes::Bytes; use bytes::Bytes;
use futures::SinkExt; use futures_util::sink::SinkExt;
use std::io::Read; use std::io::Read;
let addr = unused_addr(); let addr = unused_addr();

View File

@ -24,4 +24,3 @@ actix-service = "1.0.0"
log = "0.4" log = "0.4"
net2 = "0.2" net2 = "0.2"
futures = "0.3.1"

View File

@ -38,7 +38,7 @@ actix-utils = "1.0.0"
actix-rt = "1.0.0" actix-rt = "1.0.0"
derive_more = "0.99.2" derive_more = "0.99.2"
either = "1.5.2" either = "1.5.2"
futures = "0.3.1" futures-util = { version = "0.3.4", default-features = false }
log = "0.4" log = "0.4"
# openssl # openssl

View File

@ -4,7 +4,7 @@ use std::task::{Context, Poll};
use actix_codec::{AsyncRead, AsyncWrite}; use actix_codec::{AsyncRead, AsyncWrite};
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use actix_utils::counter::Counter; 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 native_tls::Error;
pub use tokio_tls::{TlsAcceptor, TlsStream}; pub use tokio_tls::{TlsAcceptor, TlsStream};

View File

@ -9,7 +9,7 @@ pub use tokio_openssl::{HandshakeError, SslStream};
use actix_codec::{AsyncRead, AsyncWrite}; use actix_codec::{AsyncRead, AsyncWrite};
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use actix_utils::counter::{Counter, CounterGuard}; 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; use crate::MAX_CONN_COUNTER;
@ -105,7 +105,7 @@ impl<T: AsyncRead + AsyncWrite + Unpin> Future for AcceptorServiceResponse<T> {
type Output = Result<SslStream<T>, HandshakeError<T>>; type Output = Result<SslStream<T>, HandshakeError<T>>;
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
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)) Poll::Ready(Ok(io))
} }
} }

View File

@ -8,7 +8,7 @@ use std::task::{Context, Poll};
use actix_codec::{AsyncRead, AsyncWrite}; use actix_codec::{AsyncRead, AsyncWrite};
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use actix_utils::counter::{Counter, CounterGuard}; use actix_utils::counter::{Counter, CounterGuard};
use futures::future::{ok, Ready}; use futures_util::future::{ok, Ready};
use tokio_rustls::{Accept, TlsAcceptor}; use tokio_rustls::{Accept, TlsAcceptor};
pub use rust_tls::{ServerConfig, Session}; pub use rust_tls::{ServerConfig, Session};
@ -108,7 +108,7 @@ impl<T: AsyncRead + AsyncWrite + Unpin> Future for AcceptorServiceFut<T> {
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
let this = self.get_mut(); 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 { match res {
Ok(io) => Poll::Ready(Ok(io)), Ok(io) => Poll::Ready(Ok(io)),
Err(e) => Poll::Ready(Err(e)), Err(e) => Poll::Ready(Err(e)),

View File

@ -17,7 +17,7 @@ path = "src/lib.rs"
[dependencies] [dependencies]
actix-service = "1.0.4" actix-service = "1.0.4"
futures-util = "0.3.1" futures-util = { version = "0.3.4", default-features = false }
tracing = "0.1" tracing = "0.1"
tracing-futures = "0.2" tracing-futures = "0.2"

View File

@ -22,7 +22,9 @@ actix-codec = "0.2.0"
bitflags = "1.2" bitflags = "1.2"
bytes = "0.5.3" bytes = "0.5.3"
either = "1.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" pin-project = "0.4.6"
log = "0.4" log = "0.4"
slab = "0.4" slab = "0.4"

View File

@ -96,7 +96,7 @@ impl Drop for Waiter {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use futures::future::lazy; use futures_util::future::lazy;
#[actix_rt::test] #[actix_rt::test]
async fn test_condition() { async fn test_condition() {

View File

@ -3,7 +3,7 @@ use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use actix_service::{Service, ServiceFactory}; 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. /// Combine two different service types into a single type.
/// ///

View File

@ -6,7 +6,7 @@ use std::{fmt, mem};
use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed}; use actix_codec::{AsyncRead, AsyncWrite, Decoder, Encoder, Framed};
use actix_service::{IntoService, Service}; use actix_service::{IntoService, Service};
use futures::{Future, FutureExt, Stream}; use futures_util::{future::Future, FutureExt, stream::Stream};
use log::debug; use log::debug;
use crate::mpsc; use crate::mpsc;

View File

@ -4,7 +4,7 @@ use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use actix_service::{IntoService, Service, Transform}; use actix_service::{IntoService, Service, Transform};
use futures::future::{ok, Ready}; use futures_util::future::{ok, Ready};
use super::counter::{Counter, CounterGuard}; use super::counter::{Counter, CounterGuard};
@ -116,7 +116,7 @@ mod tests {
use super::*; use super::*;
use actix_service::{apply, fn_factory, Service, ServiceFactory}; 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); struct SleepService(Duration);

View File

@ -7,7 +7,7 @@ use std::time::Duration;
use actix_rt::time::{delay_until, Delay, Instant}; use actix_rt::time::{delay_until, Delay, Instant};
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use futures::future::{ok, Ready}; use futures_util::future::{ok, Ready};
use super::time::{LowResTime, LowResTimeService}; use super::time::{LowResTime, LowResTimeService};

View File

@ -6,7 +6,8 @@ use std::fmt;
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use futures::{Sink, Stream}; use futures_sink::Sink;
use futures_util::stream::Stream;
use crate::cell::Cell; use crate::cell::Cell;
use crate::task::LocalWaker; use crate::task::LocalWaker;
@ -180,8 +181,8 @@ impl<T> SendError<T> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use futures::future::lazy; use futures_util::future::lazy;
use futures::{Stream, StreamExt}; use futures_util::{stream::Stream, StreamExt};
#[actix_rt::test] #[actix_rt::test]
async fn test_mpsc() { async fn test_mpsc() {

View File

@ -3,7 +3,7 @@ use std::future::Future;
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
pub use futures::channel::oneshot::Canceled; pub use futures_channel::oneshot::Canceled;
use slab::Slab; use slab::Slab;
use crate::cell::Cell; use crate::cell::Cell;
@ -253,7 +253,7 @@ impl<T> Future for PReceiver<T> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use futures::future::lazy; use futures_util::future::lazy;
#[actix_rt::test] #[actix_rt::test]
async fn test_oneshot() { async fn test_oneshot() {

View File

@ -8,7 +8,7 @@ use std::rc::Rc;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use actix_service::{IntoService, Service, Transform}; use actix_service::{IntoService, Service, Transform};
use futures::future::{ok, Ready}; use futures_util::future::{ok, Ready};
use crate::oneshot; use crate::oneshot;
use crate::task::LocalWaker; use crate::task::LocalWaker;
@ -210,8 +210,8 @@ mod tests {
use super::*; use super::*;
use actix_service::Service; use actix_service::Service;
use futures::channel::oneshot; use futures_channel::oneshot;
use futures::future::{lazy, poll_fn, FutureExt, LocalBoxFuture}; use futures_util::future::{lazy, poll_fn, FutureExt, LocalBoxFuture};
struct Srv; struct Srv;

View File

@ -3,7 +3,7 @@ use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use actix_service::{IntoService, Service}; use actix_service::{IntoService, Service};
use futures::{FutureExt, Stream}; use futures_util::{FutureExt, stream::Stream};
use crate::mpsc; use crate::mpsc;

View File

@ -4,7 +4,7 @@ use std::time::{self, Duration, Instant};
use actix_rt::time::delay_for; use actix_rt::time::delay_for;
use actix_service::{Service, ServiceFactory}; use actix_service::{Service, ServiceFactory};
use futures::future::{ok, ready, FutureExt, Ready}; use futures_util::future::{ok, ready, FutureExt, Ready};
use super::cell::Cell; use super::cell::Cell;

View File

@ -10,7 +10,7 @@ use std::{fmt, time};
use actix_rt::time::{delay_for, Delay}; use actix_rt::time::{delay_for, Delay};
use actix_service::{IntoService, Service, Transform}; use actix_service::{IntoService, Service, Transform};
use futures::future::{ok, Ready}; use futures_util::future::{ok, Ready};
/// Applies a timeout to requests. /// Applies a timeout to requests.
#[derive(Debug)] #[derive(Debug)]
@ -183,7 +183,7 @@ mod tests {
use super::*; use super::*;
use actix_service::{apply, fn_factory, Service, ServiceFactory}; use actix_service::{apply, fn_factory, Service, ServiceFactory};
use futures::future::{ok, FutureExt, LocalBoxFuture}; use futures_util::future::{ok, FutureExt, LocalBoxFuture};
struct SleepService(Duration); struct SleepService(Duration);

View File

@ -11,7 +11,7 @@ use actix_codec::{AsyncRead, AsyncWrite};
use actix_rt::System; use actix_rt::System;
use actix_server::{Io, Server}; use actix_server::{Io, Server};
use actix_service::{service_fn, NewService}; use actix_service::{service_fn, NewService};
use futures::{future, Future}; use futures_util::{future, Future};
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod}; use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
use tokio_openssl::SslAcceptorExt; use tokio_openssl::SslAcceptorExt;

View File

@ -7,7 +7,7 @@ use std::sync::{
use actix_rt::System; use actix_rt::System;
use actix_server::{ssl, Server}; use actix_server::{ssl, Server};
use actix_service::NewService; use actix_service::NewService;
use futures::future; use futures_util::future;
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod}; use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
#[derive(Debug)] #[derive(Debug)]