mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Stabilize vec_pop_if
This commit is contained in:
@@ -155,7 +155,6 @@
|
||||
#![feature(unicode_internals)]
|
||||
#![feature(unsize)]
|
||||
#![feature(unwrap_infallible)]
|
||||
#![feature(vec_pop_if)]
|
||||
// tidy-alphabetical-end
|
||||
//
|
||||
// Language features:
|
||||
|
||||
@@ -2518,8 +2518,6 @@ pub fn pop(&mut self) -> Option<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(vec_pop_if)]
|
||||
///
|
||||
/// let mut vec = vec![1, 2, 3, 4];
|
||||
/// let pred = |x: &mut i32| *x % 2 == 0;
|
||||
///
|
||||
@@ -2527,7 +2525,7 @@ pub fn pop(&mut self) -> Option<T> {
|
||||
/// assert_eq!(vec, [1, 2, 3]);
|
||||
/// assert_eq!(vec.pop_if(pred), None);
|
||||
/// ```
|
||||
#[unstable(feature = "vec_pop_if", issue = "122741")]
|
||||
#[stable(feature = "vec_pop_if", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub fn pop_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option<T> {
|
||||
let last = self.last_mut()?;
|
||||
if predicate(last) { self.pop() } else { None }
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#![feature(local_waker)]
|
||||
#![feature(str_as_str)]
|
||||
#![feature(strict_provenance_lints)]
|
||||
#![feature(vec_pop_if)]
|
||||
#![feature(vec_deque_pop_if)]
|
||||
#![feature(unique_rc_arc)]
|
||||
#![feature(macro_metavar_expr_concat)]
|
||||
|
||||
Reference in New Issue
Block a user