Skip to content

Commit

Permalink
Rollup merge of rust-lang#49575 - tmccombs:option-filter-stabilize, r…
Browse files Browse the repository at this point in the history
…=withoutboats

Stabilize `Option::filter`.

Fixes rust-lang#45860
  • Loading branch information
kennytm authored Apr 11, 2018
2 parents 77777b4 + c7ac32a commit 5ee5de1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 1 addition & 3 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,6 @@ impl<T> Option<T> {
/// # Examples
///
/// ```rust
/// #![feature(option_filter)]
///
/// fn is_even(n: &i32) -> bool {
/// n % 2 == 0
/// }
Expand All @@ -639,7 +637,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) {
Expand Down
1 change: 0 additions & 1 deletion src/librustc_typeck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ This API is completely unstable and subject to change.
#![feature(crate_visibility_modifier)]
#![feature(from_ref)]
#![feature(exhaustive_patterns)]
#![feature(option_filter)]
#![feature(quote)]
#![feature(refcell_replace_swap)]
#![feature(rustc_diagnostic_macros)]
Expand Down

0 comments on commit 5ee5de1

Please sign in to comment.