Commit 9200527
authored
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``1 file changed
+29
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1444 | 1444 | | |
1445 | 1445 | | |
1446 | 1446 | | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
1447 | 1475 | | |
1448 | 1476 | | |
1449 | 1477 | | |
| |||
1496 | 1524 | | |
1497 | 1525 | | |
1498 | 1526 | | |
1499 | | - | |
| 1527 | + | |
1500 | 1528 | | |
1501 | 1529 | | |
1502 | 1530 | | |
| |||
0 commit comments