From fa9499c8870b416078fc4001543b9e3446753c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sarek=20H=C3=B8verstad=20Skot=C3=A5m?= <44001885+sarsko@users.noreply.github.com> Date: Tue, 10 Sep 2024 01:42:16 -0700 Subject: [PATCH] Clippy lints (#162) --- src/future/batch_semaphore.rs | 3 +-- src/sync/mutex.rs | 2 +- src/sync/rwlock.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/future/batch_semaphore.rs b/src/future/batch_semaphore.rs index eafb6df..195d9ff 100644 --- a/src/future/batch_semaphore.rs +++ b/src/future/batch_semaphore.rs @@ -344,7 +344,7 @@ impl BatchSemaphore { /// If there aren't enough permits, returns `Err(TryAcquireError::NoPermits)` pub fn try_acquire(&self, num_permits: usize) -> Result<(), TryAcquireError> { let mut state = self.state.borrow_mut(); - let res = state.acquire_permits(num_permits, self.fairness).map_err(|err| { + let res = state.acquire_permits(num_permits, self.fairness).inspect_err(|_err| { // Conservatively, the requester causally depends on the // last successful acquire. // TODO: This is not precise, but `try_acquire` causal dependency @@ -361,7 +361,6 @@ impl BatchSemaphore { ExecutionState::with(|s| { s.update_clock(&state.permits_available.last_acquire); }); - err }); drop(state); diff --git a/src/sync/mutex.rs b/src/sync/mutex.rs index e7540f5..60d1e3c 100644 --- a/src/sync/mutex.rs +++ b/src/sync/mutex.rs @@ -158,7 +158,7 @@ unsafe impl Sync for Mutex {} impl UnwindSafe for Mutex {} impl RefUnwindSafe for Mutex {} -impl Default for Mutex { +impl Default for Mutex { fn default() -> Self { Self::new(Default::default()) } diff --git a/src/sync/rwlock.rs b/src/sync/rwlock.rs index 0b4c9f4..60d06b1 100644 --- a/src/sync/rwlock.rs +++ b/src/sync/rwlock.rs @@ -301,7 +301,7 @@ unsafe impl Sync for RwLock {} impl UnwindSafe for RwLock {} impl RefUnwindSafe for RwLock {} -impl Default for RwLock { +impl Default for RwLock { fn default() -> Self { Self::new(Default::default()) }