autocommit 2022-01-03 18:56:52 CET
This commit is contained in:
parent
fc887b339e
commit
30376c595c
39 changed files with 3157 additions and 309 deletions
|
|
@ -1,6 +1,7 @@
|
|||
use ahash::AHashMap;
|
||||
use std::cell::{RefCell, RefMut};
|
||||
use std::hash::Hash;
|
||||
use std::mem;
|
||||
|
||||
pub struct CopyHashMap<K, V> {
|
||||
map: RefCell<AHashMap<K, V>>,
|
||||
|
|
@ -40,6 +41,10 @@ impl<K: Eq + Hash, V: Clone> CopyHashMap<K, V> {
|
|||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
self.map.borrow_mut().clear();
|
||||
mem::take(&mut *self.map.borrow_mut());
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.map.borrow().is_empty()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue