From cc6e5d73726b3e0d101fad5fa77472bf7993570f Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 5 Jul 2022 12:13:38 +0200 Subject: [PATCH] compression: minor cleanup Signed-off-by: Wolfgang Bumiller --- proxmox-compression/src/zstd.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/proxmox-compression/src/zstd.rs b/proxmox-compression/src/zstd.rs index e463ff2d..dc0dcc74 100644 --- a/proxmox-compression/src/zstd.rs +++ b/proxmox-compression/src/zstd.rs @@ -95,10 +95,7 @@ where match this.state { EncoderState::Reading => { if let Some(res) = ready!(Pin::new(&mut this.inner).poll_next(cx)) { - let buf = match res { - Ok(buf) => buf, - Err(err) => return Poll::Ready(Some(Err(err.into()))), - }; + let buf = res.map_err(Into::into)?; this.input_buffer = buf.into(); this.state = EncoderState::Writing; } else {