rust/library/alloc
Matthias Krüger 904dba5066
Rollup merge of #90772 - GuillaumeGomez:vec-retain-mut, r=joshtriplett
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``````
2021-11-17 15:58:01 +01:00
..
benches Add #[must_use] to remaining alloc functions 2021-10-15 11:46:49 -04:00
src Rollup merge of #90772 - GuillaumeGomez:vec-retain-mut, r=joshtriplett 2021-11-17 15:58:01 +01:00
tests Add #[must_use] to remaining core functions 2021-10-30 18:21:29 -04:00
Cargo.toml rfc3052: Remove authors field from Cargo manifests 2021-07-29 14:56:05 -07:00