Remove unnecessary bound from HashMap::try_insert.

This commit is contained in:
Mara Bos 2021-03-04 16:46:41 +01:00
parent da01455813
commit 1aedb4c3a3
1 changed files with 1 additions and 4 deletions

View File

@ -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)),