mirror of
https://github.com/actix/actix-web.git
synced 2024-11-25 11:01:14 +00: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 changed files with 11 additions and 0 deletions
|
@ -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 a new issue