/// # Examples
///
/// ```
- /// #![feature(slice_rotate)]
- ///
/// let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
/// a.rotate_left(2);
/// assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
/// Rotating a subslice:
///
/// ```
- /// #![feature(slice_rotate)]
- ///
/// let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
/// a[1..5].rotate_left(1);
/// assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
- /// ```
- #[unstable(feature = "slice_rotate", issue = "41891")]
+ /// ```
+ #[stable(feature = "slice_rotate", since = "1.26.0")]
pub fn rotate_left(&mut self, mid: usize) {
core_slice::SliceExt::rotate_left(self, mid);
}
- #[unstable(feature = "slice_rotate", issue = "41891")]
- #[rustc_deprecated(since = "", reason = "renamed to `rotate_left`")]
- pub fn rotate(&mut self, mid: usize) {
- core_slice::SliceExt::rotate_left(self, mid);
- }
-
/// Rotates the slice in-place such that the first `self.len() - k`
/// elements of the slice move to the end while the last `k` elements move
/// to the front. After calling `rotate_right`, the element previously at
/// # Examples
///
/// ```
- /// #![feature(slice_rotate)]
- ///
/// let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
/// a.rotate_right(2);
/// assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
/// Rotate a subslice:
///
/// ```
- /// #![feature(slice_rotate)]
- ///
/// let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
/// a[1..5].rotate_right(1);
/// assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
/// ```
- #[unstable(feature = "slice_rotate", issue = "41891")]
+ #[stable(feature = "slice_rotate", since = "1.26.0")]
pub fn rotate_right(&mut self, k: usize) {
core_slice::SliceExt::rotate_right(self, k);
}
#[stable(feature = "core", since = "1.6.0")]
fn ends_with(&self, needle: &[Self::Item]) -> bool where Self::Item: PartialEq;
- #[unstable(feature = "slice_rotate", issue = "41891")]
+ #[stable(feature = "slice_rotate", since = "1.26.0")]
fn rotate_left(&mut self, mid: usize);
- #[unstable(feature = "slice_rotate", issue = "41891")]
+ #[stable(feature = "slice_rotate", since = "1.26.0")]
fn rotate_right(&mut self, k: usize);
#[stable(feature = "clone_from_slice", since = "1.7.0")]