diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-06-10 18:33:55 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-06-17 09:07:16 -0700 |
| commit | f85c4f62d8e3f703f9d7c801b982d5cd5afbd081 (patch) | |
| tree | f5e97a71bb2e41d918842c1c785d5f65b3ef6355 | |
| parent | cdb69e2747e41db25d64cf77e99721e9134aa5b7 (diff) | |
| download | rust-f85c4f62d8e3f703f9d7c801b982d5cd5afbd081.tar.gz rust-f85c4f62d8e3f703f9d7c801b982d5cd5afbd081.zip | |
std: Deprecate all permutation-related slice methods
These methods have been unstable for quite some time, and it's not clear that these should remain in the standard library.
| -rw-r--r-- | src/libcollections/slice.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index be678d4a55c..7d74f83552d 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -872,6 +872,7 @@ impl<T> [T] { /// assert_eq!(Some(vec![3, 1, 2]), perms.next()); /// ``` #[unstable(feature = "permutations")] + #[deprecated(since = "1.2.0", reason = "not clear this should be in the stdlib")] #[inline] pub fn permutations(&self) -> Permutations<T> where T: Clone { // NB see hack module in this file @@ -897,6 +898,7 @@ impl<T> [T] { /// ``` #[unstable(feature = "permutations", reason = "uncertain if this merits inclusion in std")] + #[deprecated(since = "1.2.0", reason = "not clear this should be in the stdlib")] pub fn next_permutation(&mut self) -> bool where T: Ord { core_slice::SliceExt::next_permutation(self) } @@ -920,6 +922,7 @@ impl<T> [T] { /// ``` #[unstable(feature = "permutations", reason = "uncertain if this merits inclusion in std")] + #[deprecated(since = "1.2.0", reason = "not clear this should be in the stdlib")] pub fn prev_permutation(&mut self) -> bool where T: Ord { core_slice::SliceExt::prev_permutation(self) } @@ -1066,6 +1069,7 @@ impl<T: Clone, V: Borrow<[T]>> SliceConcatExt<T> for [V] { /// sequence to its initial order. #[unstable(feature = "permutations")] #[derive(Clone)] +#[deprecated(since = "1.2.0", reason = "not clear this should be in the stdlib")] pub struct ElementSwaps { sdir: Vec<SizeDirection>, /// If `true`, emit the last swap that returns the sequence to initial @@ -1077,6 +1081,7 @@ pub struct ElementSwaps { impl ElementSwaps { /// Creates an `ElementSwaps` iterator for a sequence of `length` elements. #[unstable(feature = "permutations")] + #[deprecated(since = "1.2.0", reason = "not clear this should be in the stdlib")] pub fn new(length: usize) -> ElementSwaps { // Initialize `sdir` with a direction that position should move in // (all negative at the beginning) and the `size` of the @@ -1199,6 +1204,7 @@ impl Iterator for ElementSwaps { /// /// Generates even and odd permutations alternately. #[unstable(feature = "permutations")] +#[deprecated(since = "1.2.0", reason = "not clear this should be in the stdlib")] pub struct Permutations<T> { swaps: ElementSwaps, v: Vec<T>, |
