diff --git a/src/body/incoming.rs b/src/body/incoming.rs index c8f3b06770..36a24c5284 100644 --- a/src/body/incoming.rs +++ b/src/body/incoming.rs @@ -170,13 +170,9 @@ impl Body for Incoming { want_tx.send(WANT_READY); if !data_rx.is_terminated() { - match ready!(Pin::new(data_rx).poll_next(cx)?) { - Some(chunk) => { - len.sub_if(chunk.len() as u64); - return Poll::Ready(Some(Ok(Frame::data(chunk)))); - } - // fall through to trailers - None => (), + if let Some(chunk) = ready!(Pin::new(data_rx).poll_next(cx)?) { + len.sub_if(chunk.len() as u64); + return Poll::Ready(Some(Ok(Frame::data(chunk)))); } } diff --git a/src/error.rs b/src/error.rs index b07a22c409..93fc5b81d7 100644 --- a/src/error.rs +++ b/src/error.rs @@ -197,7 +197,7 @@ impl Error { pub(crate) fn find_source(&self) -> Option<&E> { let mut cause = self.source(); while let Some(err) = cause { - if let Some(ref typed) = err.downcast_ref() { + if let Some(typed) = err.downcast_ref() { return Some(typed); } cause = err.source();