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:
parent
1114a51b22
commit
68d89a7d84
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue