From 85dd2106bdc3476c0eb73c97f2f4b338a3486749 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Fri, 20 Dec 2024 18:28:08 -0500 Subject: Fix clippy issues --- src/mutex/mutex.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mutex/mutex.rs') diff --git a/src/mutex/mutex.rs b/src/mutex/mutex.rs index d5f7f3a..9707e2f 100644 --- a/src/mutex/mutex.rs +++ b/src/mutex/mutex.rs @@ -1,5 +1,6 @@ +use std::cell::UnsafeCell; use std::fmt::Debug; -use std::{cell::UnsafeCell, marker::PhantomData}; +use std::marker::PhantomData; use lock_api::RawMutex; @@ -66,7 +67,7 @@ impl Debug for Mutex { } } -impl Default for Mutex { +impl Default for Mutex { fn default() -> Self { Self::new(T::default()) } @@ -150,7 +151,7 @@ impl Mutex { /// let key = ThreadKey::get().unwrap(); /// assert_eq!(*mutex.lock(key), 10); /// ``` - pub fn lock<'s, 'k: 's, Key: Keyable>(&'s self, key: Key) -> MutexGuard<'_, 'k, T, Key, R> { + pub fn lock<'s, 'k: 's, Key: Keyable>(&'s self, key: Key) -> MutexGuard<'s, 'k, T, Key, R> { unsafe { self.raw.lock(); @@ -190,7 +191,7 @@ impl Mutex { pub fn try_lock<'s, 'a: 's, 'k: 'a, Key: Keyable>( &'s self, key: Key, - ) -> Option> { + ) -> Option> { if self.raw.try_lock() { // safety: we just locked the mutex Some(unsafe { MutexGuard::new(self, key) }) -- cgit v1.2.3