Add is_some_with tracking issue number.
This commit is contained in:
parent
aaebae973f
commit
148234ff73
@ -567,7 +567,7 @@ impl<T> Option<T> {
|
|||||||
/// ```
|
/// ```
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[unstable(feature = "is_some_with", issue = "none")]
|
#[unstable(feature = "is_some_with", issue = "93050")]
|
||||||
pub fn is_some_with(&self, f: impl FnOnce(&T) -> bool) -> bool {
|
pub fn is_some_with(&self, f: impl FnOnce(&T) -> bool) -> bool {
|
||||||
matches!(self, Some(x) if f(x))
|
matches!(self, Some(x) if f(x))
|
||||||
}
|
}
|
||||||
|
@ -558,7 +558,7 @@ impl<T, E> Result<T, E> {
|
|||||||
/// ```
|
/// ```
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[unstable(feature = "is_some_with", issue = "none")]
|
#[unstable(feature = "is_some_with", issue = "93050")]
|
||||||
pub fn is_ok_with(&self, f: impl FnOnce(&T) -> bool) -> bool {
|
pub fn is_ok_with(&self, f: impl FnOnce(&T) -> bool) -> bool {
|
||||||
matches!(self, Ok(x) if f(x))
|
matches!(self, Ok(x) if f(x))
|
||||||
}
|
}
|
||||||
@ -600,7 +600,7 @@ impl<T, E> Result<T, E> {
|
|||||||
/// ```
|
/// ```
|
||||||
#[must_use]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[unstable(feature = "is_some_with", issue = "none")]
|
#[unstable(feature = "is_some_with", issue = "93050")]
|
||||||
pub fn is_err_with(&self, f: impl FnOnce(&E) -> bool) -> bool {
|
pub fn is_err_with(&self, f: impl FnOnce(&E) -> bool) -> bool {
|
||||||
matches!(self, Err(x) if f(x))
|
matches!(self, Err(x) if f(x))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user