mirror of
https://github.com/tokio-rs/axum.git
synced 2025-01-11 12:31:25 +01:00
Implement IntoResponse
for http::response::Parts
(#490)
* Implement `IntoResponse` for `http::response::Parts` Not sure there are many use cases for this but still thinks it makes to provide since other crates can't. * Use `Response::from_parts`
This commit is contained in:
parent
2ee66e812f
commit
62be8aaa18
2 changed files with 12 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -245,6 +245,15 @@ impl_into_response_for_body!(hyper::Body);
|
|||
impl_into_response_for_body!(Full<Bytes>);
|
||||
impl_into_response_for_body!(Empty<Bytes>);
|
||||
|
||||
impl IntoResponse for http::response::Parts {
|
||||
type Body = Empty<Bytes>;
|
||||
type BodyError = Infallible;
|
||||
|
||||
fn into_response(self) -> Response<Self::Body> {
|
||||
Response::from_parts(self, Empty::new())
|
||||
}
|
||||
}
|
||||
|
||||
impl<E> IntoResponse for http_body::combinators::BoxBody<Bytes, E>
|
||||
where
|
||||
E: Into<BoxError> + 'static,
|
||||
|
|
Loading…
Reference in a new issue