This crate adds the take_until
method as an extension for iterators.
```rust use take_until::TakeUntilExt;
let varint = &[0b10101100u8, 0b00000010, 0b10000001]; let int: u32 = varint .iter() .takeuntil(|b| (*b & 0b1000_0000) == 0) .enumerate() .fold(0, |acc, (i, b)| { acc | ((b & 0b01111111) as u32) << (i * 7) }); asserteq!(300, int); ```
```rust use take_until::TakeUntilExt;
fn main() {
let items = [1, 2, 3, 4, -5, -6, -7, -8];
let filteredtakewhile = items
.intoiter()
.takewhile(|x| *x > 0)
.collect::
The MSRV is 1.56.1
stable.