mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-14 16:03:17 +00:00
sorted_map: add contains_key function
This commit is contained in:
parent
08c6bda3ee
commit
5b6401f09d
@ -260,6 +260,14 @@ impl<K: Ord, V> SortedMap<K, V> {
|
||||
|
||||
(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> {
|
||||
|
Loading…
Reference in New Issue
Block a user