Skip to content

Commit

Permalink
fix: Clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cdata committed Jul 25, 2024
1 parent 3538c08 commit 6acf43f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/body_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ impl Body for BodyStream {
cx: &mut Context<'_>,
) -> Poll<Option<Result<http_body::Frame<Self::Data>, Self::Error>>> {
match self.body_stream.as_mut().poll_next(cx) {
Poll::Ready(maybe) => {
Poll::Ready(maybe.map(|result| result.map(|bytes| Frame::data(bytes))))
}
Poll::Ready(maybe) => Poll::Ready(maybe.map(|result| result.map(Frame::data))),
Poll::Pending => Poll::Pending,
}
}
Expand Down
13 changes: 3 additions & 10 deletions src/response_body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ pub enum ReadState {
}

impl ReadState {
fn is_done(&self) -> bool {
matches!(self, ReadState::Done)
}

fn finished_data(&self) -> bool {
matches!(self, ReadState::TrailerLength)
|| matches!(self, ReadState::Trailer(_))
Expand Down Expand Up @@ -146,13 +142,10 @@ impl ResponseBody {

match ready!(this.body_stream.poll_frame(cx)) {
Some(Ok(frame)) => {
match frame.data_ref() {
Some(data) => {
if let Err(e) = this.buf.append(data.clone()) {
return Poll::Ready(Err(e));
}
if let Some(data) = frame.data_ref() {
if let Err(e) = this.buf.append(data.clone()) {
return Poll::Ready(Err(e));
}
_ => (),
};

Poll::Ready(Ok(()))
Expand Down

0 comments on commit 6acf43f

Please sign in to comment.