1
0
Fork 0
forked from wry/wry

autocommit 2022-01-08 18:38:24 CET

This commit is contained in:
Julian Orth 2022-01-08 18:38:24 +01:00
parent 33549184d4
commit d061a5c313
38 changed files with 179 additions and 371 deletions

View file

@ -28,14 +28,6 @@ impl<K: Eq + Hash, V: Clone> CopyHashMap<K, V> {
self.map.borrow_mut().get(k).cloned()
}
pub fn get_or_insert_default(&self, k: K) -> V
where
V: Default,
{
let mut map = self.map.borrow_mut();
map.entry(k).or_insert_with(|| Default::default()).clone()
}
pub fn remove(&self, k: &K) -> Option<V> {
self.map.borrow_mut().remove(k)
}