granite-rust/library/alloc
Matthias Krüger 19a40ec5bf
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?
2024-03-27 05:21:18 +01:00
..
benches remove redundant imports 2023-12-10 10:56:22 +08:00
src Rollup merge of #123107 - avandesa:vec_pop_if, r=joboet 2024-03-27 05:21:18 +01:00
tests Implement Vec::pop_if 2024-03-26 18:25:24 -04:00
Cargo.toml Rename {collections=>alloc}{tests,benches} 2023-11-26 12:04:56 +00:00