mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
container: inline contains_key default method
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user