Rollup merge of #129087 - slanterns:option_get_or_insert_default, r=dtolnay
Stabilize `option_get_or_insert_default` Closes: https://github.com/rust-lang/rust/issues/82901. `@rustbot` label: +T-libs-api r? libs-api
This commit is contained in:
commit
e76eb96a00
@ -3,7 +3,6 @@
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(map_many_mut)]
|
||||
#![feature(option_get_or_insert_default)]
|
||||
#![feature(rustc_attrs)]
|
||||
#![warn(unreachable_pub)]
|
||||
// tidy-alphabetical-end
|
||||
|
@ -1639,8 +1639,6 @@ pub fn get_or_insert(&mut self, value: T) -> &mut T {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(option_get_or_insert_default)]
|
||||
///
|
||||
/// let mut x = None;
|
||||
///
|
||||
/// {
|
||||
@ -1653,7 +1651,7 @@ pub fn get_or_insert(&mut self, value: T) -> &mut T {
|
||||
/// assert_eq!(x, Some(7));
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "option_get_or_insert_default", issue = "82901")]
|
||||
#[stable(feature = "option_get_or_insert_default", since = "CURRENT_RUSTC_VERSION")]
|
||||
pub fn get_or_insert_default(&mut self) -> &mut T
|
||||
where
|
||||
T: Default,
|
||||
|
Loading…
Reference in New Issue
Block a user