Skip to content

Commit

Permalink
clippy: integrate two clippy improvments
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Jun 20, 2023
1 parent 0960708 commit c44cb4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/body/incoming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl Error {
pub(crate) fn find_source<E: StdError + 'static>(&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();
Expand Down

0 comments on commit c44cb4b

Please sign in to comment.