mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
904dba5066
Add Vec::retain_mut This is to continue the discussion started in #83218. Original comment was: > Take 2 of #34265, since I needed this today. The reason I think why we should add `retain_mut` is for coherency and for discoverability. For example we have `chunks` and `chunks_mut` or `get` and `get_mut` or `iter` and `iter_mut`, etc. When looking for mutable `retain`, I would expect `retain_mut` to exist. It took me a while to find out about `drain_filter`. So even if it provides an API close to `drain_filter`, just for the discoverability, I think it's worth it. cc ``````@m-ou-se`````` ``````@jonas-schievink`````` ``````@Mark-Simulacrum`````` |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |