Rollup merge of #97308 - JohnTitor:stabilize-cell-filter-map, r=Mark-Simulacrum

Stabilize `cell_filter_map`

FCP has been completed: https://github.com/rust-lang/rust/issues/81061#issuecomment-1081806326
Closes #81061
This commit is contained in:
Dylan DPC 2022-05-24 15:58:25 +02:00 committed by GitHub
commit af15e45e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -1390,8 +1390,6 @@ impl<'b, T: ?Sized> Ref<'b, T> {
/// # Examples
///
/// ```
/// #![feature(cell_filter_map)]
///
/// use std::cell::{RefCell, Ref};
///
/// let c = RefCell::new(vec![1, 2, 3]);
@ -1399,7 +1397,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
/// let b2: Result<Ref<u32>, _> = Ref::filter_map(b1, |v| v.get(1));
/// assert_eq!(*b2.unwrap(), 2);
/// ```
#[unstable(feature = "cell_filter_map", reason = "recently added", issue = "81061")]
#[stable(feature = "cell_filter_map", since = "1.63.0")]
#[inline]
pub fn filter_map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Result<Ref<'b, U>, Self>
where
@ -1538,8 +1536,6 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
/// # Examples
///
/// ```
/// #![feature(cell_filter_map)]
///
/// use std::cell::{RefCell, RefMut};
///
/// let c = RefCell::new(vec![1, 2, 3]);
@ -1555,7 +1551,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
///
/// assert_eq!(*c.borrow(), vec![1, 4, 3]);
/// ```
#[unstable(feature = "cell_filter_map", reason = "recently added", issue = "81061")]
#[stable(feature = "cell_filter_map", since = "1.63.0")]
#[inline]
pub fn filter_map<U: ?Sized, F>(mut orig: RefMut<'b, T>, f: F) -> Result<RefMut<'b, U>, Self>
where