Fix logic bug

This commit is contained in:
Valentin Brandl 2019-08-07 22:18:26 +02:00
parent 4985c497df
commit 28296a0f6e
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -44,7 +44,7 @@ where
pub fn clear(&mut self) { pub fn clear(&mut self) {
let now = Instant::now(); let now = Instant::now();
self.cache.retain(|_, v| !Self::is_valid(now, v)); self.cache.retain(|_, v| Self::is_valid(now, v))
} }
fn is_valid(when: Instant, entry: &CacheEntry<V>) -> bool { fn is_valid(when: Instant, entry: &CacheEntry<V>) -> bool {