criteria: clear maps at shutdown
This commit is contained in:
parent
d1b84ee0a2
commit
e28b1b5646
5 changed files with 51 additions and 0 deletions
|
|
@ -56,6 +56,10 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
self.data.borrow_mut().clear();
|
||||
}
|
||||
|
||||
pub fn get_or_create(&self, target: &Target, default: impl FnOnce() -> T) -> RefMut<T> {
|
||||
RefMut::map(self.data.borrow_mut(), |d| {
|
||||
&mut d
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue