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, DB: Database,
{ {
fn try_fetch(&self, db: &DB, key: &Q::Key) -> Result<Q::Value, CycleDetected> { fn try_fetch(&self, db: &DB, key: &Q::Key) -> Result<Q::Value, CycleDetected> {
let slot = match self.slot(key) { let slot = self.slot(key).unwrap_or_else(|| {
Some(s) => s.clone(), panic!("no value set for {:?}({:?})", Q::default(), key)
None => panic!("no value set for {:?}({:?})", Q::default(), key), });
};
let StampedValue { let StampedValue {
value, value,