refactor(hyper): Fix a few nits

This commit is contained in:
Pyfisch
2015-05-01 11:57:25 +02:00
parent 92ee51acdb
commit 6b59bd28b7
8 changed files with 18 additions and 34 deletions

View File

@@ -300,7 +300,7 @@ impl<W: Write> Write for HttpWriter<W> {
}
},
EmptyWriter(..) => {
if msg.len() != 0 {
if !msg.is_empty() {
error!("Cannot include a body with this kind of message");
}
Ok(0)
@@ -354,7 +354,7 @@ fn parse<R: Read, T: TryParse<Subject=I>, I>(rdr: &mut BufReader<R>) -> HttpResu
_partial => ()
}
match try!(rdr.read_into_buf()) {
0 if rdr.get_buf().len() == 0 => {
0 if rdr.get_buf().is_empty() => {
return Err(HttpIoError(io::Error::new(
io::ErrorKind::ConnectionAborted,
"Connection closed"