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

Add VecDeque::range* methods #74099

Merged
merged 3 commits into from
Jul 11, 2020
Merged

Add VecDeque::range* methods #74099

merged 3 commits into from
Jul 11, 2020

Conversation

jonhoo
Copy link
Contributor

@jonhoo jonhoo commented Jul 6, 2020

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.

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.
@rust-highfive
Copy link
Collaborator

r? @dtolnay

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 6, 2020
Copy link
Member

@dtolnay dtolnay left a 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 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
@jonhoo jonhoo mentioned this pull request Jul 10, 2020
2 tasks
@jonhoo
Copy link
Contributor Author

jonhoo commented Jul 10, 2020

@dtolnay Done in a1a19cb. Tracking issue: #74217

@dtolnay
Copy link
Member

dtolnay commented Jul 10, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Jul 10, 2020

📌 Commit a1a19cb has been approved by dtolnay

@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-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
@bors bors merged commit 2da709e into rust-lang:master Jul 11, 2020
@jonhoo jonhoo deleted the deque-range branch July 11, 2020 17:24
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`
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants