Remove unnecessary bound from HashMap::try_insert.
This commit is contained in:
parent
da01455813
commit
1aedb4c3a3
1 changed files with 1 additions and 4 deletions
|
@ -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)),
|
||||
|
|
Loading…
Add table
Reference in a new issue