mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-02 00:07:42 +03:00
sorted_map: add contains_key function
This commit is contained in:
@@ -260,6 +260,14 @@ fn range_slice_indices<R>(&self, range: R) -> (usize, usize)
|
||||
|
||||
(start, end)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn contains_key<Q>(&self, key: &Q) -> bool
|
||||
where K: Borrow<Q>,
|
||||
Q: Ord + ?Sized
|
||||
{
|
||||
self.get(key).is_some()
|
||||
}
|
||||
}
|
||||
|
||||
impl<K: Ord, V> IntoIterator for SortedMap<K, V> {
|
||||
|
||||
Reference in New Issue
Block a user