Skip to content

Commit

Permalink
Remove Copy some impls (#132)
Browse files Browse the repository at this point in the history
#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`
  • Loading branch information
davidpdrsn authored Aug 7, 2021
1 parent d7d97a6 commit a0a19c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 0 additions & 4 deletions src/extract/extractor_middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a0a19c8

Please sign in to comment.