-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-sliceArea: `[T]`Area: `[T]`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
In various cases I'd like a slice method similar to slice::split_at_mut but simpler, that returns just two items at different indexes:
fn get_two_mut(&mut self, i: usize, j: usize) -> (&mut T, &mut T)
That panics if i == j or i >= self.len() or i >= self.len().
dlight, estebank and bhgomes
Metadata
Metadata
Assignees
Labels
A-sliceArea: `[T]`Area: `[T]`C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.