diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 91aa9453..4318fa2a 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -12,12 +12,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **change:** Update tokio-tungstenite to 0.21 ([#2435]) - **added:** Enable `tracing` feature by default ([#2460]) - **added:** Support graceful shutdown on `serve` ([#2398]) +- **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 [#2460]: https://github.com/tokio-rs/axum/pull/2460 [#2398]: https://github.com/tokio-rs/axum/pull/2398 +[#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 39848057..13b57255 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,