mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
Implement From<HeaderMap> for http::HeaderMap (#3222)
* Implement From<HeaderMap> for http::HeaderMap * Update changelog * Apply clippy fix * doc tweak --------- Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com> Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
parent
1114a51b22
commit
eefe8b0733
@ -5,6 +5,7 @@
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Updated `zstd` dependency to `0.13`.
|
- Updated `zstd` dependency to `0.13`.
|
||||||
|
- Implemented `From<HeaderMap>` for `http::HeaderMap`.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -636,10 +636,17 @@ impl<'a> IntoIterator for &'a HeaderMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert `http::HeaderMap` to our `HeaderMap`.
|
/// Convert a `http::HeaderMap` to our `HeaderMap`.
|
||||||
impl From<http::HeaderMap> for HeaderMap {
|
impl From<http::HeaderMap> for HeaderMap {
|
||||||
fn from(mut map: http::HeaderMap) -> HeaderMap {
|
fn from(mut map: http::HeaderMap) -> Self {
|
||||||
HeaderMap::from_drain(map.drain())
|
Self::from_drain(map.drain())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Convert our `HeaderMap` to a `http::HeaderMap`.
|
||||||
|
impl From<HeaderMap> for http::HeaderMap {
|
||||||
|
fn from(map: HeaderMap) -> Self {
|
||||||
|
Self::from_iter(map)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user