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

#946 in Algorithms

Download history 131/week @ 2024-03-11 66/week @ 2024-03-18 37/week @ 2024-03-25 60/week @ 2024-04-01 39/week @ 2024-04-08 71/week @ 2024-04-15 51/week @ 2024-04-22 75/week @ 2024-04-29 73/week @ 2024-05-06 67/week @ 2024-05-13 82/week @ 2024-05-20 15/week @ 2024-05-27 65/week @ 2024-06-03 93/week @ 2024-06-10 115/week @ 2024-06-17 58/week @ 2024-06-24

332 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