From 28296a0f6e91bbac2fd1a66f876bf2f5a9426c5f Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Wed, 7 Aug 2019 22:18:26 +0200 Subject: [PATCH] Fix logic bug --- time-cache/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time-cache/src/lib.rs b/time-cache/src/lib.rs index 52bce78..14747c8 100644 --- a/time-cache/src/lib.rs +++ b/time-cache/src/lib.rs @@ -44,7 +44,7 @@ where pub fn clear(&mut self) { 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) -> bool {