Skip to content

Commit f02c9e3

Browse files
author
Stjepan Glavina
committed
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.
1 parent 2f0463a commit f02c9e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcollections/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ impl<T> [T] {
509509
core_slice::SliceExt::swap(self, a, b)
510510
}
511511

512-
/// Reverse the order of elements in a slice, in place.
512+
/// Reverses the order of elements in a slice, in place.
513513
///
514514
/// # Example
515515
///
@@ -1062,7 +1062,7 @@ impl<T> [T] {
10621062
core_slice::SliceExt::binary_search_by_key(self, b, f)
10631063
}
10641064

1065-
/// This is equivalent to `self.sort_by(|a, b| a.cmp(b))`.
1065+
/// Sorts the slice.
10661066
///
10671067
/// This sort is stable (i.e. does not reorder equal elements) and `O(n log n)` worst-case.
10681068
///

0 commit comments

Comments
 (0)