diff options
| author | Stepan Koltsov <stepan.koltsov@gmail.com> | 2013-08-03 05:54:05 +0400 |
|---|---|---|
| committer | Stepan Koltsov <stepan.koltsov@gmail.com> | 2013-08-03 05:54:05 +0400 |
| commit | cf9e9b21d59eaf6f4d57904ef882a654caa37085 (patch) | |
| tree | 58a993b3762edb78f849bfd871f60339089d49a7 /src/libstd/hashmap.rs | |
| parent | 3ddc72f69be4d0a2027ff598ad262ea2b2ca3812 (diff) | |
Add default implementation of Map::contains_key function
Map::contains_key can be implemented with Map::find. Remove several implementations of contains_key.
Diffstat (limited to 'src/libstd/hashmap.rs')
| -rw-r--r-- | src/libstd/hashmap.rs | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/libstd/hashmap.rs b/src/libstd/hashmap.rs index e7d51106c58..424a6884d94 100644 --- a/src/libstd/hashmap.rs +++ b/src/libstd/hashmap.rs @@ -292,14 +292,6 @@ impl<K:Hash + Eq,V> Mutable for HashMap<K, V> { } impl<K:Hash + Eq,V> Map<K, V> for HashMap<K, V> { - /// Return true if the map contains a value for the specified key - fn contains_key(&self, k: &K) -> bool { - match self.bucket_for_key(k) { - FoundEntry(_) => {true} - TableFull | FoundHole(_) => {false} - } - } - /// Return a reference to the value corresponding to the key fn find<'a>(&'a self, k: &K) -> Option<&'a V> { match self.bucket_for_key(k) { |
