1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-05-09 12:02:59 +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:
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
### Added
- Implement `From<&HeaderMap>` for `http::HeaderMap`.
## 3.5.1
### 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.
///
/// Returned from methods that remove or replace items. See [`HeaderMap::insert`]