about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorStefan Schindler <dns2utf8@estada.ch>2016-05-20 00:21:01 +0200
committerStefan Schindler <dns2utf8@estada.ch>2016-05-20 17:43:06 +0200
commitbf8c070bd5f4ebda0a0958af8b06289c1fd7e70a (patch)
treea903fb9d8ebd246315c2746a2cb9f6218d3a903a /src/libcollections
parentd27bdafc3eaab2729d664f82b7d650782640f31a (diff)
downloadrust-bf8c070bd5f4ebda0a0958af8b06289c1fd7e70a.tar.gz
rust-bf8c070bd5f4ebda0a0958af8b06289c1fd7e70a.zip
Clarify docs for sort(&mut self)
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/slice.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs
index 0f77ebb3c57..6321d5924d5 100644
--- a/src/libcollections/slice.rs
+++ b/src/libcollections/slice.rs
@@ -779,11 +779,10 @@ impl<T> [T] {
         core_slice::SliceExt::binary_search_by_key(self, b, f)
     }
 
-    /// Sorts the slice, in place.
-    ///
     /// This is equivalent to `self.sort_by(|a, b| a.cmp(b))`.
     ///
-    /// This is a stable sort.
+    /// This sort is stable and `O(n log n)` worst-case but allocates
+    /// approximately `2 * n` where `n` is the length of `self`.
     ///
     /// # Examples
     ///
@@ -804,11 +803,9 @@ impl<T> [T] {
     /// Sorts the slice, in place, using `key` to extract a key by which to
     /// order the sort by.
     ///
-    /// This sort is `O(n log n)` worst-case and stable, but allocates
+    /// This sort is stable and `O(n log n)` worst-case but allocates
     /// approximately `2 * n`, where `n` is the length of `self`.
     ///
-    /// This is a stable sort.
-    ///
     /// # Examples
     ///
     /// ```rust
@@ -828,7 +825,7 @@ impl<T> [T] {
     /// Sorts the slice, in place, using `compare` to compare
     /// elements.
     ///
-    /// This sort is `O(n log n)` worst-case and stable, but allocates
+    /// This sort is stable and `O(n log n)` worst-case but allocates
     /// approximately `2 * n`, where `n` is the length of `self`.
     ///
     /// # Examples