Skip to content

Tracking Issue for VecDeque binary search functions #78021

Closed
@vojtechkral

Description

@vojtechkral
Contributor

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

Unresolved Questions

Activity

added
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
on Oct 16, 2020
changed the title [-]Tracking Issue for XXX[/-] [+]Tracking Issue for VecDeque binary search functions[/+] on Oct 16, 2020
added
B-unstableBlocker: Implemented in the nightly compiler and unstable.
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Oct 16, 2020
added
Libs-TrackedLibs issues that are tracked on the team's project board.
on Nov 6, 2020
m-ou-se

m-ou-se commented on Mar 23, 2021

@m-ou-se
Member

We recently changed slice::binary_search_by to stop directly at Ordering::Equal, and added slice::partition_point for a binary search that only considers less and greater than. Maybe we should do the same for VecDeque.

vojtechkral

vojtechkral commented on Mar 24, 2021

@vojtechkral
ContributorAuthor

@m-ou-se Okay, I can do that...

vojtechkral

vojtechkral commented on Mar 24, 2021

@vojtechkral
ContributorAuthor

@m-ou-se I added the quick return for Ordering::Equal (locally in my branch so far), but I'm not sure about partition_point(). Do you think that's useful for a VecDeque too?

m-ou-se

m-ou-se commented on Mar 27, 2021

@m-ou-se
Member

I added the quick return for Ordering::Equal (locally in my branch so far)

Feel free to send that as a PR and assign me with r? @m-ou-se.

I'm not sure about partition_point(). Do you think that's useful for a VecDeque too?

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

vojtechkral commented on Apr 12, 2021

@vojtechkral
ContributorAuthor

Sorry about the radio silence, I've added partition_point() as well, will create the PR tomorrow...
PR: #84145

9 remaining items

rfcbot

rfcbot commented on May 17, 2021

@rfcbot
Collaborator

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.

added
proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.
on May 17, 2021
rfcbot

rfcbot commented on May 21, 2021

@rfcbot
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

added
final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
and removed
proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
on May 21, 2021
rfcbot

rfcbot commented on May 31, 2021

@rfcbot
Collaborator

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.

added
to-announceAnnounce this issue on triage meeting
and removed
final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
on May 31, 2021
added a commit that references this issue on Jun 3, 2021

Rollup merge of rust-lang#83362 - SOF3:stab/vecdeque-binary-search, r…

11acbff
added a commit that references this issue on Jun 3, 2021

Rollup merge of rust-lang#83362 - SOF3:stab/vecdeque-binary-search, r…

9a06f65
JohnTitor

JohnTitor commented on Jun 10, 2021

@JohnTitor
Member

It has been stabilized (#83362), closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-collectionsArea: `std::collections`B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @vojtechkral@m-ou-se@apiraino@KodrAus@rfcbot

        Issue actions

          Tracking Issue for VecDeque binary search functions · Issue #78021 · rust-lang/rust