diff --git a/actix-service/src/apply.rs b/actix-service/src/apply.rs index 1eb1cc8e..e6624057 100644 --- a/actix-service/src/apply.rs +++ b/actix-service/src/apply.rs @@ -17,7 +17,7 @@ where impl Apply where T: Service, - F: Fn(In, &mut T) -> Out, + F: FnMut(In, &mut T) -> Out, Out: IntoFuture, Out::Error: From, { @@ -48,7 +48,7 @@ where impl Service for Apply where T: Service, - F: Fn(In, &mut T) -> Out, + F: FnMut(In, &mut T) -> Out, Out: IntoFuture, Out::Error: From, { diff --git a/actix-service/src/lib.rs b/actix-service/src/lib.rs index a96dbd5b..1e033273 100644 --- a/actix-service/src/lib.rs +++ b/actix-service/src/lib.rs @@ -66,7 +66,7 @@ pub trait ServiceExt: Service { Self: Sized, T: Service, I: IntoService, - F: Fn(Self::Response, &mut T) -> Out, + F: FnMut(Self::Response, &mut T) -> Out, Out: IntoFuture, { self.and_then(Apply::new(service.into_service(), f)) @@ -191,7 +191,7 @@ pub trait NewService { Self: Sized, T: NewService, I: IntoNewService, - F: Fn(Self::Response, &mut T::Service) -> Out + Clone, + F: FnMut(Self::Response, &mut T::Service) -> Out + Clone, Out: IntoFuture, { self.and_then(ApplyNewService::new(service, f))