about summary refs log tree commit diff
path: root/src/libcore/slice
diff options
context:
space:
mode:
authorStjepan Glavina <stjepang@gmail.com>2017-03-22 01:42:23 +0100
committerStjepan Glavina <stjepang@gmail.com>2017-03-22 17:19:52 +0100
commitd6da1d9b46f7090b18be357bef8d55ffa3673d2f (patch)
treeb1af890ad3f0728432eec3c8049e20789b7eb75d /src/libcore/slice
parentcab4bff3de1a61472f3c2e7752ef54b87344d1c9 (diff)
downloadrust-d6da1d9b46f7090b18be357bef8d55ffa3673d2f.tar.gz
rust-d6da1d9b46f7090b18be357bef8d55ffa3673d2f.zip
Various fixes to wording consistency in the docs
Diffstat (limited to 'src/libcore/slice')
-rw-r--r--src/libcore/slice/mod.rs10
-rw-r--r--src/libcore/slice/sort.rs4
2 files changed, 7 insertions, 7 deletions
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs
index 6f8b199f886..af492b3c639 100644
--- a/src/libcore/slice/mod.rs
+++ b/src/libcore/slice/mod.rs
@@ -1511,7 +1511,7 @@ fn ptrdistance<T>(start: *const T, end: *const T) -> usize {
 trait PointerExt : Copy {
     unsafe fn slice_offset(self, i: isize) -> Self;
 
-    /// Increment self by 1, but return the old value
+    /// Increments `self` by 1, but returns the old value.
     #[inline(always)]
     unsafe fn post_inc(&mut self) -> Self {
         let current = *self;
@@ -1519,7 +1519,7 @@ trait PointerExt : Copy {
         current
     }
 
-    /// Decrement self by 1, and return the new value
+    /// Decrements `self` by 1, and returns the new value.
     #[inline(always)]
     unsafe fn pre_dec(&mut self) -> Self {
         *self = self.slice_offset(-1);
@@ -1545,7 +1545,7 @@ impl<T> PointerExt for *mut T {
 /// splitn, splitn_mut etc can be implemented once.
 #[doc(hidden)]
 trait SplitIter: DoubleEndedIterator {
-    /// Mark the underlying iterator as complete, extracting the remaining
+    /// Marks the underlying iterator as complete, extracting the remaining
     /// portion of the slice.
     fn finish(&mut self) -> Option<Self::Item>;
 }
@@ -2267,11 +2267,11 @@ pub fn heapsort<T, F>(v: &mut [T], mut is_less: F)
 //
 
 extern {
-    /// Call implementation provided memcmp
+    /// Calls implementation provided memcmp.
     ///
     /// Interprets the data as u8.
     ///
-    /// Return 0 for equal, < 0 for less than and > 0 for greater
+    /// Returns 0 for equal, < 0 for less than and > 0 for greater
     /// than.
     // FIXME(#32610): Return type should be c_int
     fn memcmp(s1: *const u8, s2: *const u8, n: usize) -> i32;
diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs
index fdfba33f8a9..d13d537d993 100644
--- a/src/libcore/slice/sort.rs
+++ b/src/libcore/slice/sort.rs
@@ -104,7 +104,7 @@ fn shift_tail<T, F>(v: &mut [T], is_less: &mut F)
 
 /// Partially sorts a slice by shifting several out-of-order elements around.
 ///
-/// Returns true if the slice is sorted at the end. This function is `O(n)` worst-case.
+/// Returns `true` if the slice is sorted at the end. This function is `O(n)` worst-case.
 #[cold]
 fn partial_insertion_sort<T, F>(v: &mut [T], is_less: &mut F) -> bool
     where F: FnMut(&T, &T) -> bool
@@ -528,7 +528,7 @@ fn break_patterns<T>(v: &mut [T]) {
     }
 }
 
-/// Chooses a pivot in `v` and returns the index and true if the slice is likely already sorted.
+/// Chooses a pivot in `v` and returns the index and `true` if the slice is likely already sorted.
 ///
 /// Elements in `v` might be reordered in the process.
 fn choose_pivot<T, F>(v: &mut [T], is_less: &mut F) -> (usize, bool)