Skip to content

Commit

Permalink
Rollup merge of #96628 - joshtriplett:stabilize-then-some, r=m-ou-se
Browse files Browse the repository at this point in the history
Stabilize `bool::then_some`

FCP completed in rust-lang/rust#80967
  • Loading branch information
JohnTitor authored May 5, 2022
2 parents 266e7e9 + 683e0cb commit d777ccc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions core/src/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ impl bool {
/// # Examples
///
/// ```
/// #![feature(bool_to_option)]
///
/// assert_eq!(false.then_some(0), None);
/// assert_eq!(true.then_some(0), Some(0));
/// ```
#[unstable(feature = "bool_to_option", issue = "80967")]
#[stable(feature = "bool_to_option", since = "1.62.0")]
#[rustc_const_unstable(feature = "const_bool_to_option", issue = "91917")]
#[inline]
pub const fn then_some<T>(self, t: T) -> Option<T>
Expand Down
1 change: 0 additions & 1 deletion core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#![feature(array_methods)]
#![feature(array_windows)]
#![feature(bench_black_box)]
#![feature(bool_to_option)]
#![feature(box_syntax)]
#![feature(cell_update)]
#![feature(const_assume)]
Expand Down

0 comments on commit d777ccc

Please sign in to comment.