diff --git a/src/client/parser.rs b/src/client/parser.rs index 1eeb021b1..22b8f78aa 100644 --- a/src/client/parser.rs +++ b/src/client/parser.rs @@ -39,10 +39,8 @@ impl HttpResponseParser { // if buf is empty parse_message will always return NotReady, let's avoid that let read = if buf.is_empty() { match utils::read_from_io(io, buf) { - Ok(Async::Ready(0)) => { - // debug!("Ignored premature client disconnection"); - return Err(HttpResponseParserError::Disconnect); - }, + Ok(Async::Ready(0)) => + return Err(HttpResponseParserError::Disconnect), Ok(Async::Ready(_)) => (), Ok(Async::NotReady) => return Ok(Async::NotReady), @@ -66,10 +64,12 @@ impl HttpResponseParser { } if read || buf.remaining_mut() == 0 { match utils::read_from_io(io, buf) { - Ok(Async::Ready(0)) => return Err(HttpResponseParserError::Disconnect), + Ok(Async::Ready(0)) => + return Err(HttpResponseParserError::Disconnect), Ok(Async::Ready(_)) => (), Ok(Async::NotReady) => return Ok(Async::NotReady), - Err(err) => return Err(HttpResponseParserError::Error(err.into())), + Err(err) => + return Err(HttpResponseParserError::Error(err.into())), } } else { return Ok(Async::NotReady) @@ -109,7 +109,8 @@ impl HttpResponseParser { } } - fn parse_message(buf: &mut BytesMut) -> Poll<(ClientResponse, Option), ParseError> + fn parse_message(buf: &mut BytesMut) + -> Poll<(ClientResponse, Option), ParseError> { // Parse http message let bytes_ptr = buf.as_ref().as_ptr() as usize; diff --git a/src/httprequest.rs b/src/httprequest.rs index ae7c21ba9..688bea7a4 100644 --- a/src/httprequest.rs +++ b/src/httprequest.rs @@ -365,7 +365,7 @@ impl HttpRequest { /// Get mutable reference to request's Params. #[inline] - pub(crate) fn match_info_mut(&mut self) -> &mut Params { + pub fn match_info_mut(&mut self) -> &mut Params { unsafe{ mem::transmute(&mut self.as_mut().params) } }