diff --git a/src/input.rs b/src/input.rs index d73dcb8..cb60fa7 100644 --- a/src/input.rs +++ b/src/input.rs @@ -75,10 +75,9 @@ where DB: Database, { fn try_fetch(&self, db: &DB, key: &Q::Key) -> Result { - let slot = match self.slot(key) { - Some(s) => s.clone(), - None => panic!("no value set for {:?}({:?})", Q::default(), key), - }; + let slot = self.slot(key).unwrap_or_else(|| { + panic!("no value set for {:?}({:?})", Q::default(), key) + }); let StampedValue { value,