From 69a51c9af072d9bc06c4ce69cd2cccd5611165d1 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 23 Feb 2021 14:33:08 +0100 Subject: [PATCH] minor cleanup Signed-off-by: Wolfgang Bumiller --- proxmox/src/test/io.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/proxmox/src/test/io.rs b/proxmox/src/test/io.rs index 84aaf318..d8b6a984 100644 --- a/proxmox/src/test/io.rs +++ b/proxmox/src/test/io.rs @@ -45,13 +45,13 @@ impl AsyncRead for AsyncBlockingReader { ) -> Poll> { let this = Pin::get_mut(self); let mut read_buf = buf.initialize_unfilled(); - match this.inner.read(&mut read_buf) { + Poll::Ready(match this.inner.read(&mut read_buf) { Ok(len) => { buf.advance(len); - Poll::Ready(Ok(())) + Ok(()) } - Err(err) => Poll::Ready(Err(err)), - } + Err(err) => Err(err), + }) } } @@ -62,10 +62,10 @@ impl AsyncWrite for AsyncBlockingWriter { buf: &[u8], ) -> Poll> { let this = Pin::get_mut(self); - match this.inner.write(buf) { - Ok(len) => Poll::Ready(Ok(len)), - Err(err) => Poll::Ready(Err(err)), - } + Poll::Ready(match this.inner.write(buf) { + Ok(len) => Ok(len), + Err(err) => Err(err), + }) } fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> {