Skip to content

Commit

Permalink
Address clippy::multiple_bound_locations
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Mar 25, 2024
1 parent 1104a47 commit b4adf89
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rustls/src/limited_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,26 +78,23 @@ where
}
}

pub(crate) fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V>
pub(crate) fn get<Q: Hash + Eq + ?Sized>(&self, k: &Q) -> Option<&V>
where
K: Borrow<Q>,
Q: Hash + Eq,
{
self.map.get(k)
}

pub(crate) fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut V>
pub(crate) fn get_mut<Q: Hash + Eq + ?Sized>(&mut self, k: &Q) -> Option<&mut V>
where
K: Borrow<Q>,
Q: Hash + Eq,
{
self.map.get_mut(k)
}

pub(crate) fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<V>
pub(crate) fn remove<Q: Hash + Eq + ?Sized>(&mut self, k: &Q) -> Option<V>
where
K: Borrow<Q>,
Q: Hash + Eq,
{
if let Some(value) = self.map.remove(k) {
// O(N) search, followed by O(N) removal
Expand Down

0 comments on commit b4adf89

Please sign in to comment.