From 4ba03be97e6cc7e790bbc9bfc18caaa228c8a262 Mon Sep 17 00:00:00 2001 From: Botahamec Date: Fri, 28 Feb 2025 16:09:11 -0500 Subject: Scoped lock API --- src/poisonable/error.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/poisonable/error.rs') diff --git a/src/poisonable/error.rs b/src/poisonable/error.rs index bff011d..b69df5d 100644 --- a/src/poisonable/error.rs +++ b/src/poisonable/error.rs @@ -109,7 +109,7 @@ impl PoisonError { /// /// let key = ThreadKey::get().unwrap(); /// let p_err = mutex.lock(key).unwrap_err(); - /// let data: &PoisonGuard<_, _> = p_err.get_ref(); + /// let data: &PoisonGuard<_> = p_err.get_ref(); /// println!("recovered {} items", data.len()); /// ``` #[must_use] @@ -154,7 +154,7 @@ impl PoisonError { #[mutants::skip] #[cfg(not(tarpaulin_include))] -impl fmt::Debug for TryLockPoisonableError<'_, '_, G, Key> { +impl fmt::Debug for TryLockPoisonableError<'_, G> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { Self::Poisoned(..) => "Poisoned(..)".fmt(f), @@ -163,7 +163,7 @@ impl fmt::Debug for TryLockPoisonableError<'_, '_, G, Key> { } } -impl fmt::Display for TryLockPoisonableError<'_, '_, G, Key> { +impl fmt::Display for TryLockPoisonableError<'_, G> { #[cfg_attr(test, mutants::skip)] #[cfg(not(tarpaulin_include))] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -175,12 +175,10 @@ impl fmt::Display for TryLockPoisonableError<'_, '_, G, Key> { } } -impl Error for TryLockPoisonableError<'_, '_, G, Key> {} +impl Error for TryLockPoisonableError<'_, G> {} -impl<'flag, 'key, G, Key> From>> - for TryLockPoisonableError<'flag, 'key, G, Key> -{ - fn from(value: PoisonError>) -> Self { +impl<'flag, G> From>> for TryLockPoisonableError<'flag, G> { + fn from(value: PoisonError>) -> Self { Self::Poisoned(value) } } -- cgit v1.2.3