From 7e09b1807ffa9bae54da35b02c83b5aaee455819 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Sun, 9 Oct 2022 18:28:41 +0300 Subject: melib/collection: replace _Ref deref unwraps with expect() --- melib/src/collection.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/melib/src/collection.rs b/melib/src/collection.rs index ea910d13..f686dcec 100644 --- a/melib/src/collection.rs +++ b/melib/src/collection.rs @@ -475,7 +475,7 @@ impl Deref for RwRef<'_, K, V> { type Target = V; fn deref(&self) -> &V { - self.guard.get(&self.hash).unwrap() + self.guard.get(&self.hash).expect("Hash was not found") } } @@ -486,7 +486,7 @@ pub struct RwRefMut<'g, K: std::cmp::Eq + std::hash::Hash, V> { impl DerefMut for RwRefMut<'_, K, V> { fn deref_mut(&mut self) -> &mut V { - self.guard.get_mut(&self.hash).unwrap() + self.guard.get_mut(&self.hash).expect("Hash was not found") } } @@ -494,6 +494,6 @@ impl Deref for RwRefMut<'_, K, V> { type Target = V; fn deref(&self) -> &V { - self.guard.get(&self.hash).unwrap() + self.guard.get(&self.hash).expect("Hash was not found") } } -- cgit v1.2.3