Skip to content

Commit c57bb10

Browse files
committed
Rollup merge of rust-lang#33746 - dns2utf8:doc_sort_memory, r=steveklabnik
Clarify docs for sort(&mut self) I documented the memory usage like noted in this issue: * Document memory usage of sort() family of functions rust-lang#33419
2 parents 0c949d8 + bf8c070 commit c57bb10

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/libcollections/slice.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -779,11 +779,10 @@ impl<T> [T] {
779779
core_slice::SliceExt::binary_search_by_key(self, b, f)
780780
}
781781

782-
/// Sorts the slice, in place.
783-
///
784782
/// This is equivalent to `self.sort_by(|a, b| a.cmp(b))`.
785783
///
786-
/// This is a stable sort.
784+
/// This sort is stable and `O(n log n)` worst-case but allocates
785+
/// approximately `2 * n` where `n` is the length of `self`.
787786
///
788787
/// # Examples
789788
///
@@ -804,11 +803,9 @@ impl<T> [T] {
804803
/// Sorts the slice, in place, using `key` to extract a key by which to
805804
/// order the sort by.
806805
///
807-
/// This sort is `O(n log n)` worst-case and stable, but allocates
806+
/// This sort is stable and `O(n log n)` worst-case but allocates
808807
/// approximately `2 * n`, where `n` is the length of `self`.
809808
///
810-
/// This is a stable sort.
811-
///
812809
/// # Examples
813810
///
814811
/// ```rust
@@ -828,7 +825,7 @@ impl<T> [T] {
828825
/// Sorts the slice, in place, using `compare` to compare
829826
/// elements.
830827
///
831-
/// This sort is `O(n log n)` worst-case and stable, but allocates
828+
/// This sort is stable and `O(n log n)` worst-case but allocates
832829
/// approximately `2 * n`, where `n` is the length of `self`.
833830
///
834831
/// # Examples

0 commit comments

Comments
 (0)