Skip to content

Commit 9bfe6f1

Browse files
authored
Rollup merge of #80972 - KodrAus:deprecate/remove_item, r=nagisa
Remove unstable deprecated Vec::remove_item Closes #40062 The `Vec::remove_item` method was deprecated in `1.46.0` (in August of 2020). This PR now removes that unstable method entirely.
2 parents 90cc815 + 7e83fec commit 9bfe6f1

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

library/alloc/src/vec/mod.rs

-21
Original file line numberDiff line numberDiff line change
@@ -1953,27 +1953,6 @@ impl<T: PartialEq, A: Allocator> Vec<T, A> {
19531953
}
19541954
}
19551955

1956-
impl<T, A: Allocator> Vec<T, A> {
1957-
/// Removes the first instance of `item` from the vector if the item exists.
1958-
///
1959-
/// This method will be removed soon.
1960-
#[unstable(feature = "vec_remove_item", reason = "recently added", issue = "40062")]
1961-
#[rustc_deprecated(
1962-
reason = "Removing the first item equal to a needle is already easily possible \
1963-
with iterators and the current Vec methods. Furthermore, having a method for \
1964-
one particular case of removal (linear search, only the first item, no swap remove) \
1965-
but not for others is inconsistent. This method will be removed soon.",
1966-
since = "1.46.0"
1967-
)]
1968-
pub fn remove_item<V>(&mut self, item: &V) -> Option<T>
1969-
where
1970-
T: PartialEq<V>,
1971-
{
1972-
let pos = self.iter().position(|x| *x == *item)?;
1973-
Some(self.remove(pos))
1974-
}
1975-
}
1976-
19771956
////////////////////////////////////////////////////////////////////////////////
19781957
// Internal methods and functions
19791958
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)