Implement pick[23]_mut
via get_disjoint_mut
[rustc cleanup]
#138196
Labels
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The
IndexSlice
internal type has two methodsthat offer a safe interface to getting multiple mutable borrows into the slice.
Now that https://doc.rust-lang.org/beta/std/primitive.slice.html#method.get_disjoint_mut exists, their current non-trivial implementations can be replaced with a call to that stabilized method (and some pattern-matching and unwrapping).
It's probably not worth changing all the code to stop using
pick[23]_mut
; just swapping out the implementation is enough.The text was updated successfully, but these errors were encountered: