diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-03-04 16:46:41 +0100 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2021-03-04 16:46:41 +0100 |
| commit | 1aedb4c3a38b099a127c3fd3815400b3d0098475 (patch) | |
| tree | 89201fc6e0d1ca0c2a64a881830d858cd4b28346 /library/std | |
| parent | da01455813f8887d7c709f8c37bff9dcbbce34c3 (diff) | |
| download | rust-1aedb4c3a38b099a127c3fd3815400b3d0098475.tar.gz rust-1aedb4c3a38b099a127c3fd3815400b3d0098475.zip | |
Remove unnecessary bound from HashMap::try_insert.
Diffstat (limited to 'library/std')
| -rw-r--r-- | library/std/src/collections/hash/map.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/library/std/src/collections/hash/map.rs b/library/std/src/collections/hash/map.rs index 24333fb5724..cd6787cf588 100644 --- a/library/std/src/collections/hash/map.rs +++ b/library/std/src/collections/hash/map.rs @@ -868,10 +868,7 @@ where /// assert_eq!(err.value, "b"); /// ``` #[unstable(feature = "map_try_insert", issue = "none")] - pub fn try_insert(&mut self, key: K, value: V) -> Result<&mut V, OccupiedError<'_, K, V>> - where - K: Ord, - { + pub fn try_insert(&mut self, key: K, value: V) -> Result<&mut V, OccupiedError<'_, K, V>> { match self.entry(key) { Occupied(entry) => Err(OccupiedError { entry, value }), Vacant(entry) => Ok(entry.insert(value)), |
