split-iter 0.1.0

Allows splitting of iterators.
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 6.86 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.08 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Documentation
  • Mixthos/split-iter
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Mixthos

split-iter Build Status

Provides the trait Splittable, which allows you to split an iterator according to a predicate.

Documentation

Usage

Add to your Cargo.toml:

[dependencies]
split-iter = "0.1"

Example

extern crate split_iter;
use split_iter::Splittable;

fn main() {
	let (odd, even) = (1..10).split(|v| v % 2 == 0);

	assert_eq!(odd.collect::<Vec<_>>(), [1,3,5,7,9]);
	assert_eq!(even.collect::<Vec<_>>(), [2,4,6,8]);
}