summaryrefslogtreecommitdiff
path: root/src/poisonable/error.rs
diff options
context:
space:
mode:
authorBotahamec <botahamec@outlook.com>2025-02-28 16:09:11 -0500
committerBotahamec <botahamec@outlook.com>2025-02-28 16:09:11 -0500
commit4ba03be97e6cc7e790bbc9bfc18caaa228c8a262 (patch)
treea257184577a93ddf240aba698755c2886188788b /src/poisonable/error.rs
parent4a5ec04a29cba07c5960792528bd66b0f99ee3ee (diff)
Scoped lock API
Diffstat (limited to 'src/poisonable/error.rs')
-rw-r--r--src/poisonable/error.rs14
1 files changed, 6 insertions, 8 deletions
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<Guard> PoisonError<Guard> {
///
/// 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<Guard> PoisonError<Guard> {
#[mutants::skip]
#[cfg(not(tarpaulin_include))]
-impl<G, Key> fmt::Debug for TryLockPoisonableError<'_, '_, G, Key> {
+impl<G> 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<G, Key> fmt::Debug for TryLockPoisonableError<'_, '_, G, Key> {
}
}
-impl<G, Key> fmt::Display for TryLockPoisonableError<'_, '_, G, Key> {
+impl<G> 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<G, Key> fmt::Display for TryLockPoisonableError<'_, '_, G, Key> {
}
}
-impl<G, Key> Error for TryLockPoisonableError<'_, '_, G, Key> {}
+impl<G> Error for TryLockPoisonableError<'_, G> {}
-impl<'flag, 'key, G, Key> From<PoisonError<PoisonGuard<'flag, 'key, G, Key>>>
- for TryLockPoisonableError<'flag, 'key, G, Key>
-{
- fn from(value: PoisonError<PoisonGuard<'flag, 'key, G, Key>>) -> Self {
+impl<'flag, G> From<PoisonError<PoisonGuard<'flag, G>>> for TryLockPoisonableError<'flag, G> {
+ fn from(value: PoisonError<PoisonGuard<'flag, G>>) -> Self {
Self::Poisoned(value)
}
}