1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-02 21:39:26 +00:00

Implement From<HeaderMap> for http::HeaderMap

This commit is contained in:
SleeplessOne1917 2023-12-15 20:26:00 -05:00
parent 1114a51b22
commit 68d89a7d84

View file

@ -638,8 +638,15 @@ impl<'a> IntoIterator for &'a HeaderMap {
/// Convert `http::HeaderMap` to our `HeaderMap`.
impl From<http::HeaderMap> for HeaderMap {
fn from(mut map: http::HeaderMap) -> HeaderMap {
HeaderMap::from_drain(map.drain())
fn from(mut map: http::HeaderMap) -> Self {
Self::from_drain(map.drain())
}
}
/// Convert our 'HeaderMap' to 'http::HeaderMap'.
impl From<HeaderMap> for http::HeaderMap {
fn from(map: HeaderMap) -> Self {
Self::from_iter(map.into_iter())
}
}