File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 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> {
17601760impl < T > Vec < T > {
17611761 /// Removes the first instance of `item` from the vector if the item exists.
17621762 ///
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.
17731764 #[ 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+ ) ]
17741772 pub fn remove_item < V > ( & mut self , item : & V ) -> Option < T >
17751773 where
17761774 T : PartialEq < V > ,
You can’t perform that action at this time.
0 commit comments