Skip to content

Commit

Permalink
Add lifetime specifier to try_get_or_insert_mut
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromefroe committed Oct 4, 2023
1 parent 56507ba commit ef7a112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ impl<K: Hash + Eq, V, S: BuildHasher> LruCache<K, V, S> {
/// 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<V, E>,
{
Expand Down

0 comments on commit ef7a112

Please sign in to comment.