You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of rust-lang#90772 - GuillaumeGomez:vec-retain-mut, r=joshtriplett
Add Vec::retain_mut
This is to continue the discussion started in rust-lang#83218.
Original comment was:
> Take 2 of rust-lang#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````
0 commit comments