diff --git a/benches/client_mock_tcp.rs b/benches/client_mock_tcp.rs index db6efe80..76d7c78b 100644 --- a/benches/client_mock_tcp.rs +++ b/benches/client_mock_tcp.rs @@ -12,7 +12,7 @@ use std::path::BytesContainer; use hyper::net; -static README: &'static [u8] = include_bin!("../README.md"); +static README: &'static [u8] = include_bytes!("../README.md"); struct MockStream { diff --git a/src/header/common/authorization.rs b/src/header/common/authorization.rs index e4905366..60d447ff 100644 --- a/src/header/common/authorization.rs +++ b/src/header/common/authorization.rs @@ -1,4 +1,4 @@ -use std::fmt::{self, Show}; +use std::fmt; use std::str::{FromStr, from_utf8}; use std::ops::{Deref, DerefMut}; use serialize::base64::{ToBase64, FromBase64, Standard, Config, Newline}; @@ -70,7 +70,7 @@ impl Scheme for String { } fn fmt_scheme(&self, f: &mut fmt::Formatter) -> fmt::Result { - self.fmt(f) + write!(f, "{}", self) } } @@ -98,12 +98,12 @@ impl Scheme for Basic { if let Some(ref pass) = self.password { text.push_str(&pass[]); } - text.as_bytes().to_base64(Config { + write!(f, "{}", text.as_bytes().to_base64(Config { char_set: Standard, newline: Newline::CRLF, pad: true, line_length: None - }).fmt(f) + })) } } diff --git a/src/header/common/content_length.rs b/src/header/common/content_length.rs index b91c3a2c..ff97cdb2 100644 --- a/src/header/common/content_length.rs +++ b/src/header/common/content_length.rs @@ -1,4 +1,4 @@ -use std::fmt::{self, Show}; +use std::fmt; use header::{Header, HeaderFormat}; use header::shared::util::from_one_raw_str; @@ -24,7 +24,7 @@ impl Header for ContentLength { impl HeaderFormat for ContentLength { fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result { let ContentLength(ref value) = *self; - value.fmt(fmt) + write!(fmt, "{}", value) } } diff --git a/src/header/common/cookie.rs b/src/header/common/cookie.rs index bf0e658e..d595e463 100644 --- a/src/header/common/cookie.rs +++ b/src/header/common/cookie.rs @@ -1,5 +1,5 @@ use header::{Header, HeaderFormat}; -use std::fmt::{self, Show}; +use std::fmt; use std::str::from_utf8; use cookie::Cookie; @@ -58,7 +58,7 @@ impl HeaderFormat for Cookies { for (i, cookie) in cookies.iter().enumerate() { try!(write!(fmt, "{}", cookie.pair())); if i < last { - try!("; ".fmt(fmt)); + try!(fmt.write_str("; ")); } } Ok(()) diff --git a/src/header/common/host.rs b/src/header/common/host.rs index 82b204e3..cb1ef9cd 100644 --- a/src/header/common/host.rs +++ b/src/header/common/host.rs @@ -1,6 +1,6 @@ use header::{Header, HeaderFormat}; use Port; -use std::fmt::{self, Show}; +use std::fmt; use header::shared::util::from_one_raw_str; /// The `Host` header. @@ -66,7 +66,7 @@ impl Header for Host { impl HeaderFormat for Host { fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result { match self.port { - None | Some(80) | Some(443) => self.hostname.fmt(fmt), + None | Some(80) | Some(443) => write!(fmt, "{}", self.hostname), Some(port) => write!(fmt, "{}:{}", self.hostname, port) } } diff --git a/src/header/common/set_cookie.rs b/src/header/common/set_cookie.rs index 34572423..a11fb110 100644 --- a/src/header/common/set_cookie.rs +++ b/src/header/common/set_cookie.rs @@ -1,5 +1,5 @@ use header::{Header, HeaderFormat}; -use std::fmt::{self, Show}; +use std::fmt; use std::str::from_utf8; use cookie::Cookie; @@ -54,7 +54,7 @@ impl HeaderFormat for SetCookie { if i != 0 { try!(f.write_str("\r\nSet-Cookie: ")); } - try!(cookie.fmt(f)); + try!(write!(f, "{}", cookie)); } Ok(()) }