Skip to content

Commit

Permalink
Auto merge of #84088 - m-ou-se:stabilize-option-insert, r=m-ou-se
Browse files Browse the repository at this point in the history
Stabilize option_insert.

FCP finished here: #78271 (comment)
  • Loading branch information
bors committed Apr 15, 2021
2 parents 8aa1181 + a931060 commit f1ca558
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
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 f1ca558

Please sign in to comment.