diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 1eb54995431..463090112b4 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -10,10 +10,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **added:** `Body` implements `From<()>` now ([#2411]) - **change:** Update version of multer used internally for multipart ([#2433]) - **change:** Update tokio-tungstenite to 0.21 ([#2435]) +- **added:** `RouterIntoService` implements `Clone` ([#2456]) [#2411]: https://github.com/tokio-rs/axum/pull/2411 [#2433]: https://github.com/tokio-rs/axum/pull/2433 [#2435]: https://github.com/tokio-rs/axum/pull/2435 +[#2456]: https://github.com/tokio-rs/axum/pull/2456 # 0.7.2 (03. December, 2023) 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,