rust/library/alloc/src
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
..
alloc Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
collections provide a SpecExtend trait for Vec<T> 2021-11-12 15:45:25 +08:00
raw_vec Rename AllocRef to Allocator and (de)alloc to (de)allocate 2020-12-04 14:47:15 +01:00
rc Re-stabilize Weak::as_ptr &friends for unsized T 2021-01-06 19:30:22 -05:00
sync Rollup merge of #80764 - CAD97:weak-unsized-as-ptr-again, r=RalfJung 2021-01-16 17:29:56 +00:00
vec Add Vec::retain_mut 2021-11-12 15:22:48 +01:00
alloc.rs Add #[must_use] to alloc functions that would leak memory 2021-10-30 22:19:07 -04:00
borrow.rs Const Deref 2021-09-15 03:06:53 +00:00
boxed.rs document Box and box_free connection 2021-11-09 07:13:53 -05:00
fmt.rs Give examples of format args capture in the fmt module documentation 2021-11-15 10:13:44 +01:00
lib.rs Stabilize format_args_capture 2021-11-15 10:14:29 +01:00
macros.rs Remove alloc/malloc/calloc/realloc doc aliases 2021-06-30 19:59:39 +01:00
raw_vec.rs Make RawVec private to alloc 2021-11-03 20:52:16 +01:00
rc.rs Add comments regarding superfluous !Sync impls 2021-11-08 13:07:20 -05:00
slice.rs Re-export core::slice::EscapeAscii 2021-11-05 17:14:57 +10:00
str.rs Fix str::SplitInclusive stabilisation date 2021-11-05 17:46:58 +10:00
string.rs Rollup merge of #89786 - jkugelman:must-use-len-and-is_empty, r=joshtriplett 2021-10-31 13:20:05 +01:00
sync.rs Rollup merge of #90427 - jkugelman:must-use-alloc-leak, r=joshtriplett 2021-10-31 09:20:27 +01:00
task.rs Document From implementations for Waker and RawWaker 2021-04-22 14:16:33 -07:00
tests.rs Fix alloc::test::test_show 2021-04-21 15:45:41 +02:00