1
Fork 0

Remove a fishy Clone impl

This commit is contained in:
Oli Scherer 2023-03-14 11:30:23 +00:00
parent 35d06f9c74
commit aad33198ff
4 changed files with 27 additions and 11 deletions

View file

@ -7,11 +7,16 @@ use rustc_data_structures::sync::Lock;
use std::hash::Hash;
#[derive(Clone)]
pub struct Cache<Key, Value> {
hashmap: Lock<FxHashMap<Key, WithDepNode<Value>>>,
}
impl<Key: Clone, Value: Clone> Clone for Cache<Key, Value> {
fn clone(&self) -> Self {
Self { hashmap: Lock::new(self.hashmap.borrow().clone()) }
}
}
impl<Key, Value> Default for Cache<Key, Value> {
fn default() -> Self {
Self { hashmap: Default::default() }