From e6076e6bebee7c8af43486eb0169dd1d486b468f Mon Sep 17 00:00:00 2001 From: minish Date: Tue, 13 Jun 2023 18:05:13 -0400 Subject: [PATCH] refactor(archived): change to match --- archived/src/lib.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/archived/src/lib.rs b/archived/src/lib.rs index 384e806..00003bd 100644 --- a/archived/src/lib.rs +++ b/archived/src/lib.rs @@ -138,14 +138,13 @@ impl Archive { let entry = self.cache_table.get_mut(key); - if entry.is_some() { - let mut entry = entry.unwrap(); + match entry { + Some(entry) => { + entry.expiration_time = now + self.entry_lifetime; - entry.expiration_time = now + self.entry_lifetime; - - return Some(()); - } else { - return None; + Some(()) + } + None => None } }