Skip to content

Commit

Permalink
Clarify docs for sort(&mut self)
Browse files Browse the repository at this point in the history
  • Loading branch information
dns2utf8 committed May 20, 2016
1 parent d27bdaf commit bf8c070
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit bf8c070

Please sign in to comment.