Skip to content

Commit

Permalink
Clippy lints (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarsko authored Sep 10, 2024
1 parent b62d5e8 commit fa9499c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/future/batch_semaphore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -361,7 +361,6 @@ impl BatchSemaphore {
ExecutionState::with(|s| {
s.update_clock(&state.permits_available.last_acquire);
});
err
});
drop(state);

Expand Down
2 changes: 1 addition & 1 deletion src/sync/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ unsafe impl<T: Send + ?Sized> Sync for Mutex<T> {}
impl<T: ?Sized> UnwindSafe for Mutex<T> {}
impl<T: ?Sized> RefUnwindSafe for Mutex<T> {}

impl<T: Default + ?Sized> Default for Mutex<T> {
impl<T: Default> Default for Mutex<T> {
fn default() -> Self {
Self::new(Default::default())
}
Expand Down
2 changes: 1 addition & 1 deletion src/sync/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ unsafe impl<T: Send + ?Sized> Sync for RwLock<T> {}
impl<T: ?Sized> UnwindSafe for RwLock<T> {}
impl<T: ?Sized> RefUnwindSafe for RwLock<T> {}

impl<T: Default + ?Sized> Default for RwLock<T> {
impl<T: Default> Default for RwLock<T> {
fn default() -> Self {
Self::new(Default::default())
}
Expand Down

0 comments on commit fa9499c

Please sign in to comment.