From b4e0057d2b8eee0c7106e32b4a519d832b0315fa Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Wed, 1 Feb 2017 15:47:43 -0800 Subject: [PATCH] test(lib): fix unused warnings in doc tests --- src/client/mod.rs | 13 +++++++------ src/header/mod.rs | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/client/mod.rs b/src/client/mod.rs index 65e7cc29..0f11659b 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -50,16 +50,17 @@ impl Client { /// # Example /// /// ```no_run - /// extern crate hyper; - /// extern crate tokio_core; + /// # extern crate hyper; + /// # extern crate tokio_core; /// - /// fn main() { - /// let mut core = tokio_core::reactor::Core::new().unwrap(); - /// let handle = core.handle(); + /// # fn main() { + /// # let core = tokio_core::reactor::Core::new().unwrap(); + /// # let handle = core.handle(); /// let client = hyper::Client::configure() /// .keep_alive(true) /// .build(&handle); - /// } + /// # drop(client); + /// # } /// ``` #[inline] pub fn configure() -> Config { diff --git a/src/header/mod.rs b/src/header/mod.rs index 8aed5d42..127cef05 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -399,7 +399,8 @@ impl Headers { /// # use hyper::header::Headers; /// # use hyper::header::ContentType; /// # let mut headers = Headers::new(); - /// let has_type = headers.has::(); + /// headers.set(ContentType::json()); + /// assert!(headers.has::()); /// ``` pub fn has(&self) -> bool { self.data.contains_key(&HeaderName(UniCase(Cow::Borrowed(header_name::()))))