Rollup merge of #60678 - DutchGhost:master, r=scottmcm
Stabilize vecdeque_rotate This PR stabilizes the vecdeque_rotate feature. r? @scottmcm Closes https://github.com/rust-lang/rust/issues/56686
This commit is contained in:
commit
dc7cbb697b
2 changed files with 2 additions and 7 deletions
|
|
@ -1948,8 +1948,6 @@ impl<T> VecDeque<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(vecdeque_rotate)]
|
||||
///
|
||||
/// use std::collections::VecDeque;
|
||||
///
|
||||
/// let mut buf: VecDeque<_> = (0..10).collect();
|
||||
|
|
@ -1963,7 +1961,7 @@ impl<T> VecDeque<T> {
|
|||
/// }
|
||||
/// assert_eq!(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
||||
/// ```
|
||||
#[unstable(feature = "vecdeque_rotate", issue = "56686")]
|
||||
#[stable(feature = "vecdeque_rotate", since = "1.36.0")]
|
||||
pub fn rotate_left(&mut self, mid: usize) {
|
||||
assert!(mid <= self.len());
|
||||
let k = self.len() - mid;
|
||||
|
|
@ -1993,8 +1991,6 @@ impl<T> VecDeque<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(vecdeque_rotate)]
|
||||
///
|
||||
/// use std::collections::VecDeque;
|
||||
///
|
||||
/// let mut buf: VecDeque<_> = (0..10).collect();
|
||||
|
|
@ -2008,7 +2004,7 @@ impl<T> VecDeque<T> {
|
|||
/// }
|
||||
/// assert_eq!(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
||||
/// ```
|
||||
#[unstable(feature = "vecdeque_rotate", issue = "56686")]
|
||||
#[stable(feature = "vecdeque_rotate", since = "1.36.0")]
|
||||
pub fn rotate_right(&mut self, k: usize) {
|
||||
assert!(k <= self.len());
|
||||
let mid = self.len() - k;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue