-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add VecDeque::range* methods #74099
Merged
Merged
Add VecDeque::range* methods #74099
Conversation
This file contains 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
This patch adds `VecDeque::range` and `VecDeque::range_mut` to provide iterators over a sub-range of a `VecDeque`. This behavior can be emulated with `skip` and `take`, but directly providing a `Range` is more ergonomic. This also partially makes up for `VecDeque`'s lack of `SliceIndex` support.
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jul 6, 2020
dtolnay
approved these changes
Jul 10, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good. Could you open a tracking issue and put the issue number into the unstable
attributes in the PR?
dtolnay
added
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jul 10, 2020
2 tasks
dtolnay
approved these changes
Jul 10, 2020
@bors r+ |
📌 Commit a1a19cb has been approved by |
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-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Jul 10, 2020
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Jul 11, 2020
Add VecDeque::range* methods This patch adds `VecDeque::range` and `VecDeque::range_mut` to provide iterators over a sub-range of a `VecDeque`. This behavior can be emulated with `skip` and `take`, but directly providing a `Range` is more ergonomic. This also partially makes up for `VecDeque`'s lack of `SliceIndex` support.
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Jul 11, 2020
Add VecDeque::range* methods This patch adds `VecDeque::range` and `VecDeque::range_mut` to provide iterators over a sub-range of a `VecDeque`. This behavior can be emulated with `skip` and `take`, but directly providing a `Range` is more ergonomic. This also partially makes up for `VecDeque`'s lack of `SliceIndex` support.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 11, 2020
…arth Rollup of 19 pull requests Successful merges: - rust-lang#71322 (Accept tuple.0.0 as tuple indexing (take 2)) - rust-lang#72303 (Add core::future::{poll_fn, PollFn}) - rust-lang#73862 (Stabilize casts and coercions to `&[T]` in const fn) - rust-lang#73887 (stabilize const mem::forget) - rust-lang#73989 (adjust ub-enum test to be endianess-independent) - rust-lang#74045 (Explain effects of debugging options from config.toml) - rust-lang#74076 (Add `read_exact_at` and `write_all_at` to WASI's `FileExt`) - rust-lang#74099 (Add VecDeque::range* methods) - rust-lang#74100 (Use str::strip* in bootstrap) - rust-lang#74103 (Only add CFGuard on `windows-msvc` targets) - rust-lang#74109 (Only allow `repr(i128/u128)` on enum) - rust-lang#74122 (Start-up clean-up) - rust-lang#74125 (Correctly mark the ending span of a match arm) - rust-lang#74127 (Avoid "whitelist") - rust-lang#74129 (:arrow_up: rust-analyzer) - rust-lang#74135 (Update books) - rust-lang#74145 (Update rust-installer to latest version) - rust-lang#74161 (Fix disabled dockerfiles) - rust-lang#74162 (take self by value in ToPredicate) Failed merges: r? @ghost
Merged
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 26, 2020
…-ou-se stabilize deque_range Make rust-lang#74217 stable, stabilizing `VecDeque::range` and `VecDeque::range_mut`. Pr: rust-lang#74099 r? `@m-ou-se`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds
VecDeque::range
andVecDeque::range_mut
to provideiterators over a sub-range of a
VecDeque
. This behavior can beemulated with
skip
andtake
, but directly providing aRange
ismore ergonomic. This also partially makes up for
VecDeque
's lack ofSliceIndex
support.