Skip to content

Commit

Permalink
Rollup merge of rust-lang#129086 - slanterns:is_none_or, r=dtolnay
Browse files Browse the repository at this point in the history
Stabilize `is_none_or`

Closes: rust-lang#126383.

`@rustbot` label: +T-libs-api

r? libs-api
  • Loading branch information
matthiaskrgr authored Aug 16, 2024
2 parents 9704e2d + 9858d49 commit db3abec
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,6 @@ impl<T> Option<T> {
/// # Examples
///
/// ```
/// #![feature(is_none_or)]
///
/// let x: Option<u32> = Some(2);
/// assert_eq!(x.is_none_or(|x| x > 1), true);
///
Expand All @@ -669,7 +667,7 @@ impl<T> Option<T> {
/// ```
#[must_use]
#[inline]
#[unstable(feature = "is_none_or", issue = "126383")]
#[stable(feature = "is_none_or", since = "CURRENT_RUSTC_VERSION")]
pub fn is_none_or(self, f: impl FnOnce(T) -> bool) -> bool {
match self {
None => true,
Expand Down

0 comments on commit db3abec

Please sign in to comment.