Skip to content

Commit

Permalink
Make contains take &self instead of &mut self
Browse files Browse the repository at this point in the history
  • Loading branch information
marmeladema committed May 2, 2024
1 parent df3d119 commit 4ffa7b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ impl<K: Clone + Eq + Hash, V, S: BuildHasher, W: WeightScale<K, V>> CLruCache<K,
}

/// Returns a bool indicating whether the given key is in the cache.
/// Does not update the LRU list.
pub fn contains<Q>(&mut self, key: &Q) -> bool
/// Like `peek`, `contains` does not update the LRU list so the key's position will be unchanged.
pub fn contains<Q>(&self, key: &Q) -> bool
where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
Expand Down

0 comments on commit 4ffa7b5

Please sign in to comment.