container: inline contains_key default method
This commit is contained in:
parent
0bc1ca4045
commit
2bc999a636
1 changed files with 1 additions and 0 deletions
|
|
@ -38,6 +38,7 @@ pub trait Map<K, V>: Container {
|
|||
fn find<'a>(&'a self, key: &K) -> Option<&'a V>;
|
||||
|
||||
/// Return true if the map contains a value for the specified key
|
||||
#[inline]
|
||||
fn contains_key(&self, key: &K) -> bool {
|
||||
self.find(key).is_some()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue