Skip to content

Commit

Permalink
Merge pull request #183 from jeromefroe/jerome/try-get-or-insert-mut-…
Browse files Browse the repository at this point in the history
…lifetime

Add lifetime specifier to try_get_or_insert_mut
  • Loading branch information
jeromefroe committed Oct 4, 2023
2 parents 56507ba + ef7a112 commit e82039d
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 e82039d

Please sign in to comment.