Implement Clone for IntoMakeServiceWithConnectInfo (#471)

Fixes https://github.com/tokio-rs/axum/issues/470
This commit is contained in:
David Pedersen 2021-11-06 14:06:20 +01:00 committed by GitHub
parent b4b022da5f
commit b3b377d467
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -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)

View file

@ -56,6 +56,18 @@ where
}
}
impl<S, C> Clone for IntoMakeServiceWithConnectInfo<S, C>
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.
///