parent
06fa27d7c8
commit
5152a6f285
1 changed files with 1 additions and 1 deletions
|
|
@ -639,7 +639,7 @@ impl<T> Option<T> {
|
|||
/// assert_eq!(Some(4).filter(is_even), Some(4));
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "option_filter", issue = "45860")]
|
||||
#[stable(feature = "option_filter", since = "1.27.0")]
|
||||
pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self {
|
||||
if let Some(x) = self {
|
||||
if predicate(&x) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue