-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
I think it would be useful to have functions to insert and remove items from arbitrary positions within a mutable vec.
In other words, to integrate this trait into vec::MutableVector;
pub trait VecInsertRemove<T> {
/// Insert an element at position i within self, shifting all
/// elements after position i one position to the right.
fn insert(&mut self, i: uint, x:T);
/// Remove the element at position i within self, shifting all
/// elements after position i one position to the left.
fn remove(&mut self, i: uint) -> T;
}
Is this desirable? I can send a pull request with these additions plus tests.
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.