mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
Remove unnecessary bound from HashMap::try_insert.
This commit is contained in:
parent
da01455813
commit
1aedb4c3a3
@ -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…
Reference in New Issue
Block a user