Skip to content

Commit

Permalink
Stabilize option_insert.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Apr 11, 2021
1 parent 28b948f commit a931060
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/core/src/option.rs
Expand Up @@ -601,8 +601,6 @@ impl<T> Option<T> {
/// # Example
///
/// ```
/// #![feature(option_insert)]
///
/// let mut opt = None;
/// let val = opt.insert(1);
/// assert_eq!(*val, 1);
Expand All @@ -613,7 +611,7 @@ impl<T> Option<T> {
/// assert_eq!(opt.unwrap(), 3);
/// ```
#[inline]
#[unstable(feature = "option_insert", reason = "newly added", issue = "78271")]
#[stable(feature = "option_insert", since = "1.53.0")]
pub fn insert(&mut self, value: T) -> &mut T {
*self = Some(value);

Expand Down

0 comments on commit a931060

Please sign in to comment.