Skip to content

Commit d3e6889

Browse files
committed
auto merge of #9381 : luisbg/rust/master, r=cmr
Closes #9379
2 parents 650100d + e98bd9b commit d3e6889

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libstd/vec.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
925925
}
926926

927927
#[inline]
928+
/// Returns an iterator over the vector
928929
fn iter(self) -> VecIterator<'self, T> {
929930
unsafe {
930931
let p = vec::raw::to_ptr(self);
@@ -941,6 +942,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
941942
}
942943

943944
#[inline]
945+
/// Returns a reversed iterator over a vector
944946
fn rev_iter(self) -> RevIterator<'self, T> {
945947
self.iter().invert()
946948
}
@@ -1931,6 +1933,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
19311933
}
19321934

19331935
#[inline]
1936+
/// Returns an iterator that allows modifying each value
19341937
fn mut_iter(self) -> VecMutIterator<'self, T> {
19351938
unsafe {
19361939
let p = vec::raw::to_mut_ptr(self);
@@ -1947,6 +1950,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
19471950
}
19481951

19491952
#[inline]
1953+
/// Returns a reversed iterator that allows modifying each value
19501954
fn mut_rev_iter(self) -> MutRevIterator<'self, T> {
19511955
self.mut_iter().invert()
19521956
}
@@ -1988,11 +1992,13 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
19881992
}
19891993

19901994
#[inline]
1995+
/// Returns an unsafe mutable pointer to the element in index
19911996
unsafe fn unsafe_mut_ref(self, index: uint) -> *mut T {
19921997
ptr::mut_offset(self.repr().data as *mut T, index as int)
19931998
}
19941999

19952000
#[inline]
2001+
/// Unsafely sets the element in index to the value
19962002
unsafe fn unsafe_set(self, index: uint, val: T) {
19972003
*self.unsafe_mut_ref(index) = val;
19982004
}

0 commit comments

Comments
 (0)