Merge pull request #183 from matklad/no-clone

remove needless clone
This commit is contained in:
Niko Matsakis 2019-08-15 07:01:34 -04:00 committed by GitHub
commit ae9ab75384
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,10 +75,9 @@ where
DB: Database,
{
fn try_fetch(&self, db: &DB, key: &Q::Key) -> Result<Q::Value, CycleDetected> {
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,