7 releases (2 stable)

Uses old Rust 2015

1.0.1 Feb 6, 2019
1.0.0 Aug 17, 2017
0.0.5 May 24, 2015
0.0.4 Jan 3, 2015
0.0.2 Nov 25, 2014

#565 in Algorithms

Download history 35/week @ 2022-08-12 16/week @ 2022-08-19 22/week @ 2022-08-26 30/week @ 2022-09-02 61/week @ 2022-09-09 19/week @ 2022-09-16 17/week @ 2022-09-23 45/week @ 2022-09-30 40/week @ 2022-10-07 11/week @ 2022-10-14 16/week @ 2022-10-21 40/week @ 2022-10-28 52/week @ 2022-11-04 36/week @ 2022-11-11 32/week @ 2022-11-18 3/week @ 2022-11-25

130 downloads per month
Used in adjacent_lines

MIT/Apache

6KB
78 lines

rust-iterslide

Version Docs Build Status

This package implements a "sliding window" iterator.

Sample usage:

extern crate iterslide;

use iterslide::SlideIterator;

fn main() {
    let v: Vec<i8> = vec![1, 2, 3, 4, 5];

    for window in v.slide(3) {
      println!("{:?}", window);
    }
}

Output:

[1, 2, 3]
[2, 3, 4]
[3, 4, 5]

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

No runtime deps