Skip to content

Commit

Permalink
stabilize is_none_or
Browse files Browse the repository at this point in the history
  • Loading branch information
slanterns committed Aug 14, 2024
1 parent 3b8aab7 commit 9858d49
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 9858d49

Please sign in to comment.