Tracking Issue for VecDeque::pop_front_if
& VecDeque::pop_back_if
· Issue #135889 · rust-lang/rust (original) (raw)
Feature gate: #![feature(vec_deque_pop_if)]
Similar to #122741, but this time with VecDeque
instead of Vec
.
Public API
impl VecDeque { pub fn pop_front_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option; pub fn pop_back_if(&mut self, predicate: impl FnOnce(&mut T) -> bool) -> Option; }
Steps / History
- ACP: pop_if or Entry/Peek-like API for Vec and VecDeque libs-team#208
- Implementation: Implement VecDeque::pop_front_if & VecDeque::pop_back_if #135890
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
Vec::pop_if
uses an explicit generic parameter for the predicate. But that might change (Tracking Issue for Vec::pop_if #122741 (comment)). If it does not, probably change these methods instead to be consistent.