diff options
Diffstat (limited to 'src/poisonable/guard.rs')
| -rw-r--r-- | src/poisonable/guard.rs | 30 |
1 files changed, 13 insertions, 17 deletions
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 } |
