diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 9b5e970df4..7abe00522d 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -11,14 +11,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 extractor ([#1078]) - **added:** Implement `IntoResponse` for `Form` ([#1095]) - **change:** axum's MSRV is now 1.56 ([#1098]) +- **breaking:** Remove `extractor_middleware` which was previously deprecated. + Use `axum::middleware::from_extractor` instead ([#1077]) +- **breaking:** Allow `Error: Into` for `Route::{layer, route_layer}` ([#924]) - **breaking:** Remove `extractor_middleware` which was previously deprecated. Use `axum::middleware::from_extractor` instead ([#1077]) [#1077]: https://github.com/tokio-rs/axum/pull/1077 [#1078]: https://github.com/tokio-rs/axum/pull/1078 [#1078]: https://github.com/tokio-rs/axum/pull/1078 +[#1078]: https://github.com/tokio-rs/axum/pull/1078 [#1095]: https://github.com/tokio-rs/axum/pull/1095 [#1098]: https://github.com/tokio-rs/axum/pull/1098 +[#924]: https://github.com/tokio-rs/axum/pull/924 # 0.5.7 (08. June, 2022) diff --git a/axum/src/routing/mod.rs b/axum/src/routing/mod.rs index ca178a75ca..23279872fa 100644 --- a/axum/src/routing/mod.rs +++ b/axum/src/routing/mod.rs @@ -291,15 +291,15 @@ where pub fn layer(self, layer: L) -> Router where L: Layer>, - L::Service: Service, Response = Response, Error = Infallible> - + Clone - + Send - + 'static, + L::Service: + Service, Response = Response> + Clone + Send + 'static, + >>::Error: Into + 'static, >>::Future: Send + 'static, NewResBody: HttpBody + Send + 'static, NewResBody::Error: Into, { let layer = ServiceBuilder::new() + .map_err(Into::into) .layer(MapResponseBodyLayer::new(boxed)) .layer(layer) .into_inner(); @@ -332,15 +332,14 @@ where pub fn route_layer(self, layer: L) -> Self where L: Layer>, - L::Service: Service, Response = Response, Error = Infallible> - + Clone - + Send - + 'static, + L::Service: Service, Response = Response> + Clone + Send + 'static, + >>::Error: Into + 'static, >>::Future: Send + 'static, NewResBody: HttpBody + Send + 'static, NewResBody::Error: Into, { let layer = ServiceBuilder::new() + .map_err(Into::into) .layer(MapResponseBodyLayer::new(boxed)) .layer(layer) .into_inner();