about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorLuis de Bethencourt <luis@debethencourt.com>2013-09-21 01:17:22 -0400
committerLuis de Bethencourt <luis@debethencourt.com>2013-09-21 01:21:08 -0400
commite98bd9bb680c1ac673f4e5e227a57e5adfc7343c (patch)
tree665ddfb4deb01f806484036fbbee2e074595cbf4 /src/libstd
parente268c7fcc58593d71962a49a147c21edfa702f20 (diff)
downloadrust-e98bd9bb680c1ac673f4e5e227a57e5adfc7343c.tar.gz
rust-e98bd9bb680c1ac673f4e5e227a57e5adfc7343c.zip
Document a few undocumented methos in Vector
Closes #9379
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/vec.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 3cdee0eb19a..ae217d6af31 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -925,6 +925,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
     }
 
     #[inline]
+    /// Returns an iterator over the vector
     fn iter(self) -> VecIterator<'self, T> {
         unsafe {
             let p = vec::raw::to_ptr(self);
@@ -941,6 +942,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
     }
 
     #[inline]
+    /// Returns a reversed iterator over a vector
     fn rev_iter(self) -> RevIterator<'self, T> {
         self.iter().invert()
     }
@@ -1931,6 +1933,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
     }
 
     #[inline]
+    /// Returns an iterator that allows modifying each value
     fn mut_iter(self) -> VecMutIterator<'self, T> {
         unsafe {
             let p = vec::raw::to_mut_ptr(self);
@@ -1947,6 +1950,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
     }
 
     #[inline]
+    /// Returns a reversed iterator that allows modifying each value
     fn mut_rev_iter(self) -> MutRevIterator<'self, T> {
         self.mut_iter().invert()
     }
@@ -1988,11 +1992,13 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
     }
 
     #[inline]
+    /// Returns an unsafe mutable pointer to the element in index
     unsafe fn unsafe_mut_ref(self, index: uint) -> *mut T {
         ptr::mut_offset(self.repr().data as *mut T, index as int)
     }
 
     #[inline]
+    /// Unsafely sets the element in index to the value
     unsafe fn unsafe_set(self, index: uint, val: T) {
         *self.unsafe_mut_ref(index) = val;
     }