sorted_map: add contains_key function
This commit is contained in:
parent
08c6bda3ee
commit
5b6401f09d
1 changed files with 8 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue