Using Vec::remove_item after Rust 1.51
2025-01-11
Below is a drop-in replacement for the removed Vec::remove_item
, and additionally the useful function Vec::remove_all
.
Copying the above trait definition and adding the appropriate use
statements fixes the compiler error below.
You also need to remove the feature declaration.
error[E0635]: unknown feature `vec_remove_item`
--> x.rs:1:12
|
1 | #![feature(vec_remove_item)]
|
error[E0599]: no method named `remove_item` found for struct `Vec<_>` in the current scope
--> x.rs:5:4
|
5 | v.remove_item(&123);
| ^^^^^^^^^^^
|