-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add Range parameter to BTreeMap::extract_if
and BTreeSet::extract_if
#140825
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
rustbot has assigned @workingjubilee. Use |
The Miri subtree was changed cc @rust-lang/miri |
☔ The latest upstream changes (presumably #141529) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
This change was requested in the btree_extract_if tracking issue: rust-lang#70530 (comment)
@workingjubilee, would you be able to take a look (and maybe redirect to the right place)? |
Ah, yeah, looks good to me. @bors r+ rollup |
Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if` This new parameter was requested in the btree_extract_if tracking issue: rust-lang#70530 (comment) I attempted to follow the style used by `Vec::extract_if`. Before: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A> where K: Ord, F: FnMut(&K, &mut V) -> bool; } ``` After: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F, R>(&mut self, range: R, pred: F) -> ExtractIf<'_, K, V, R, F, A> where K: Ord, R: RangeBounds<K>, F: FnMut(&K, &mut V) -> bool; } ``` Related: rust-lang#70530 — While I believe I have adjusted all of the necessary bits, as this is my first attempt to contribute to Rust, I may have overlooked something out of ignorance, but if you can point out any oversight, I shall attempt to remedy it.
Rollup of 8 pull requests Successful merges: - #140825 (Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if`) - #141077 (Fix the issue of typo of comma in arm parsing) - #141237 (Implement ((un)checked_)exact_div methods for integers) - #141494 (mir-opt: Do not transform non-int type in match_branches) - #141609 (core: begin deduplicating pointer docs) - #141768 (ci: use arm to calculate job matrix) - #141771 (Increase timeout for new bors try builds) - #141781 (Fix spans for unsafe binders) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #140825 - rs-sac:ext, r=workingjubilee Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if` This new parameter was requested in the btree_extract_if tracking issue: #70530 (comment) I attempted to follow the style used by `Vec::extract_if`. Before: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A> where K: Ord, F: FnMut(&K, &mut V) -> bool; } ``` After: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F, R>(&mut self, range: R, pred: F) -> ExtractIf<'_, K, V, R, F, A> where K: Ord, R: RangeBounds<K>, F: FnMut(&K, &mut V) -> bool; } ``` Related: #70530 — While I believe I have adjusted all of the necessary bits, as this is my first attempt to contribute to Rust, I may have overlooked something out of ignorance, but if you can point out any oversight, I shall attempt to remedy it.
Rollup of 8 pull requests Successful merges: - rust-lang/rust#140825 (Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if`) - rust-lang/rust#141077 (Fix the issue of typo of comma in arm parsing) - rust-lang/rust#141237 (Implement ((un)checked_)exact_div methods for integers) - rust-lang/rust#141494 (mir-opt: Do not transform non-int type in match_branches) - rust-lang/rust#141609 (core: begin deduplicating pointer docs) - rust-lang/rust#141768 (ci: use arm to calculate job matrix) - rust-lang/rust#141771 (Increase timeout for new bors try builds) - rust-lang/rust#141781 (Fix spans for unsafe binders) r? `@ghost` `@rustbot` modify labels: rollup
Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if` This new parameter was requested in the btree_extract_if tracking issue: rust-lang#70530 (comment) I attempted to follow the style used by `Vec::extract_if`. Before: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A> where K: Ord, F: FnMut(&K, &mut V) -> bool; } ``` After: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F, R>(&mut self, range: R, pred: F) -> ExtractIf<'_, K, V, R, F, A> where K: Ord, R: RangeBounds<K>, F: FnMut(&K, &mut V) -> bool; } ``` Related: rust-lang#70530 — While I believe I have adjusted all of the necessary bits, as this is my first attempt to contribute to Rust, I may have overlooked something out of ignorance, but if you can point out any oversight, I shall attempt to remedy it.
This new parameter was requested in the btree_extract_if tracking issue: #70530 (comment)
I attempted to follow the style used by
Vec::extract_if
.Before:
After:
Related: #70530
—
While I believe I have adjusted all of the necessary bits, as this is my first attempt to contribute to Rust, I may have overlooked something out of ignorance, but if you can point out any oversight, I shall attempt to remedy it.