From a0a19c8362d0745fd937a02aec13df5c83013da9 Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Sat, 7 Aug 2021 16:13:56 +0200 Subject: [PATCH] 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` --- CHANGELOG.md | 5 ++++- src/extract/extractor_middleware.rs | 4 ---- src/routing.rs | 2 -- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e4d683f..cbce9eef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/extract/extractor_middleware.rs b/src/extract/extractor_middleware.rs index 59564050..f648dd99 100644 --- a/src/extract/extractor_middleware.rs +++ b/src/extract/extractor_middleware.rs @@ -98,8 +98,6 @@ impl Clone for ExtractorMiddlewareLayer { } } -impl Copy for ExtractorMiddlewareLayer {} - impl fmt::Debug for ExtractorMiddlewareLayer { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("ExtractorMiddleware") @@ -139,8 +137,6 @@ where } } -impl Copy for ExtractorMiddleware where S: Copy {} - impl fmt::Debug for ExtractorMiddleware where S: fmt::Debug, diff --git a/src/routing.rs b/src/routing.rs index d6d65888..fd54c0f4 100644 --- a/src/routing.rs +++ b/src/routing.rs @@ -441,8 +441,6 @@ impl Clone for EmptyRouter { } } -impl Copy for EmptyRouter {} - impl fmt::Debug for EmptyRouter { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("EmptyRouter").finish()