-
Notifications
You must be signed in to change notification settings - Fork 14k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(slice_partial_sort_unstable)]
This is a tracking issue for rust-lang/libs-team#685.
Public API
impl<T> [T] {
// `n` is the length of the sorted slice
pub fn partial_sort_unstable<R>(&mut self, range: R) where T: Ord, R: RangeBounds<usize> { ... }
pub fn partial_sort_unstable_by<F, R>(&mut self, range: R, mut compare: F) where F: FnMut(&T, &T) -> Ordering, R: RangeBounds<usize> { ... }
pub fn partial_sort_unstable_by_key<K, F, R>(&mut self, range: R, mut f: F) where F: FnMut(&T) -> K, K: Ord, R: RangeBounds<usize> { ... }
}
#[test]
fn demostration() {
let mut before: Vec<u32> = vec![4, 4, 3, 3, 1, 1, 2, 2];
let last = 6;
let mut d = before.clone();
d.sort();
before.partial_sort_unstable_by(..last, |a, b| a.cmp(b));
assert_eq!(&d[0..last], &before[0..last]);
}Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: ACP: Add a
partial_sortmethod to[T]libs-team#685. - Implementation: #...
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.