From 6a9df026e76010ee3593adf24cd6507047aaae35 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 3 Dec 2019 14:05:23 +0600 Subject: [PATCH] Add missing Clone impl for factory_fn_cfg --- actix-service/CHANGES.md | 4 ++++ actix-service/src/fn_service.rs | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/actix-service/CHANGES.md b/actix-service/CHANGES.md index c33abe36..3d527824 100644 --- a/actix-service/CHANGES.md +++ b/actix-service/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [1.0.0-alpha.3] - 2019-12-xx + +### Add missing Clone impl for factory_fn_cfg + ## [1.0.0-alpha.2] - 2019-12-02 ### Use owned config value for service factory diff --git a/actix-service/src/fn_service.rs b/actix-service/src/fn_service.rs index 33b9c720..32781f73 100644 --- a/actix-service/src/fn_service.rs +++ b/actix-service/src/fn_service.rs @@ -184,6 +184,20 @@ where } } +impl Clone for FnServiceConfig +where + F: Fn(Cfg) -> Fut + Clone, + Fut: Future>, + Srv: Service, +{ + fn clone(&self) -> Self { + FnServiceConfig { + f: self.f.clone(), + _t: PhantomData, + } + } +} + impl ServiceFactory for FnServiceConfig where F: Fn(Cfg) -> Fut,