diff --git a/src/cached.rs b/src/cached.rs index b9b0ba2fc0..0cea7c6bf1 100644 --- a/src/cached.rs +++ b/src/cached.rs @@ -68,7 +68,7 @@ impl Cached { /// Moves the value from `Self::Used` to `Self::Unused`. pub fn set_unused(&mut self) { if matches!(*self, Self::Used(_)) { - *self = Self::Unused(self.take_used().unwrap()); + *self = Self::Unused(self.take_used().expect("cached value should be used")); } }