Skip to content

Commit

Permalink
Implement HttpTryFrom<HashMap<String,String>> for HeaderMap (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa authored and seanmonstar committed Nov 26, 2019
1 parent 014cfdc commit 25a6111
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/convert.rs
Expand Up @@ -55,6 +55,7 @@ reflexive! {
Uri,
Method,
StatusCode,
HeaderMap,
HeaderName,
HeaderValue,
Scheme,
Expand Down
6 changes: 2 additions & 4 deletions src/header/map.rs
@@ -1,6 +1,3 @@
use super::name::{HdrName, HeaderName, InvalidHeaderName};
use super::HeaderValue;

use std::collections::HashMap;
use std::collections::hash_map::RandomState;
use std::hash::{BuildHasher, Hash, Hasher};
Expand Down Expand Up @@ -30,6 +27,7 @@ pub use self::into_header_name::IntoHeaderName;
/// ```
/// # use http::HeaderMap;
/// # use http::header::{CONTENT_LENGTH, HOST, LOCATION};
/// # use http::HttpTryFrom;
/// let mut headers = HeaderMap::new();
///
/// headers.insert(HOST, "example.com".parse().unwrap());
Expand Down Expand Up @@ -3337,7 +3335,7 @@ mod as_header_name {
use super::{Entry, HdrName, HeaderMap, HeaderName, InvalidHeaderName};

/// A marker trait used to identify values that can be used as search keys
/// to a `HeaderMap`.
/// to a `HeaderMap`.
pub trait AsHeaderName: Sealed {}

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

0 comments on commit 25a6111

Please sign in to comment.