From 8dc63758e2988cc1af948d2b2ee9347b854db59f Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Tue, 23 Aug 2022 16:37:43 -0700 Subject: [PATCH] cros_async, hypervisor: remove unnecessary unit-valued lets The functions being called do not have return values (they return the unit value), so the `let _ =` does nothing and can be removed. Fixes a new clippy lint: BUG=b:243677117 TEST=tools/clippy # with Rust 1.62 Change-Id: I6003b162c36e7be1ee71e3edc4e304c86fdc5676 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3854970 Tested-by: Daniel Verkamp Reviewed-by: Keiichi Watanabe Commit-Queue: Daniel Verkamp --- cros_async/src/blocking/cancellable_pool.rs | 4 ++-- cros_async/src/sys/unix/uring_executor.rs | 2 +- hypervisor/src/kvm/mod.rs | 2 +- kvm/src/lib.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cros_async/src/blocking/cancellable_pool.rs b/cros_async/src/blocking/cancellable_pool.rs index 99fb333498..605862a3c8 100644 --- a/cros_async/src/blocking/cancellable_pool.rs +++ b/cros_async/src/blocking/cancellable_pool.rs @@ -392,7 +392,7 @@ mod test { let unfinished = pool.spawn(|| 5, || 0); // Disarming should cancel the task. - let _ = pool.disarm(); + pool.disarm(); // Shutdown the blocking thread. This will allow a worker to pick up the task that has // to be cancelled. @@ -403,7 +403,7 @@ mod test { assert_eq!(block_on(unfinished), 0); // Now the pool is empty and can be shutdown without blocking. - let _ = pool.shutdown().unwrap(); + pool.shutdown().unwrap(); } #[test] diff --git a/cros_async/src/sys/unix/uring_executor.rs b/cros_async/src/sys/unix/uring_executor.rs index 4286aa3920..16355b409c 100644 --- a/cros_async/src/sys/unix/uring_executor.rs +++ b/cros_async/src/sys/unix/uring_executor.rs @@ -262,7 +262,7 @@ impl RegisteredSource { impl Drop for RegisteredSource { fn drop(&mut self) { if let Some(ex) = self.ex.upgrade() { - let _ = ex.deregister_source(self); + ex.deregister_source(self); } } } diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 52155b93c2..cdcda8f2a3 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -1251,7 +1251,7 @@ impl BlockedSignal { impl Drop for BlockedSignal { fn drop(&mut self) { - let _ = unblock_signal(self.signal_num).expect("failed to restore signal mask"); + unblock_signal(self.signal_num).expect("failed to restore signal mask"); } } diff --git a/kvm/src/lib.rs b/kvm/src/lib.rs index fa93d544c5..a597c9214f 100644 --- a/kvm/src/lib.rs +++ b/kvm/src/lib.rs @@ -1757,7 +1757,7 @@ impl BlockedSignal { impl Drop for BlockedSignal { fn drop(&mut self) { - let _ = unblock_signal(self.signal_num).expect("failed to restore signal mask"); + unblock_signal(self.signal_num).expect("failed to restore signal mask"); } }