Skip to content

Commit 25a6111

Browse files
lovasoaseanmonstar
authored andcommitted
Implement HttpTryFrom<HashMap<String,String>> for HeaderMap (#326)
1 parent 014cfdc commit 25a6111

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/convert.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ reflexive! {
5555
Uri,
5656
Method,
5757
StatusCode,
58+
HeaderMap,
5859
HeaderName,
5960
HeaderValue,
6061
Scheme,

src/header/map.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
use super::name::{HdrName, HeaderName, InvalidHeaderName};
2-
use super::HeaderValue;
3-
41
use std::collections::HashMap;
52
use std::collections::hash_map::RandomState;
63
use std::hash::{BuildHasher, Hash, Hasher};
@@ -30,6 +27,7 @@ pub use self::into_header_name::IntoHeaderName;
3027
/// ```
3128
/// # use http::HeaderMap;
3229
/// # use http::header::{CONTENT_LENGTH, HOST, LOCATION};
30+
/// # use http::HttpTryFrom;
3331
/// let mut headers = HeaderMap::new();
3432
///
3533
/// headers.insert(HOST, "example.com".parse().unwrap());
@@ -3337,7 +3335,7 @@ mod as_header_name {
33373335
use super::{Entry, HdrName, HeaderMap, HeaderName, InvalidHeaderName};
33383336

33393337
/// A marker trait used to identify values that can be used as search keys
3340-
/// to a `HeaderMap`.
3338+
/// to a `HeaderMap`.
33413339
pub trait AsHeaderName: Sealed {}
33423340

33433341
// All methods are on this pub(super) trait, instead of `AsHeaderName`,

0 commit comments

Comments
 (0)