Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
It seems a clippy lint now shows a false positive, so code-refactoring
had to do the trick.
  • Loading branch information
Byron committed Mar 21, 2024
1 parent 8fde62b commit a4af4cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 3 additions & 5 deletions gix-packetline/src/read/sidebands/async_io.rs
Expand Up @@ -354,11 +354,9 @@ where
F: FnMut(bool, &[u8]) -> ProgressAction + Unpin,
{
fn poll_read(mut self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<std::io::Result<usize>> {
let nread = {
use std::io::Read;
let mut rem = ready!(self.as_mut().poll_fill_buf(cx))?;
rem.read(buf)?
};
use std::io::Read;
let mut rem = ready!(self.as_mut().poll_fill_buf(cx))?;
let nread = rem.read(buf)?;
self.consume(nread);
Poll::Ready(Ok(nread))
}
Expand Down
6 changes: 2 additions & 4 deletions gix-packetline/src/read/sidebands/blocking_io.rs
Expand Up @@ -208,10 +208,8 @@ where
F: FnMut(bool, &[u8]) -> ProgressAction,
{
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
let nread = {
let mut rem = self.fill_buf()?;
rem.read(buf)?
};
let mut rem = self.fill_buf()?;
let nread = rem.read(buf)?;
self.consume(nread);
Ok(nread)
}
Expand Down

0 comments on commit a4af4cb

Please sign in to comment.