From 58b09a467556c9f508736e8a4ccdf350a858a113 Mon Sep 17 00:00:00 2001 From: Bryan Burgers Date: Thu, 28 Dec 2023 13:18:35 -0600 Subject: [PATCH] Implement `Clone` for `RouterIntoService` --- axum/src/routing/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/axum/src/routing/mod.rs b/axum/src/routing/mod.rs index 39848057006..13b57255495 100644 --- a/axum/src/routing/mod.rs +++ b/axum/src/routing/mod.rs @@ -515,6 +515,18 @@ pub struct RouterIntoService { _marker: PhantomData, } +impl Clone for RouterIntoService +where + Router: Clone, +{ + fn clone(&self) -> Self { + Self { + router: self.router.clone(), + _marker: PhantomData, + } + } +} + impl Service> for RouterIntoService where B: HttpBody + Send + 'static,