mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-23 16:21:06 +01:00
Implement From<&HeaderMap>
for http::HeaderMap
(#3230)
* Add From impl for header map references * Add From impl for header map references * Remove Into<HeaderMap> via http::HeaderMap * fix changelog --------- Co-authored-by: SleeplessOne1917 <insomnia-void@protonmail.com> Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
parent
c1f88f718b
commit
ae7736f134
@ -2,6 +2,10 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Added
|
||||
|
||||
- Implement `From<&HeaderMap>` for `http::HeaderMap`.
|
||||
|
||||
## 3.5.1
|
||||
|
||||
### Fixed
|
||||
|
@ -650,6 +650,13 @@ impl From<HeaderMap> for http::HeaderMap {
|
||||
}
|
||||
}
|
||||
|
||||
/// Convert our `&HeaderMap` to a `http::HeaderMap`.
|
||||
impl From<&HeaderMap> for http::HeaderMap {
|
||||
fn from(map: &HeaderMap) -> Self {
|
||||
map.to_owned().into()
|
||||
}
|
||||
}
|
||||
|
||||
/// Iterator over removed, owned values with the same associated name.
|
||||
///
|
||||
/// Returned from methods that remove or replace items. See [`HeaderMap::insert`]
|
||||
|
Loading…
Reference in New Issue
Block a user