feat: non-panicking Vec::try_remove by BenjaminBrienen · Pull Request #146293 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation21 Commits1 Checks10 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@BenjaminBrienen

if index < my_vector.len() { Some(my_vector.remove(index)) } else { None } is annoying to write and non-panicking functions are broadly useful.

APC: rust-lang/libs-team#649

Tracking issue: #146954

@rustbot

r? @workingjubilee

rustbot has assigned @workingjubilee.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

Sep 7, 2025

@BenjaminBrienen BenjaminBrienen changed the titlefeat: non-panicking Vec::try_remove feat: non-panicking Vec::try_remove

Sep 7, 2025

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@BenjaminBrienen

Looks like I inadvertently repeated #77480

I'd still like to reopen the discussion about this.

folkertdev

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rustbot

This comment has been minimized.

@BenjaminBrienen

@workingjubilee

joboet

@joboet joboet left a comment • Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joboet

Oh, and could you squash the commits, please?

@rustbot

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

joboet

@BenjaminBrienen

Vec::try_remove is a non-panicking version of Vec::remove

@joboet

Great, thank you!
@bors r+ rollup

@bors

📌 Commit 5673449 has been approved by joboet

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Sep 25, 2025

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Sep 25, 2025

@matthiaskrgr

feat: non-panicking Vec::try_remove

if index < my_vector.len() { Some(my_vector.remove(index)) } else { None } is annoying to write and non-panicking functions are broadly useful.

APC: rust-lang/libs-team#649

Tracking issue: rust-lang#146954

This was referenced

Sep 25, 2025

bors added a commit that referenced this pull request

Sep 25, 2025

@bors

Rollup of 8 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit that referenced this pull request

Sep 25, 2025

@rust-timer

Rollup merge of #146293 - BenjaminBrienen:try_remove, r=joboet

feat: non-panicking Vec::try_remove

if index < my_vector.len() { Some(my_vector.remove(index)) } else { None } is annoying to write and non-panicking functions are broadly useful.

APC: rust-lang/libs-team#649

Tracking issue: #146954

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Sep 26, 2025

@bors

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Oct 9, 2025

@matthiaskrgr

feat: non-panicking Vec::try_remove

if index < my_vector.len() { Some(my_vector.remove(index)) } else { None } is annoying to write and non-panicking functions are broadly useful.

APC: rust-lang/libs-team#649

Tracking issue: rust-lang#146954

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Oct 9, 2025

@bors

…iaskrgr

Rollup of 8 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.