mirror of
https://github.com/fafhrd91/actix-net
synced 2025-08-20 15:45:38 +02:00
optimize service combinators memory layout
This commit is contained in:
@@ -63,16 +63,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pin_project! {
|
||||
pub struct MapErrFuture<A, F, E>
|
||||
where
|
||||
A: Service,
|
||||
F: Fn(A::Error) -> E,
|
||||
{
|
||||
f: F,
|
||||
#[pin]
|
||||
fut: A::Future,
|
||||
}
|
||||
#[pin_project::pin_project]
|
||||
pub struct MapErrFuture<A, F, E>
|
||||
where
|
||||
A: Service,
|
||||
F: Fn(A::Error) -> E,
|
||||
{
|
||||
f: F,
|
||||
#[pin]
|
||||
fut: A::Future,
|
||||
}
|
||||
|
||||
impl<A, F, E> MapErrFuture<A, F, E>
|
||||
@@ -160,16 +159,15 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pin_project! {
|
||||
pub struct MapErrServiceFuture<A, F, E>
|
||||
where
|
||||
A: ServiceFactory,
|
||||
F: Fn(A::Error) -> E,
|
||||
{
|
||||
#[pin]
|
||||
fut: A::Future,
|
||||
f: F,
|
||||
}
|
||||
#[pin_project::pin_project]
|
||||
pub struct MapErrServiceFuture<A, F, E>
|
||||
where
|
||||
A: ServiceFactory,
|
||||
F: Fn(A::Error) -> E,
|
||||
{
|
||||
#[pin]
|
||||
fut: A::Future,
|
||||
f: F,
|
||||
}
|
||||
|
||||
impl<A, F, E> MapErrServiceFuture<A, F, E>
|
||||
@@ -201,7 +199,7 @@ where
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use futures::future::{err, lazy, ok, Ready};
|
||||
use futures_util::future::{err, lazy, ok, Ready};
|
||||
|
||||
use super::*;
|
||||
use crate::{IntoServiceFactory, Service, ServiceFactory};
|
||||
|
Reference in New Issue
Block a user