Fix is_some_with tests.
This commit is contained in:
parent
45dee47fec
commit
5fee3e7a9c
2 changed files with 13 additions and 8 deletions
|
@ -556,14 +556,16 @@ impl<T> Option<T> {
|
|||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// #![feature(is_some_with)]
|
||||
///
|
||||
/// let x: Option<u32> = Some(2);
|
||||
/// assert_eq!(x.is_some_with(|x| x > 1), true);
|
||||
/// assert_eq!(x.is_some_with(|&x| x > 1), true);
|
||||
///
|
||||
/// let x: Option<u32> = Some(0);
|
||||
/// assert_eq!(x.is_some_with(|x| x > 1), false);
|
||||
/// assert_eq!(x.is_some_with(|&x| x > 1), false);
|
||||
///
|
||||
/// let x: Option<u32> = None;
|
||||
/// assert_eq!(x.is_some_with(|x| x > 1), false);
|
||||
/// assert_eq!(x.is_some_with(|&x| x > 1), false);
|
||||
/// ```
|
||||
#[must_use]
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue