From ef7a112570463fb58916f5f463931ead1e9792e0 Mon Sep 17 00:00:00 2001 From: Jerome Froelich Date: Tue, 3 Oct 2023 20:19:03 -0400 Subject: [PATCH] Add lifetime specifier to try_get_or_insert_mut --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 9c6b055..9e11ac4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -633,7 +633,7 @@ impl LruCache { /// assert_eq!(cache.try_get_or_insert_mut(4, b), Ok(&mut "b")); /// assert_eq!(cache.try_get_or_insert_mut(4, a), Ok(&mut "b")); /// ``` - pub fn try_get_or_insert_mut<'a, F, E>(&mut self, k: K, f: F) -> Result<&'a mut V, E> + pub fn try_get_or_insert_mut<'a, F, E>(&'a mut self, k: K, f: F) -> Result<&'a mut V, E> where F: FnOnce() -> Result, {