Stabilize Option::filter.

Fixes #45860
This commit is contained in:
Thayne McCombs 2018-04-01 22:11:51 -06:00
parent 06fa27d7c8
commit 5152a6f285

View file

@ -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) {