From b57d7b258dfd3e1e48fb68e2281bfd0c6567c864 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 30 Jun 2022 16:41:46 +0100 Subject: [PATCH] build: Fix beta clippy issue (needless_return) warning: unneeded `return` statement --> pci/src/vfio_user.rs:627:13 | 627 | / return Err(std::io::Error::new( 628 | | std::io::ErrorKind::Other, 629 | | format!("Region not found for 0x{:x}", gpa), 630 | | )); | |_______________^ | = note: `#[warn(clippy::needless_return)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 627 ~ Err(std::io::Error::new( 628 + std::io::ErrorKind::Other, 629 + format!("Region not found for 0x{:x}", gpa), 630 + )) | Signed-off-by: Rob Bradford --- pci/src/vfio_user.rs | 4 ++-- vmm/src/gdb.rs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pci/src/vfio_user.rs b/pci/src/vfio_user.rs index 10d00c7e8..301634dd7 100644 --- a/pci/src/vfio_user.rs +++ b/pci/src/vfio_user.rs @@ -624,10 +624,10 @@ impl ExternalDmaMapping for VfioUserDmaMappi ) }) } else { - return Err(std::io::Error::new( + Err(std::io::Error::new( std::io::ErrorKind::Other, format!("Region not found for 0x{:x}", gpa), - )); + )) } } diff --git a/vmm/src/gdb.rs b/vmm/src/gdb.rs index cf1c01f0c..440362f69 100644 --- a/vmm/src/gdb.rs +++ b/vmm/src/gdb.rs @@ -363,9 +363,7 @@ impl MultiThreadSingleStep for GdbStub { } match self.vm_request(GdbRequestPayload::Resume, tid_to_cpuid(tid)) { Ok(_) => Ok(()), - Err(e) => { - return Err(format!("Failed to resume the target: {:?}", e)); - } + Err(e) => Err(format!("Failed to resume the target: {:?}", e)), } } }