Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for vec_try_remove #77481

Closed
3 of 6 tasks
ohsayan opened this issue Oct 3, 2020 · 1 comment
Closed
3 of 6 tasks

Tracking issue for vec_try_remove #77481

ohsayan opened this issue Oct 3, 2020 · 1 comment
Labels
A-collections Area: `std::collection` C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC requires-nightly This issue requires a nightly compiler in some way. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@ohsayan
Copy link
Contributor

ohsayan commented Oct 3, 2020

Motivation

The current implementation of Vec::remove(idx) panics if the element at idx is not present. Vec::try_remove(idx) checks if the element at idx exists; If it does, it returns the element as Some(T); otherwise it returns None. This can be helpful when a panic is expected while removing an element from a given idx.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Tasks

  • Initial implementation (Add try_remove to Vec #77480)
    • Implement try_remove
    • Re-implement remove in terms of try_remove
    • Add tests
  • Adjust documentation
  • Stabilization PR
@ohsayan
Copy link
Contributor Author

ohsayan commented Oct 3, 2020

@rustbot modify labels +A-Collections, +T-libs

@rustbot rustbot added A-collections Area: `std::collection` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Oct 3, 2020
@jyn514 jyn514 added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC requires-nightly This issue requires a nightly compiler in some way. labels Oct 3, 2020
@ohsayan ohsayan closed this as completed Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-collections Area: `std::collection` C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC requires-nightly This issue requires a nightly compiler in some way. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants