From 05725ac9a44f95ddfe758f0e36332489ffe542b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 19 Jan 2021 14:24:31 +0100 Subject: [PATCH] clippy: remove unnecessary `let` binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabian Grünbichler --- src/backup/catalog_shell.rs | 3 +-- src/tape/chunk_archive.rs | 10 +++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/backup/catalog_shell.rs b/src/backup/catalog_shell.rs index 795d8bb3..00b5b580 100644 --- a/src/backup/catalog_shell.rs +++ b/src/backup/catalog_shell.rs @@ -441,8 +441,7 @@ impl Shell { R: 'static, { let shell: &mut Shell = unsafe { std::mem::transmute(SHELL.unwrap()) }; - let result = call(&mut *shell).await; - result + call(&mut *shell).await } pub async fn shell(mut self) -> Result<(), Error> { diff --git a/src/tape/chunk_archive.rs b/src/tape/chunk_archive.rs index ebbf9ac1..fe0780fc 100644 --- a/src/tape/chunk_archive.rs +++ b/src/tape/chunk_archive.rs @@ -62,15 +62,11 @@ impl <'a> ChunkArchiveWriter<'a> { } fn write_all(&mut self, data: &[u8]) -> Result { - let result = match self.writer { - Some(ref mut writer) => { - let leom = writer.write_all(data)?; - Ok(leom) - } + match self.writer { + Some(ref mut writer) => writer.write_all(data), None => proxmox::io_bail!( "detected write after archive finished - internal error"), - }; - result + } } /// Write chunk into archive.