1
0
Fork 0
forked from wry/wry

criteria: clear maps at shutdown

This commit is contained in:
Julian Orth 2025-07-18 23:42:16 +02:00
parent d1b84ee0a2
commit e28b1b5646
5 changed files with 51 additions and 0 deletions

View file

@ -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