1 unstable release
Uses old Rust 2015
0.1.1 | Jun 26, 2018 |
---|
#10 in #divide
266 downloads per month
Used in 2 crates
(via wakuchin)
7KB
65 lines
split_range
Split a range evenly into an iterator of smaller ranges.
extern crate divide_range;
use divide_range::RangeDivisions;
let range = 1..18;
let mut iter = range.divide_evenly_into(5);
assert_eq!(Some(1..4), iter.next());
assert_eq!(Some(4..7), iter.next());
assert_eq!(Some(7..10), iter.next());
assert_eq!(Some(10..14), iter.next());
assert_eq!(Some(14..18), iter.next());
assert_eq!(None, iter.next());
Dependencies
~150KB