test(lib): fix unused warnings in doc tests

This commit is contained in:
Sean McArthur
2017-02-01 15:47:43 -08:00
parent 352b31f67d
commit b4e0057d2b
2 changed files with 9 additions and 7 deletions

View File

@@ -399,7 +399,8 @@ impl Headers {
/// # use hyper::header::Headers;
/// # use hyper::header::ContentType;
/// # let mut headers = Headers::new();
/// let has_type = headers.has::<ContentType>();
/// headers.set(ContentType::json());
/// assert!(headers.has::<ContentType>());
/// ```
pub fn has<H: Header>(&self) -> bool {
self.data.contains_key(&HeaderName(UniCase(Cow::Borrowed(header_name::<H>()))))