diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 69dbe8ae..d498dfd4 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -14,11 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **added:** Add `AppendHeaders` for appending headers to a response rather than overriding them ([#927]) - **added:** Add `axum::extract::multipart::Field::chunk` method for streaming a single chunk from the field ([#901]) -- **changed:** Allow `Error: Into` for `Route::{layer, route_layer}` ([#924]) - **fixed:** Fix trailing slash redirection with query parameters ([#936]) [#901]: https://github.com/tokio-rs/axum/pull/901 -[#924]: https://github.com/tokio-rs/axum/pull/924 [#927]: https://github.com/tokio-rs/axum/pull/927 [#936]: https://github.com/tokio-rs/axum/pull/936 diff --git a/axum/src/routing/mod.rs b/axum/src/routing/mod.rs index df4352f3..581e9241 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> + Clone + Send + 'static, - >>::Error: Into + 'static, + L::Service: Service, Response = Response, Error = Infallible> + + Clone + + Send + + '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,14 +332,15 @@ where pub fn route_layer(self, layer: L) -> Self where L: Layer>, - L::Service: Service, Response = Response> + Clone + Send + 'static, - >>::Error: Into + 'static, + L::Service: Service, Response = Response, Error = Infallible> + + Clone + + Send + + '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();