Stabilize `cell_filter_map`

This commit is contained in:
Yuki Okushi 2022-05-23 18:04:53 +09:00
parent 03c8b0b6ed
commit 65242592c9
No known key found for this signature in database
GPG Key ID: 379CEEFDD63E5DD7
1 changed files with 2 additions and 6 deletions

View File

@ -1390,8 +1390,6 @@ impl<'b, T: ?Sized> Ref<'b, T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(cell_filter_map)]
///
/// use std::cell::{RefCell, Ref}; /// use std::cell::{RefCell, Ref};
/// ///
/// let c = RefCell::new(vec![1, 2, 3]); /// 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)); /// let b2: Result<Ref<u32>, _> = Ref::filter_map(b1, |v| v.get(1));
/// assert_eq!(*b2.unwrap(), 2); /// 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] #[inline]
pub fn filter_map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Result<Ref<'b, U>, Self> pub fn filter_map<U: ?Sized, F>(orig: Ref<'b, T>, f: F) -> Result<Ref<'b, U>, Self>
where where
@ -1538,8 +1536,6 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// #![feature(cell_filter_map)]
///
/// use std::cell::{RefCell, RefMut}; /// use std::cell::{RefCell, RefMut};
/// ///
/// let c = RefCell::new(vec![1, 2, 3]); /// 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]); /// 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] #[inline]
pub fn filter_map<U: ?Sized, F>(mut orig: RefMut<'b, T>, f: F) -> Result<RefMut<'b, U>, Self> pub fn filter_map<U: ?Sized, F>(mut orig: RefMut<'b, T>, f: F) -> Result<RefMut<'b, U>, Self>
where where