mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-02-08 21:35:47 +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 {
|
fn durability(&self, _db: &DB, key: &Q::Key) -> Durability {
|
||||||
self.slot(key)
|
match self.slot(key) {
|
||||||
.map(|slot| slot.stamped_value.read().durability)
|
Some(slot) => slot.stamped_value.read().durability,
|
||||||
.unwrap_or(Durability::LOW)
|
None => panic!("no value set for {:?}({:?})", Q::default(), key),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn entries<C>(&self, _db: &DB) -> C
|
fn entries<C>(&self, _db: &DB) -> C
|
||||||
|
|
Loading…
Reference in a new issue