Skip to content

Commit a4af4cb

Browse files
committed
fix CI
It seems a clippy lint now shows a false positive, so code-refactoring had to do the trick.
1 parent 8fde62b commit a4af4cb

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

gix-packetline/src/read/sidebands/async_io.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,9 @@ where
354354
F: FnMut(bool, &[u8]) -> ProgressAction + Unpin,
355355
{
356356
fn poll_read(mut self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<std::io::Result<usize>> {
357-
let nread = {
358-
use std::io::Read;
359-
let mut rem = ready!(self.as_mut().poll_fill_buf(cx))?;
360-
rem.read(buf)?
361-
};
357+
use std::io::Read;
358+
let mut rem = ready!(self.as_mut().poll_fill_buf(cx))?;
359+
let nread = rem.read(buf)?;
362360
self.consume(nread);
363361
Poll::Ready(Ok(nread))
364362
}

gix-packetline/src/read/sidebands/blocking_io.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,8 @@ where
208208
F: FnMut(bool, &[u8]) -> ProgressAction,
209209
{
210210
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
211-
let nread = {
212-
let mut rem = self.fill_buf()?;
213-
rem.read(buf)?
214-
};
211+
let mut rem = self.fill_buf()?;
212+
let nread = rem.read(buf)?;
215213
self.consume(nread);
216214
Ok(nread)
217215
}

0 commit comments

Comments
 (0)