clippy: Fix warnings in components/net (#31626)

* clippy: fix warnings in `components/net`

* fix: review comments
This commit is contained in:
eri 2024-03-13 10:40:04 +01:00 committed by GitHub
parent 5ea0531775
commit 63527f56ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 54 additions and 53 deletions

View file

@ -248,7 +248,7 @@ fn poll_with_read(reader: &mut dyn Read, buf: &mut BytesMut) -> Poll<Option<Resu
};
match read {
Ok(read) if read == 0 => Poll::Ready(None),
Ok(0) => Poll::Ready(None),
Ok(read) => {
unsafe { buf.advance_mut(read) };
let chunk = buf.split_to(read).freeze();