Skip to content

Commit d85df50

Browse files
committed
std: Stabilize option_entry feature
Stabilized: * `Option::get_or_insert` * `Option::get_or_insert_with` Closes #39288
1 parent 1206c80 commit d85df50

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/libcore/option.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -671,8 +671,6 @@ impl<T> Option<T> {
671671
/// # Examples
672672
///
673673
/// ```
674-
/// #![feature(option_entry)]
675-
///
676674
/// let mut x = None;
677675
///
678676
/// {
@@ -685,7 +683,7 @@ impl<T> Option<T> {
685683
/// assert_eq!(x, Some(7));
686684
/// ```
687685
#[inline]
688-
#[unstable(feature = "option_entry", issue = "39288")]
686+
#[stable(feature = "option_entry", since = "1.20.0")]
689687
pub fn get_or_insert(&mut self, v: T) -> &mut T {
690688
match *self {
691689
None => *self = Some(v),
@@ -706,8 +704,6 @@ impl<T> Option<T> {
706704
/// # Examples
707705
///
708706
/// ```
709-
/// #![feature(option_entry)]
710-
///
711707
/// let mut x = None;
712708
///
713709
/// {
@@ -720,7 +716,7 @@ impl<T> Option<T> {
720716
/// assert_eq!(x, Some(7));
721717
/// ```
722718
#[inline]
723-
#[unstable(feature = "option_entry", issue = "39288")]
719+
#[stable(feature = "option_entry", since = "1.20.0")]
724720
pub fn get_or_insert_with<F: FnOnce() -> T>(&mut self, f: F) -> &mut T {
725721
match *self {
726722
None => *self = Some(f()),

0 commit comments

Comments
 (0)