diff options
| author | Ashley Mannix <kodraus@hey.com> | 2021-01-13 15:14:11 +1000 |
|---|---|---|
| committer | Ashley Mannix <kodraus@hey.com> | 2021-01-13 15:14:11 +1000 |
| commit | 7e83fece9159463746a53242b2c6c795a47ccf9b (patch) | |
| tree | e04c460a8397c13c3bcf0054b0347f9339f72589 /library/alloc/src/vec | |
| parent | da305a2b00530aa34dea4e48389204c26fa35dbb (diff) | |
| download | rust-7e83fece9159463746a53242b2c6c795a47ccf9b.tar.gz rust-7e83fece9159463746a53242b2c6c795a47ccf9b.zip | |
remove unstable deprecated Vec::remove_item
Diffstat (limited to 'library/alloc/src/vec')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 2a83eb33fe3..fc9e108a3c6 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1950,27 +1950,6 @@ impl<T: PartialEq, A: Allocator> Vec<T, A> { } } -impl<T, A: Allocator> Vec<T, A> { - /// Removes the first instance of `item` from the vector if the item exists. - /// - /// This method will be removed soon. - #[unstable(feature = "vec_remove_item", reason = "recently added", issue = "40062")] - #[rustc_deprecated( - reason = "Removing the first item equal to a needle is already easily possible \ - with iterators and the current Vec methods. Furthermore, having a method for \ - one particular case of removal (linear search, only the first item, no swap remove) \ - but not for others is inconsistent. This method will be removed soon.", - since = "1.46.0" - )] - pub fn remove_item<V>(&mut self, item: &V) -> Option<T> - where - T: PartialEq<V>, - { - let pos = self.iter().position(|x| *x == *item)?; - Some(self.remove(pos)) - } -} - //////////////////////////////////////////////////////////////////////////////// // Internal methods and functions //////////////////////////////////////////////////////////////////////////////// |
