Stabilize Option::take_if
This commit is contained in:
parent
50297bb417
commit
26dc8bd5b0
@ -23,7 +23,6 @@
|
||||
#![feature(extract_if)]
|
||||
#![feature(if_let_guard)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(option_take_if)]
|
||||
#![feature(never_type)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![recursion_limit = "512"] // For rustdoc
|
||||
|
@ -1708,8 +1708,6 @@ pub const fn take(&mut self) -> Option<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(option_take_if)]
|
||||
///
|
||||
/// let mut x = Some(42);
|
||||
///
|
||||
/// let prev = x.take_if(|v| if *v == 42 {
|
||||
@ -1726,7 +1724,7 @@ pub const fn take(&mut self) -> Option<T> {
|
||||
/// assert_eq!(prev, Some(43));
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "option_take_if", issue = "98934")]
|
||||
#[stable(feature = "option_take_if", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub fn take_if<P>(&mut self, predicate: P) -> Option<T>
|
||||
where
|
||||
P: FnOnce(&mut T) -> bool,
|
||||
|
Loading…
Reference in New Issue
Block a user