mirror of
https://github.com/fafhrd91/actix-net
synced 2024-11-24 01:11:07 +01:00
actix-utils: Minimize futures-*
dependencies
This commit is contained in:
parent
4e806b3e3f
commit
e6b6f08369
@ -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"
|
||||||
|
@ -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() {
|
||||||
|
@ -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.
|
||||||
///
|
///
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
@ -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};
|
||||||
|
|
||||||
|
@ -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() {
|
||||||
|
@ -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() {
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user