Skip to content

Commit

Permalink
Fix type constraint for get_or_insert
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromefroe committed Jun 8, 2022
1 parent 6267395 commit 039c4df
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 @@ -478,7 +478,7 @@ impl<K: Hash + Eq, V, S: BuildHasher> LruCache<K, V, S> {
where
F: Fn() -> V,
{
if let Some(node) = self.map.get_mut(&k) {
if let Some(node) = self.map.get_mut(&KeyRef { k: &k }) {
let node_ptr: *mut LruEntry<K, V> = &mut **node;

self.detach(node_ptr);
Expand Down

0 comments on commit 039c4df

Please sign in to comment.