You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collect all iterator elements into one of two partitions.
Unlike [`Iterator::partition`], when predicate returns true for the first time,
it collects this element and all rest elements into B.
```rust
use itertools::Itertools;
let nums = vec![0, 1, 2, 3, 4, 5];
let (a, b): (Vec<_>, Vec<_>) = nums.into_iter().split(|n| *n == 3);
assert_eq!(a, [0, 1, 2]);
assert_eq!(b, [3, 4, 5]);
```
---
Collect all iterator elements into one of two partitions.
Unlike [`Itertools::split`], when predicate returns true, the element is collected into A
```rust
use itertools::Itertools;
let nums = vec![0, 1, 2, 3, 4, 5];
let (a, b): (Vec<_>, Vec<_>) = nums.into_iter().split_inclusive(|n| *n == 3);
assert_eq!(a, [0, 1, 2, 3]);
assert_eq!(b, [4, 5]);
```
0 commit comments