Stabilize the Option::replace
method
This commit is contained in:
parent
ef5c00d0ca
commit
8c01c225ce
@ -867,8 +867,6 @@ impl<T> Option<T> {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(option_replace)]
|
||||
///
|
||||
/// let mut x = Some(2);
|
||||
/// let old = x.replace(5);
|
||||
/// assert_eq!(x, Some(5));
|
||||
@ -880,7 +878,7 @@ impl<T> Option<T> {
|
||||
/// assert_eq!(old, None);
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "option_replace", issue = "51998")]
|
||||
#[stable(feature = "option_replace", since = "1.30.0")]
|
||||
pub fn replace(&mut self, value: T) -> Option<T> {
|
||||
mem::replace(self, Some(value))
|
||||
}
|
||||
|
@ -39,7 +39,6 @@
|
||||
#![feature(reverse_bits)]
|
||||
#![feature(inner_deref)]
|
||||
#![feature(slice_internals)]
|
||||
#![feature(option_replace)]
|
||||
#![feature(slice_partition_dedup)]
|
||||
#![feature(copy_within)]
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
#![feature(box_syntax)]
|
||||
#![cfg_attr(unix, feature(libc))]
|
||||
#![feature(nll)]
|
||||
#![feature(option_replace)]
|
||||
#![feature(quote)]
|
||||
#![feature(rustc_diagnostic_macros)]
|
||||
#![feature(slice_sort_by_cached_key)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user