Implement IntoResponse for HeaderMap

This commit is contained in:
David Pedersen 2021-07-22 21:21:53 +02:00
parent 6d483a623a
commit 1fb80a1129

View file

@ -169,6 +169,14 @@ where
} }
} }
impl IntoResponse for HeaderMap {
fn into_response(self) -> Response<Body> {
let mut res = Response::new(Body::empty());
*res.headers_mut() = self;
res
}
}
/// An HTML response. /// An HTML response.
/// ///
/// Will automatically get `Content-Type: text/html`. /// Will automatically get `Content-Type: text/html`.