Merge pull request #133 from hyperium/rustup

rustup: fmt changes
This commit is contained in:
Sean McArthur
2014-11-20 16:26:52 -08:00
3 changed files with 7 additions and 13 deletions

View File

@@ -116,14 +116,14 @@ impl Request<Fresh> {
}
debug!("writing head: {} {} {}", self.method, uri, self.version);
try!(write!(self.body, "{} {} {}", self.method, uri, self.version))
try!(write!(&mut self.body, "{} {} {}", self.method, uri, self.version))
try!(self.body.write(LINE_ENDING));
let stream = match self.method {
Get | Head => {
debug!("headers [\n{}]", self.headers);
try!(write!(self.body, "{}", self.headers));
try!(write!(&mut self.body, "{}", self.headers));
try!(self.body.write(LINE_ENDING));
EmptyWriter(self.body.unwrap())
},
@@ -157,7 +157,7 @@ impl Request<Fresh> {
}
debug!("headers [\n{}]", self.headers);
try!(write!(self.body, "{}", self.headers));
try!(write!(&mut self.body, "{}", self.headers));
try!(self.body.write(LINE_ENDING));
if chunked {

View File

@@ -69,7 +69,7 @@ impl Response<Fresh> {
/// Consume this Response<Fresh>, writing the Headers and Status and creating a Response<Streaming>
pub fn start(mut self) -> IoResult<Response<Streaming>> {
debug!("writing head: {} {}", self.version, self.status);
try!(write!(self.body, "{} {}{}{}", self.version, self.status, CR as char, LF as char));
try!(write!(&mut self.body, "{} {}{}{}", self.version, self.status, CR as char, LF as char));
if !self.headers.has::<common::Date>() {
self.headers.set(common::Date(now_utc()));
@@ -106,7 +106,7 @@ impl Response<Fresh> {
debug!("headers [\n{}]", self.headers);
try!(write!(self.body, "{}", self.headers));
try!(write!(&mut self.body, "{}", self.headers));
try!(self.body.write(LINE_ENDING));
@@ -144,7 +144,7 @@ impl Response<Streaming> {
impl Writer for Response<Streaming> {
fn write(&mut self, msg: &[u8]) -> IoResult<()> {
debug!("write {:u} bytes", msg.len());
debug!("write {} bytes", msg.len());
self.body.write(msg)
}

View File

@@ -1569,12 +1569,6 @@ impl StatusCode {
}
}
impl fmt::Unsigned for StatusCode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Unsigned::fmt(&(*self as u16), f)
}
}
/// Formats the status code, *including* the canonical reason.
///
/// ```rust
@@ -1585,7 +1579,7 @@ impl fmt::Unsigned for StatusCode {
/// "123 <unknown status code>");
/// ```
///
/// If you wish to just include the number, use `Unsigned` instead (`{:u}`).
/// If you wish to just include the number, cast to a u16 instead.
impl fmt::Show for StatusCode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{} {}", *self as u16,