]> git.lizzy.rs Git - rust.git/commitdiff
std: Stabilize vec_map::Entry::or_insert{,_with}
authorAlex Crichton <alex@alexcrichton.com>
Thu, 11 Jun 2015 18:15:19 +0000 (11:15 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 17 Jun 2015 16:07:17 +0000 (09:07 -0700)
These functions mirror the other Entry APIs of other maps, and were mistakenly
just not stabilized the first time around.

src/libcollections/vec_map.rs

index 98ecd045b9ace39a3817d4813d57e3ccaeffffe4..685bb5dc4b4f397140f4914fd370d1bcb9a1e900 100644 (file)
@@ -646,10 +646,9 @@ pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, V>> {
         }
     }
 
-    #[unstable(feature = "entry",
-               reason = "matches entry v3 specification, waiting for dust to settle")]
-    /// Ensures a value is in the entry by inserting the default if empty, and returns
-    /// a mutable reference to the value in the entry.
+    #[stable(feature = "vecmap_entry", since = "1.2.0")]
+    /// Ensures a value is in the entry by inserting the default if empty, and
+    /// returns a mutable reference to the value in the entry.
     pub fn or_insert(self, default: V) -> &'a mut V {
         match self {
             Occupied(entry) => entry.into_mut(),
@@ -657,10 +656,10 @@ pub fn or_insert(self, default: V) -> &'a mut V {
         }
     }
 
-    #[unstable(feature = "entry",
-               reason = "matches entry v3 specification, waiting for dust to settle")]
-    /// Ensures a value is in the entry by inserting the result of the default function if empty,
-    /// and returns a mutable reference to the value in the entry.
+    #[stable(feature = "vecmap_entry", since = "1.2.0")]
+    /// Ensures a value is in the entry by inserting the result of the default
+    /// function if empty, and returns a mutable reference to the value in the
+    /// entry.
     pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {
         match self {
             Occupied(entry) => entry.into_mut(),