From 35218a4df1f34c4b8dadc140471e2add4171d347 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 9 Dec 2019 14:07:20 +0600 Subject: [PATCH] add Clone impl for Apply service --- actix-service/CHANGES.md | 5 +++++ actix-service/src/apply.rs | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/actix-service/CHANGES.md b/actix-service/CHANGES.md index 4eaa6d50..b10bbf98 100644 --- a/actix-service/CHANGES.md +++ b/actix-service/CHANGES.md @@ -1,5 +1,10 @@ # Changes +### Added + +* Add Clone impl for Apply service + + ## [1.0.0-alpha.4] - 2019-12-08 ### Changed diff --git a/actix-service/src/apply.rs b/actix-service/src/apply.rs index 2438057c..c048fd15 100644 --- a/actix-service/src/apply.rs +++ b/actix-service/src/apply.rs @@ -56,6 +56,21 @@ where } } +impl Clone for Apply +where + T: Service + Clone, + F: FnMut(In, &mut T) -> R + Clone, + R: Future>, +{ + fn clone(&self) -> Self { + Apply { + service: self.service.clone(), + f: self.f.clone(), + r: PhantomData, + } + } +} + impl Service for Apply where T: Service,