summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2022-10-09 18:28:41 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2022-10-09 18:28:41 +0300
commit7e09b1807ffa9bae54da35b02c83b5aaee455819 (patch)
treec371c1aa718d925c41c3871621e444f86a699398
parent129573e0fd9b42ebf14c2de176e65b92bf8479bd (diff)
downloadmeli-7e09b1807ffa9bae54da35b02c83b5aaee455819.zip
melib/collection: replace _Ref deref unwraps with expect()
-rw-r--r--melib/src/collection.rs6
1 files 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<K: std::cmp::Eq + std::hash::Hash, V> 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<K: std::cmp::Eq + std::hash::Hash, V> 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<K: std::cmp::Eq + std::hash::Hash, V> 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")
}
}