Remove Copy some impls (#132)

https://github.com/tokio-rs/axum/pull/129 was a breaking change, in part
because I had to remove the `Copy` impl from `OnMethod`.

For the sake of future proofing I think we should remove other `Copy`
impls from services as well. We can always bring them back once things
have matured more.

These types no longer implement `Copy`:

- `EmptyRouter`
- `ExtractorMiddleware`
- `ExtractorMiddlewareLayer`
This commit is contained in:
David Pedersen 2021-08-07 16:13:56 +02:00 committed by GitHub
parent d7d97a613e
commit a0a19c8362
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View file

@ -11,7 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Breaking changes
None.
- The following types no longer implement `Copy` ([#132](https://github.com/tokio-rs/axum/pull/132)):
- `EmptyRouter`
- `ExtractorMiddleware`
- `ExtractorMiddlewareLayer`
# 0.1.3 (06. August, 2021)

View file

@ -98,8 +98,6 @@ impl<E> Clone for ExtractorMiddlewareLayer<E> {
}
}
impl<E> Copy for ExtractorMiddlewareLayer<E> {}
impl<E> fmt::Debug for ExtractorMiddlewareLayer<E> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("ExtractorMiddleware")
@ -139,8 +137,6 @@ where
}
}
impl<S, E> Copy for ExtractorMiddleware<S, E> where S: Copy {}
impl<S, E> fmt::Debug for ExtractorMiddleware<S, E>
where
S: fmt::Debug,

View file

@ -441,8 +441,6 @@ impl<E> Clone for EmptyRouter<E> {
}
}
impl<E> Copy for EmptyRouter<E> {}
impl<E> fmt::Debug for EmptyRouter<E> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("EmptyRouter").finish()