Remove Cache::clear.
It's unused. And it's nice to remove this function that didn't behave like normal `clear` does, as the comment explained.
This commit is contained in:
parent
0932068b6c
commit
0420a2e864
1 changed files with 0 additions and 7 deletions
|
|
@ -23,13 +23,6 @@ impl<Key, Value> Default for Cache<Key, Value> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<Key, Value> Cache<Key, Value> {
|
||||
/// Actually frees the underlying memory in contrast to what stdlib containers do on `clear`
|
||||
pub fn clear(&self) {
|
||||
*self.hashmap.borrow_mut() = Default::default();
|
||||
}
|
||||
}
|
||||
|
||||
impl<Key: Eq + Hash, Value: Clone> Cache<Key, Value> {
|
||||
pub fn get<Tcx: DepContext>(&self, key: &Key, tcx: Tcx) -> Option<Value> {
|
||||
Some(self.hashmap.borrow().get(key)?.get(tcx))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue