Skip to content

Commit 7e83fec

Browse files
committed
remove unstable deprecated Vec::remove_item
1 parent da305a2 commit 7e83fec

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
@@ -1950,27 +1950,6 @@ impl<T: PartialEq, A: Allocator> Vec<T, A> {
19501950
}
19511951
}
19521952

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

0 commit comments

Comments
 (0)