diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 11e01202..f1c0f092 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased -- None +- **fixed:** Implement `Clone` for `IntoMakeServiceWithConnectInfo` ([#471]) + +[#471]: https://github.com/tokio-rs/axum/pull/471 # 0.3.0 (02. November, 2021) diff --git a/axum/src/extract/connect_info.rs b/axum/src/extract/connect_info.rs index 9fcd18e0..11a8fb75 100644 --- a/axum/src/extract/connect_info.rs +++ b/axum/src/extract/connect_info.rs @@ -56,6 +56,18 @@ where } } +impl Clone for IntoMakeServiceWithConnectInfo +where + S: Clone, +{ + fn clone(&self) -> Self { + Self { + svc: self.svc.clone(), + _connect_info: PhantomData, + } + } +} + /// Trait that connected IO resources implement and use to produce information /// about the connection. ///