diff options
| author | Stjepan Glavina <stjepang@gmail.com> | 2017-01-26 11:09:45 +0100 |
|---|---|---|
| committer | Stjepan Glavina <stjepang@gmail.com> | 2017-01-26 11:09:45 +0100 |
| commit | f02c9e37415de1b838ec08f6cbc54524d5c755f7 (patch) | |
| tree | d3931939e1c37347fad9f4990328241bb2d2b955 | |
| parent | 2f0463a4a4f323c4deffc861349e38c6b5091782 (diff) | |
| download | rust-f02c9e37415de1b838ec08f6cbc54524d5c755f7.tar.gz rust-f02c9e37415de1b838ec08f6cbc54524d5c755f7.zip | |
Rewrite the first sentence in slice::sort
For every method, the first sentence should consisely explain what it does, not how. This sentence usually starts with a verb. It's really weird for `sort` to be explained in terms of another function, namely `sort_by`. There's no need for that because it's obvious how `sort` sorts elements: there is `T: Ord`. If `sort_by_key` does not have to explicitly state how it's implemented, then `sort` doesn't either.
| -rw-r--r-- | src/libcollections/slice.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index fc49c9f5643..11f513ed798 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -509,7 +509,7 @@ impl<T> [T] { core_slice::SliceExt::swap(self, a, b) } - /// Reverse the order of elements in a slice, in place. + /// Reverses the order of elements in a slice, in place. /// /// # Example /// @@ -1062,7 +1062,7 @@ impl<T> [T] { core_slice::SliceExt::binary_search_by_key(self, b, f) } - /// This is equivalent to `self.sort_by(|a, b| a.cmp(b))`. + /// Sorts the slice. /// /// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case. /// |
