Skip to content

Commit

Permalink
Add tracking issue for map_try_insert.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Mar 4, 2021
1 parent ffdd2aa commit 40edf6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ impl<K, V> BTreeMap<K, V> {
/// assert_eq!(err.entry.get(), &"a");
/// assert_eq!(err.value, "b");
/// ```
#[unstable(feature = "map_try_insert", issue = "none")]
#[unstable(feature = "map_try_insert", issue = "82766")]
pub fn try_insert(&mut self, key: K, value: V) -> Result<&mut V, OccupiedError<'_, K, V>>
where
K: Ord,
Expand Down
6 changes: 3 additions & 3 deletions collections/btree/map/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ impl<K: Debug + Ord, V: Debug> Debug for OccupiedEntry<'_, K, V> {
/// The error returned by [`try_insert`](BTreeMap::try_insert) when the key already exists.
///
/// Contains the occupied entry, and the value that was not inserted.
#[unstable(feature = "map_try_insert", issue = "none")]
#[unstable(feature = "map_try_insert", issue = "82766")]
pub struct OccupiedError<'a, K: 'a, V: 'a> {
/// The entry in the map that was already occupied.
pub entry: OccupiedEntry<'a, K, V>,
/// The value which was not inserted, because the entry was already occupied.
pub value: V,
}

#[unstable(feature = "map_try_insert", issue = "none")]
#[unstable(feature = "map_try_insert", issue = "82766")]
impl<K: Debug + Ord, V: Debug> Debug for OccupiedError<'_, K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("OccupiedError")
Expand All @@ -93,7 +93,7 @@ impl<K: Debug + Ord, V: Debug> Debug for OccupiedError<'_, K, V> {
}
}

#[unstable(feature = "map_try_insert", issue = "none")]
#[unstable(feature = "map_try_insert", issue = "82766")]
impl<'a, K: Debug + Ord, V: Debug> fmt::Display for OccupiedError<'a, K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
Expand Down

0 comments on commit 40edf6c

Please sign in to comment.