From 58f29444ac234c285ce0e3a729ade2b52a303f58 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 21 Aug 2024 20:18:37 +0200 Subject: refactor(ecs): fix clippy lints --- ecs/src/lock.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ecs/src/lock.rs') 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) } -- cgit v1.2.3-18-g5258