1
0
mirror of https://github.com/fafhrd91/actix-web synced 2024-11-27 17:52:56 +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:
SleeplessOne1917 2024-02-01 12:52:35 +00:00 committed by GitHub
parent c1f88f718b
commit ae7736f134
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -2,6 +2,10 @@
## Unreleased ## Unreleased
### Added
- Implement `From<&HeaderMap>` for `http::HeaderMap`.
## 3.5.1 ## 3.5.1
### Fixed ### Fixed

View File

@ -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. /// Iterator over removed, owned values with the same associated name.
/// ///
/// Returned from methods that remove or replace items. See [`HeaderMap::insert`] /// Returned from methods that remove or replace items. See [`HeaderMap::insert`]