summaryrefslogtreecommitdiff
path: root/src/poisonable
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2024-12-20 18:28:08 -0500
committerBotahamec <botahamec@outlook.com>2024-12-20 18:28:08 -0500
commit85dd2106bdc3476c0eb73c97f2f4b338a3486749 (patch)
tree096e5fd71a67949bbf45a0e79f2357d64acb96d6 /src/poisonable
parent6514ffc5b33962c98fe9ce8f123edca6c57668d8 (diff)
Fix clippy issues
Diffstat (limited to 'src/poisonable')
-rw-r--r--src/poisonable/error.rs6
-rw-r--r--src/poisonable/guard.rs30
2 files changed, 16 insertions, 20 deletions
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<T, Guard: DerefMut<Target = T>> PoisonError<Guard> {
}
}
-impl<'flag, 'key, G, Key> fmt::Debug for TryLockPoisonableError<'flag, 'key, G, Key> {
+impl<G, Key> 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<G, Key> 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<G, Key> Error for TryLockPoisonableError<'_, '_, G, Key> {}
impl<'flag, 'key, G, Key> From<PoisonError<PoisonGuard<'flag, 'key, G, Key>>>
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<Guard> 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<Guard: Debug> 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<Guard: Display> 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<Guard> 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<Guard> DerefMut for PoisonRef<'_, Guard> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.guard
}
}
-impl<'flag, Guard> AsRef<Guard> for PoisonRef<'flag, Guard> {
+impl<Guard> AsRef<Guard> for PoisonRef<'_, Guard> {
fn as_ref(&self) -> &Guard {
&self.guard
}
}
-impl<'flag, Guard> AsMut<Guard> for PoisonRef<'flag, Guard> {
+impl<Guard> AsMut<Guard> 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<Guard: Debug, Key: Keyable> 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<Guard: Display, Key: Keyable> 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<Target = T>, Key: Keyable> Deref
- for PoisonGuard<'flag, 'key, Guard, Key>
-{
+impl<T, Guard: Deref<Target = T>, 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<Target = T>, Key: Keyable> Deref
}
}
-impl<'flag, 'key, T, Guard: DerefMut<Target = T>, Key: Keyable> DerefMut
- for PoisonGuard<'flag, 'key, Guard, Key>
-{
+impl<T, Guard: DerefMut<Target = T>, 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<Guard> for PoisonGuard<'flag, 'key, Guard, Key> {
+impl<Guard, Key: Keyable> AsRef<Guard> for PoisonGuard<'_, '_, Guard, Key> {
fn as_ref(&self) -> &Guard {
&self.guard.guard
}
}
-impl<'flag, 'key, Guard, Key: Keyable> AsMut<Guard> for PoisonGuard<'flag, 'key, Guard, Key> {
+impl<Guard, Key: Keyable> AsMut<Guard> for PoisonGuard<'_, '_, Guard, Key> {
fn as_mut(&mut self) -> &mut Guard {
&mut self.guard.guard
}