summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorJunyoung Cho <june0.cho@samsung.com>2013-05-27 10:40:07 +0900
committerjune0cho <june0.cho@samsung.com>2013-05-28 10:29:35 +0900
commit56a2e5dc22bfd0791b5e71dc89dde48fd3034e03 (patch)
treefb6e855ac3b5883055c960dba4887bb67d3c30dc /src/libstd
parent5d04ee805b96d34e7c5b316270a730fd9a0c537f (diff)
downloadrust-56a2e5dc22bfd0791b5e71dc89dde48fd3034e03.tar.gz
rust-56a2e5dc22bfd0791b5e71dc89dde48fd3034e03.zip
core::vec is missing methods for mutable slices
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/vec.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 103489988a3..60fc9c07f3b 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -2347,12 +2347,19 @@ impl<T:Eq> OwnedEqVector<T> for ~[T] {
     }
 }
 
-pub trait MutableVector<T> {
+pub trait MutableVector<'self, T> {
+    fn mut_slice(&mut self, start: uint, end: uint) -> &'self mut [T];
+
     unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T;
     unsafe fn unsafe_set(&self, index: uint, val: T);
 }
 
-impl<'self,T> MutableVector<T> for &'self mut [T] {
+impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
+    #[inline]
+    fn mut_slice(&mut self, start: uint, end: uint) -> &'self mut [T] {
+        mut_slice(*self, start, end)
+    }
+
     #[inline(always)]
     unsafe fn unsafe_mut_ref(&self, index: uint) -> *mut T {
         let pair_ptr: &(*mut T, uint) = transmute(self);