diff --git a/gix-packetline/src/read/sidebands/async_io.rs b/gix-packetline/src/read/sidebands/async_io.rs index 6c53e922c1..e93b0b9359 100644 --- a/gix-packetline/src/read/sidebands/async_io.rs +++ b/gix-packetline/src/read/sidebands/async_io.rs @@ -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> { - 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)) } diff --git a/gix-packetline/src/read/sidebands/blocking_io.rs b/gix-packetline/src/read/sidebands/blocking_io.rs index f5c87aeb83..dec23a9baa 100644 --- a/gix-packetline/src/read/sidebands/blocking_io.rs +++ b/gix-packetline/src/read/sidebands/blocking_io.rs @@ -208,10 +208,8 @@ where F: FnMut(bool, &[u8]) -> ProgressAction, { fn read(&mut self, buf: &mut [u8]) -> io::Result { - 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) }