about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-05-30 13:52:24 -0700
committerGitHub <noreply@github.com>2025-05-30 13:52:24 -0700
commita7e56bff084c22ef915029cc5076acaa2677a081 (patch)
tree16edb2efeca427c28c7ef456cc74781777ee5c02 /compiler/rustc_parse/src
parent15825b7161f8bd6a3482211fbf6727a52aa1166b (diff)
parent8656d9e619f7b8ee3bde8bc7ee57a7847c0a5b10 (diff)
downloadrust-a7e56bff084c22ef915029cc5076acaa2677a081.tar.gz
rust-a7e56bff084c22ef915029cc5076acaa2677a081.zip
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:  https://github.com/rust-lang/rust/issues/70530#issuecomment-2486566328

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.
Diffstat (limited to 'compiler/rustc_parse/src')
0 files changed, 0 insertions, 0 deletions