]> git.lizzy.rs Git - rust.git/commitdiff
Fix documentation for `slice()`
authorAdolfo Ochagavía <aochagavia92@gmail.com>
Thu, 5 Jun 2014 07:33:49 +0000 (09:33 +0200)
committerAdolfo Ochagavía <aochagavia92@gmail.com>
Fri, 6 Jun 2014 07:09:58 +0000 (09:09 +0200)
Fixes https://github.com/mozilla/rust/issues/14577

src/libcollections/vec.rs
src/libcore/slice.rs

index 1f2d176ab9b22098a74eefb6d74a1cbdc286bd05..aa80a131811c2277e217611f33ef6d049bfc1024 100644 (file)
@@ -782,11 +782,11 @@ pub fn sort_by(&mut self, compare: |&T, &T| -> Ordering) {
         self.as_mut_slice().sort_by(compare)
     }
 
-    /// Returns a slice of `self` between `start` and `end`.
+    /// Returns a slice of self spanning the interval [`start`, `end`).
     ///
     /// # Failure
     ///
-    /// Fails when `start` or `end` point outside the bounds of `self`, or when
+    /// Fails when the slice (or part of it) is outside the bounds of self, or when
     /// `start` > `end`.
     ///
     /// # Example
index 6312d9115effbc85a9863da63039ad77bb9c05b3..0257911e8c0860b68b5a3db284991f731e109201 100644 (file)
@@ -366,9 +366,9 @@ fn len(&self) -> uint {
 /// Extension methods for vectors
 pub trait ImmutableVector<'a, T> {
     /**
-     * Returns a slice of self between `start` and `end`.
+     * Returns a slice of self spanning the interval [`start`, `end`).
      *
-     * Fails when `start` or `end` point outside the bounds of self,
+     * Fails when the slice (or part of it) is outside the bounds of self,
      * or when `start` > `end`.
      */
     fn slice(&self, start: uint, end: uint) -> &'a [T];