diff options
Diffstat (limited to 'ecs/src/lock.rs')
-rw-r--r-- | ecs/src/lock.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ecs/src/lock.rs b/ecs/src/lock.rs index 77213c9..fbc6842 100644 --- a/ecs/src/lock.rs +++ b/ecs/src/lock.rs @@ -1,6 +1,6 @@ use std::mem::transmute; use std::ops::{Deref, DerefMut}; -use std::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard, TryLockError}; +use std::sync::{PoisonError, RwLock, RwLockReadGuard, RwLockWriteGuard, TryLockError}; use crate::type_name::TypeName; @@ -62,7 +62,7 @@ where { self.inner .into_inner() - .unwrap_or_else(|err| err.into_inner()) + .unwrap_or_else(PoisonError::into_inner) } } @@ -90,6 +90,7 @@ where /// # Safety /// The returned `ReadGuard` must **NOT** be used for longer than the original /// lifetime. + #[must_use] pub unsafe fn upgrade_lifetime<'new>(self) -> ReadGuard<'new, Value> { unsafe { transmute(self) } |