diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-06-09 14:39:23 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-06-17 09:06:59 -0700 |
| commit | d444d0c357e85c90e73585520e2da74304c7265a (patch) | |
| tree | b64c15147beeccf6cd62eb019d76b16dc5260e22 /src/libcollections/vec_map.rs | |
| parent | c44f5399e4dd2f9d55e107d365d6fe98f6491dc9 (diff) | |
| download | rust-d444d0c357e85c90e73585520e2da74304c7265a.tar.gz rust-d444d0c357e85c90e73585520e2da74304c7265a.zip | |
collections: Split the `collections` feature
This commit also deprecates the `as_string` and `as_slice` free functions in the `string` and `vec` modules.
Diffstat (limited to 'src/libcollections/vec_map.rs')
| -rw-r--r-- | src/libcollections/vec_map.rs | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/libcollections/vec_map.rs b/src/libcollections/vec_map.rs index 5c2f5759604..3fd2455a004 100644 --- a/src/libcollections/vec_map.rs +++ b/src/libcollections/vec_map.rs @@ -12,6 +12,8 @@ //! are O(highest integer key). #![allow(missing_docs)] +#![unstable(feature = "vecmap", + reason = "may not be stabilized in the standard library")] use self::Entry::*; @@ -325,7 +327,7 @@ impl<V> VecMap<V> { /// assert_eq!(a[3], "c"); /// assert_eq!(a[4], "d"); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "append", reason = "recently added as part of collections reform 2")] pub fn append(&mut self, other: &mut Self) { self.extend(other.drain()); @@ -358,7 +360,7 @@ impl<V> VecMap<V> { /// assert_eq!(b[3], "c"); /// assert_eq!(b[4], "d"); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "split_off", reason = "recently added as part of collections reform 2")] pub fn split_off(&mut self, at: usize) -> Self { let mut other = VecMap::new(); @@ -410,7 +412,7 @@ impl<V> VecMap<V> { /// /// assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]); /// ``` - #[unstable(feature = "collections", + #[unstable(feature = "drain", reason = "matches collection reform specification, waiting for dust to settle")] pub fn drain<'a>(&'a mut self) -> Drain<'a, V> { fn filter<A>((i, v): (usize, Option<A>)) -> Option<(usize, A)> { @@ -632,7 +634,7 @@ impl<V> VecMap<V> { impl<'a, V> Entry<'a, V> { - #[unstable(feature = "collections", + #[unstable(feature = "entry", reason = "will soon be replaced by or_insert")] #[deprecated(since = "1.0", reason = "replaced with more ergonomic `or_insert` and `or_insert_with`")] @@ -644,7 +646,7 @@ impl<'a, V> Entry<'a, V> { } } - #[unstable(feature = "collections", + #[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. @@ -655,7 +657,7 @@ impl<'a, V> Entry<'a, V> { } } - #[unstable(feature = "collections", + #[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. @@ -1003,14 +1005,14 @@ pub struct IntoIter<V> { fn((usize, Option<V>)) -> Option<(usize, V)>> } -#[unstable(feature = "collections")] +#[unstable(feature = "drain")] pub struct Drain<'a, V:'a> { iter: FilterMap< Enumerate<vec::Drain<'a, Option<V>>>, fn((usize, Option<V>)) -> Option<(usize, V)>> } -#[unstable(feature = "collections")] +#[unstable(feature = "drain")] impl<'a, V> Iterator for Drain<'a, V> { type Item = (usize, V); @@ -1018,7 +1020,7 @@ impl<'a, V> Iterator for Drain<'a, V> { fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() } } -#[unstable(feature = "collections")] +#[unstable(feature = "drain")] impl<'a, V> DoubleEndedIterator for Drain<'a, V> { fn next_back(&mut self) -> Option<(usize, V)> { self.iter.next_back() } } |
