mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-02-02 09:46:06 +00:00
make durability helper panic on an undefined key
This commit is contained in:
parent
d4f7e4b2b4
commit
485df37e6f
1 changed files with 4 additions and 3 deletions
|
@ -93,9 +93,10 @@ where
|
|||
}
|
||||
|
||||
fn durability(&self, _db: &DB, key: &Q::Key) -> Durability {
|
||||
self.slot(key)
|
||||
.map(|slot| slot.stamped_value.read().durability)
|
||||
.unwrap_or(Durability::LOW)
|
||||
match self.slot(key) {
|
||||
Some(slot) => slot.stamped_value.read().durability,
|
||||
None => panic!("no value set for {:?}({:?})", Q::default(), key),
|
||||
}
|
||||
}
|
||||
|
||||
fn entries<C>(&self, _db: &DB) -> C
|
||||
|
|
Loading…
Reference in a new issue