Skip to content

Commit

Permalink
Fix clippy::redundant_guards warning
Browse files Browse the repository at this point in the history
```
warning: redundant guard
    --> src/io.rs:2701:28
     |
2701 |                 Ok(buf) if buf.is_empty() => {
     |                            ^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards
     = note: `#[warn(clippy::redundant_guards)]` on by default
help: try
     |
2701 -                 Ok(buf) if buf.is_empty() => {
2701 +                 Ok([]) => {
     |
```
  • Loading branch information
taiki-e committed Jan 6, 2024
1 parent d6f2a9b commit 7edb0e5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2698,9 +2698,7 @@ impl<R1: AsyncBufRead, R2: AsyncBufRead> AsyncBufRead for Chain<R1, R2> {
let this = self.project();
if !*this.done_first {
match ready!(this.first.poll_fill_buf(cx)) {
Ok(buf) if buf.is_empty() => {
*this.done_first = true;
}
Ok([]) => *this.done_first = true,
Ok(buf) => return Poll::Ready(Ok(buf)),
Err(err) => return Poll::Ready(Err(err)),
}
Expand Down

0 comments on commit 7edb0e5

Please sign in to comment.