1
0
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:
Nikolay Kim
2019-12-05 12:37:26 +06:00
parent c6eb318536
commit 6f41b80cb4
24 changed files with 366 additions and 399 deletions

View File

@@ -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};