melib/collection: replace _Ref deref unwraps with expect()

feature/perform-shortcut
Manos Pitsidianakis 2022-10-09 18:28:41 +03:00
parent 129573e0fd
commit 7e09b1807f
1 changed files with 3 additions and 3 deletions

View File

@ -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")
}
}