summaryrefslogtreecommitdiff
path: root/ecs/src/lock.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-08-21 20:18:37 +0200
committerHampusM <hampus@hampusmat.com>2024-08-21 20:18:37 +0200
commit58f29444ac234c285ce0e3a729ade2b52a303f58 (patch)
tree03bb210d62bf98acc1ee30ce9df1344d8239f7c6 /ecs/src/lock.rs
parentc3c96f2d7b63d1d7e55f5a9a85da85444089c2a2 (diff)
refactor(ecs): fix clippy lints
Diffstat (limited to 'ecs/src/lock.rs')
-rw-r--r--ecs/src/lock.rs5
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) }