@@ -925,6 +925,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
925
925
}
926
926
927
927
#[ inline]
928
+ /// Returns an iterator over the vector
928
929
fn iter ( self ) -> VecIterator < ' self , T > {
929
930
unsafe {
930
931
let p = vec:: raw:: to_ptr ( self ) ;
@@ -941,6 +942,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
941
942
}
942
943
943
944
#[ inline]
945
+ /// Returns a reversed iterator over a vector
944
946
fn rev_iter ( self ) -> RevIterator < ' self , T > {
945
947
self . iter ( ) . invert ( )
946
948
}
@@ -1931,6 +1933,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
1931
1933
}
1932
1934
1933
1935
#[ inline]
1936
+ /// Returns an iterator that allows modifying each value
1934
1937
fn mut_iter ( self ) -> VecMutIterator < ' self , T > {
1935
1938
unsafe {
1936
1939
let p = vec:: raw:: to_mut_ptr ( self ) ;
@@ -1947,6 +1950,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
1947
1950
}
1948
1951
1949
1952
#[ inline]
1953
+ /// Returns a reversed iterator that allows modifying each value
1950
1954
fn mut_rev_iter ( self ) -> MutRevIterator < ' self , T > {
1951
1955
self . mut_iter ( ) . invert ( )
1952
1956
}
@@ -1988,11 +1992,13 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
1988
1992
}
1989
1993
1990
1994
#[ inline]
1995
+ /// Returns an unsafe mutable pointer to the element in index
1991
1996
unsafe fn unsafe_mut_ref ( self , index : uint ) -> * mut T {
1992
1997
ptr:: mut_offset ( self . repr ( ) . data as * mut T , index as int )
1993
1998
}
1994
1999
1995
2000
#[ inline]
2001
+ /// Unsafely sets the element in index to the value
1996
2002
unsafe fn unsafe_set ( self , index : uint , val : T ) {
1997
2003
* self . unsafe_mut_ref ( index) = val;
1998
2004
}
0 commit comments