Rust iterator iterate until the first element where the condition is not held
Given a Vec<i32>
I’d like to create a Vec<i32>
containing all first i32
s with a predicate returning true dropping all elements once the first element not satisfying the predicate is encountered. The simple filter implementation as