From eb33f0ecbe0f09a1ab31e97eba8b88cf4d9dc1f0 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 3 Dec 2019 16:15:06 +0600 Subject: [PATCH] add Clone for apply combinator --- actix-service/CHANGES.md | 2 +- actix-service/src/apply.rs | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/actix-service/CHANGES.md b/actix-service/CHANGES.md index 3d527824..ca18613d 100644 --- a/actix-service/CHANGES.md +++ b/actix-service/CHANGES.md @@ -2,7 +2,7 @@ ## [1.0.0-alpha.3] - 2019-12-xx -### Add missing Clone impl for factory_fn_cfg +### Add missing Clone impls ## [1.0.0-alpha.2] - 2019-12-02 diff --git a/actix-service/src/apply.rs b/actix-service/src/apply.rs index 5b9a0a02..5fb984d4 100644 --- a/actix-service/src/apply.rs +++ b/actix-service/src/apply.rs @@ -102,6 +102,21 @@ where } } +impl Clone for ApplyServiceFactory +where + T: ServiceFactory + Clone, + F: FnMut(In, &mut T::Service) -> R + Clone, + R: Future>, +{ + fn clone(&self) -> Self { + Self { + service: self.service.clone(), + f: self.f.clone(), + r: PhantomData, + } + } +} + impl ServiceFactory for ApplyServiceFactory where T: ServiceFactory,