1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-08-31 18:36:59 +02:00

remove futures-util from service deps (#235)

This commit is contained in:
Rob Ede
2020-12-27 18:24:57 +00:00
committed by GitHub
parent 8a58a341a4
commit ba44ea7d0b
12 changed files with 159 additions and 86 deletions

View File

@@ -6,8 +6,6 @@ use core::{
task::{Context, Poll},
};
use futures_util::future::FutureExt;
use crate::{Service, ServiceFactory};
pub type BoxFuture<T> = Pin<Box<dyn Future<Output = T>>>;
@@ -103,11 +101,11 @@ where
type Future = BoxFuture<Result<Self::Service, Self::InitError>>;
fn new_service(&self, cfg: Cfg) -> Self::Future {
Box::pin(
self.factory
.new_service(cfg)
.map(|res| res.map(ServiceWrapper::boxed)),
)
let fut = self.factory.new_service(cfg);
Box::pin(async {
let res = fut.await;
res.map(ServiceWrapper::boxed)
})
}
}