Closed
Description
Feature gate: #![feature(vecdeque_binary_search)]
This is a tracking issue for VecDeque::binary_search{,_by,_by_key}()
, formerly RFC rust-lang/rfcs#2997
Public API
// alloc::collections::vec_deque
impl<T> VecDeque<T> {
pub fn binary_search(&self, x: &T) -> Result<usize, usize>
where
T: Ord;
pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where
F: FnMut(&'a T) -> Ordering;
pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<usize, usize>
where
F: FnMut(&'a T) -> B,
B: Ord;
pub fn partition_point<P>(&self, mut pred: P) -> usize
where
P: FnMut(&T) -> bool;
}
Steps / History
- Implementation: liballoc: VecDeque: Add binary search functions #77751Final commenting period (FCP)Stabilization PR: Stabilize
vecdeque_binary_search
#83362
Unresolved Questions
- Stop at
Equal
like we do for[]
? Tracking Issue for VecDeque binary search functions #78021 (comment)Addpartition_point
too, just like[]
has?
Metadata
Metadata
Assignees
Labels
Area: `std::collections`Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCLibs issues that are tracked on the team's project board.Relevant to the library API team, which will review and decide on the PR/issue.This issue / PR is in PFCP or FCP with a disposition to merge it.The final comment period is finished for this PR / Issue.
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]Tracking Issue for XXX[/-][+]Tracking Issue for VecDeque binary search functions[/+]vecdeque_binary_search
#83362m-ou-se commentedon Mar 23, 2021
We recently changed
slice::binary_search_by
to stop directly atOrdering::Equal
, and addedslice::partition_point
for a binary search that only considers less and greater than. Maybe we should do the same forVecDeque
.vojtechkral commentedon Mar 24, 2021
@m-ou-se Okay, I can do that...
vojtechkral commentedon Mar 24, 2021
@m-ou-se I added the quick return for
Ordering::Equal
(locally in my branch so far), but I'm not sure aboutpartition_point()
. Do you think that's useful for aVecDeque
too?m-ou-se commentedon Mar 27, 2021
Feel free to send that as a PR and assign me with
r? @m-ou-se
.I don't have a very strong opinion on that. I think it might be useful, but I'd be fine with starting the FCP for just the three
VecDeque::binary_search*
functions.vojtechkral commentedon Apr 12, 2021
Sorry about the radio silence, I've added
partition_point()
as well,will create the PR tomorrow...PR: #84145
9 remaining items
rfcbot commentedon May 17, 2021
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
rfcbot commentedon May 21, 2021
🔔 This is now entering its final comment period, as per the review above. 🔔
rfcbot commentedon May 31, 2021
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
The RFC will be merged soon.
Rollup merge of rust-lang#83362 - SOF3:stab/vecdeque-binary-search, r…
Rollup merge of rust-lang#83362 - SOF3:stab/vecdeque-binary-search, r…
JohnTitor commentedon Jun 10, 2021
It has been stabilized (#83362), closing.