Rollup merge of #123107 - avandesa:vec_pop_if, r=joboet

Implement `Vec::pop_if`

This PR adds `Vec::pop_if` to the public API, behind the `vec_pop_if` feature.

```rust
impl<T> Vec<T> {
    pub fn pop_if<F>(&mut self, f: F) -> Option<T>
        where F: FnOnce(&mut T) -> bool;
}
```

Tracking issue: #122741

## Open questions

- [ ] Should the first unit test be split up?
- [ ] I don't see any guidance on ordering of methods in impl blocks, should I move the method elsewhere?
This commit is contained in:
Matthias Krüger 2024-03-27 05:21:18 +01:00 committed by GitHub
commit 19a40ec5bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 57 additions and 0 deletions

View file

@ -170,6 +170,7 @@
#![feature(unicode_internals)]
#![feature(unsize)]
#![feature(utf8_chunks)]
#![feature(vec_pop_if)]
// tidy-alphabetical-end
//
// Language features: