File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -1760,17 +1760,15 @@ impl<T: PartialEq> Vec<T> {
1760
1760
impl < T > Vec < T > {
1761
1761
/// Removes the first instance of `item` from the vector if the item exists.
1762
1762
///
1763
- /// # Examples
1764
- ///
1765
- /// ```
1766
- /// # #![feature(vec_remove_item)]
1767
- /// let mut vec = vec![1, 2, 3, 1];
1768
- ///
1769
- /// vec.remove_item(&1);
1770
- ///
1771
- /// assert_eq!(vec, vec![2, 3, 1]);
1772
- /// ```
1763
+ /// This method will be removed soon.
1773
1764
#[ unstable( feature = "vec_remove_item" , reason = "recently added" , issue = "40062" ) ]
1765
+ #[ rustc_deprecated(
1766
+ reason = "Removing the first item equal to a needle is already easily possible \
1767
+ with iterators and the current Vec methods. Furthermore, having a method for \
1768
+ one particular case of removal (linear search, only the first item, no swap remove) \
1769
+ but not for others is inconsistent. This method will be removed soon.",
1770
+ since = "1.46.0"
1771
+ ) ]
1774
1772
pub fn remove_item < V > ( & mut self , item : & V ) -> Option < T >
1775
1773
where
1776
1774
T : PartialEq < V > ,
You can’t perform that action at this time.
0 commit comments