#range #iterator #smaller #split #divide #evenly #range-divisions

divide_range

将范围均匀分割为更小范围的迭代器

1 个不稳定版本

使用旧的 Rust 2015

0.1.1 2018 年 6 月 26 日

#10#divide

Download history 2/week @ 2024-04-07 7/week @ 2024-04-21 3/week @ 2024-04-28 115/week @ 2024-05-05 106/week @ 2024-05-12 36/week @ 2024-05-19 73/week @ 2024-05-26 34/week @ 2024-06-02 59/week @ 2024-06-09 12/week @ 2024-06-16 66/week @ 2024-06-23 25/week @ 2024-06-30 45/week @ 2024-07-07 92/week @ 2024-07-14 80/week @ 2024-07-21

246 每月下载次数
2 个包中使用(通过 wakuchin

MIT 许可证

7KB
65

split_range

将范围均匀分割为更小范围的迭代器。

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());

依赖项

~155KB