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/poisonable/error.rs | 6 +++--- src/poisonable/guard.rs | 30 +++++++++++++----------------- 2 files changed, 16 insertions(+), 20 deletions(-) (limited to 'src/poisonable') diff --git a/src/poisonable/error.rs b/src/poisonable/error.rs index 61f0f94..9e84693 100644 --- a/src/poisonable/error.rs +++ b/src/poisonable/error.rs @@ -141,7 +141,7 @@ impl> PoisonError { } } -impl<'flag, 'key, G, Key> fmt::Debug for TryLockPoisonableError<'flag, 'key, G, Key> { +impl fmt::Debug for TryLockPoisonableError<'_, '_, G, Key> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { Self::Poisoned(..) => "Poisoned(..)".fmt(f), @@ -150,7 +150,7 @@ impl<'flag, 'key, G, Key> fmt::Debug for TryLockPoisonableError<'flag, 'key, G, } } -impl<'flag, 'key, G, Key> fmt::Display for TryLockPoisonableError<'flag, 'key, G, Key> { +impl fmt::Display for TryLockPoisonableError<'_, '_, G, Key> { #[cfg_attr(test, mutants::skip)] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { @@ -161,7 +161,7 @@ impl<'flag, 'key, G, Key> fmt::Display for TryLockPoisonableError<'flag, 'key, G } } -impl<'flag, 'key, G, Key> Error for TryLockPoisonableError<'flag, 'key, G, Key> {} +impl Error for TryLockPoisonableError<'_, '_, G, Key> {} impl<'flag, 'key, G, Key> From>> for TryLockPoisonableError<'flag, 'key, G, Key> diff --git a/src/poisonable/guard.rs b/src/poisonable/guard.rs index d1913bf..30a9b70 100644 --- a/src/poisonable/guard.rs +++ b/src/poisonable/guard.rs @@ -19,7 +19,7 @@ impl<'a, Guard> PoisonRef<'a, Guard> { } } -impl<'flag, Guard> Drop for PoisonRef<'flag, Guard> { +impl Drop for PoisonRef<'_, Guard> { fn drop(&mut self) { #[cfg(panic = "unwind")] if std::thread::panicking() { @@ -28,19 +28,19 @@ impl<'flag, Guard> Drop for PoisonRef<'flag, Guard> { } } -impl<'flag, Guard: Debug> Debug for PoisonRef<'flag, Guard> { +impl Debug for PoisonRef<'_, Guard> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&**self, f) } } -impl<'flag, Guard: Display> Display for PoisonRef<'flag, Guard> { +impl Display for PoisonRef<'_, Guard> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Display::fmt(&**self, f) } } -impl<'flag, Guard> Deref for PoisonRef<'flag, Guard> { +impl Deref for PoisonRef<'_, Guard> { type Target = Guard; fn deref(&self) -> &Self::Target { @@ -48,39 +48,37 @@ impl<'flag, Guard> Deref for PoisonRef<'flag, Guard> { } } -impl<'flag, Guard> DerefMut for PoisonRef<'flag, Guard> { +impl DerefMut for PoisonRef<'_, Guard> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.guard } } -impl<'flag, Guard> AsRef for PoisonRef<'flag, Guard> { +impl AsRef for PoisonRef<'_, Guard> { fn as_ref(&self) -> &Guard { &self.guard } } -impl<'flag, Guard> AsMut for PoisonRef<'flag, Guard> { +impl AsMut for PoisonRef<'_, Guard> { fn as_mut(&mut self) -> &mut Guard { &mut self.guard } } -impl<'flag, 'key, Guard: Debug, Key: Keyable> Debug for PoisonGuard<'flag, 'key, Guard, Key> { +impl Debug for PoisonGuard<'_, '_, Guard, Key> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Debug::fmt(&self.guard, f) } } -impl<'flag, 'key, Guard: Display, Key: Keyable> Display for PoisonGuard<'flag, 'key, Guard, Key> { +impl Display for PoisonGuard<'_, '_, Guard, Key> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { Display::fmt(&self.guard, f) } } -impl<'flag, 'key, T, Guard: Deref, Key: Keyable> Deref - for PoisonGuard<'flag, 'key, Guard, Key> -{ +impl, Key: Keyable> Deref for PoisonGuard<'_, '_, Guard, Key> { type Target = T; fn deref(&self) -> &Self::Target { @@ -89,22 +87,20 @@ impl<'flag, 'key, T, Guard: Deref, Key: Keyable> Deref } } -impl<'flag, 'key, T, Guard: DerefMut, Key: Keyable> DerefMut - for PoisonGuard<'flag, 'key, Guard, Key> -{ +impl, Key: Keyable> DerefMut for PoisonGuard<'_, '_, Guard, Key> { fn deref_mut(&mut self) -> &mut Self::Target { #[allow(clippy::explicit_auto_deref)] // fixing this results in a compiler error &mut *self.guard.guard } } -impl<'flag, 'key, Guard, Key: Keyable> AsRef for PoisonGuard<'flag, 'key, Guard, Key> { +impl AsRef for PoisonGuard<'_, '_, Guard, Key> { fn as_ref(&self) -> &Guard { &self.guard.guard } } -impl<'flag, 'key, Guard, Key: Keyable> AsMut for PoisonGuard<'flag, 'key, Guard, Key> { +impl AsMut for PoisonGuard<'_, '_, Guard, Key> { fn as_mut(&mut self) -> &mut Guard { &mut self.guard.guard } -- cgit v1.2.3