Skip to content

Commit 7ddd566

Browse files
authored
Rollup merge of rust-lang#129087 - slanterns:option_get_or_insert_default, r=dtolnay
Stabilize `option_get_or_insert_default` Closes: rust-lang#82901. `@rustbot` label: +T-libs-api r? libs-api
2 parents edc72ca + 7921401 commit 7ddd566

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

core/src/option.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1639,8 +1639,6 @@ impl<T> Option<T> {
16391639
/// # Examples
16401640
///
16411641
/// ```
1642-
/// #![feature(option_get_or_insert_default)]
1643-
///
16441642
/// let mut x = None;
16451643
///
16461644
/// {
@@ -1653,7 +1651,7 @@ impl<T> Option<T> {
16531651
/// assert_eq!(x, Some(7));
16541652
/// ```
16551653
#[inline]
1656-
#[unstable(feature = "option_get_or_insert_default", issue = "82901")]
1654+
#[stable(feature = "option_get_or_insert_default", since = "CURRENT_RUSTC_VERSION")]
16571655
pub fn get_or_insert_default(&mut self) -> &mut T
16581656
where
16591657
T: Default,

0 commit comments

Comments
 (0)