diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 2d082f4a..cc9fdd2b 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased -- None +- Implement `IntoResponse` for `http::response::Parts` ([#490]) + +[#490]: https://github.com/tokio-rs/axum/pull/490 # 0.3.2 (08. November, 2021) diff --git a/axum/src/response/mod.rs b/axum/src/response/mod.rs index 3f36eed7..59c24fcd 100644 --- a/axum/src/response/mod.rs +++ b/axum/src/response/mod.rs @@ -245,6 +245,15 @@ impl_into_response_for_body!(hyper::Body); impl_into_response_for_body!(Full); impl_into_response_for_body!(Empty); +impl IntoResponse for http::response::Parts { + type Body = Empty; + type BodyError = Infallible; + + fn into_response(self) -> Response { + Response::from_parts(self, Empty::new()) + } +} + impl IntoResponse for http_body::combinators::BoxBody where E: Into + 'static,