Skip to content

Commit 56a2e5d

Browse files
committed
core::vec is missing methods for mutable slices
1 parent 5d04ee8 commit 56a2e5d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/libstd/vec.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -2347,12 +2347,19 @@ impl<T:Eq> OwnedEqVector<T> for ~[T] {
23472347
}
23482348
}
23492349

2350-
pub trait MutableVector<T> {
2350+
pub trait MutableVector<'self, T> {
2351+
fn mut_slice(&mut self, start: uint, end: uint) -> &'self mut [T];
2352+
23512353
unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T;
23522354
unsafe fn unsafe_set(&self, index: uint, val: T);
23532355
}
23542356

2355-
impl<'self,T> MutableVector<T> for &'self mut [T] {
2357+
impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
2358+
#[inline]
2359+
fn mut_slice(&mut self, start: uint, end: uint) -> &'self mut [T] {
2360+
mut_slice(*self, start, end)
2361+
}
2362+
23562363
#[inline(always)]
23572364
unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T {
23582365
let pair_ptr: &(*mut T, uint) = transmute(self);

0 commit comments

Comments
 (0)