bidir_iter

Crates.iobidir_iter
lib.rsbidir_iter
version0.2.1
sourcesrc
created_at2019-02-18 06:19:39.438459
updated_at2019-12-25 07:10:22.870612
descriptionBidirectional iterators
homepage
repositoryhttps://github.com/sbillig/bidir_iter
max_upload_size
id115510
size21,755
all (github:sunrise-choir:all)

documentation

https://docs.rs/bidir_iter/

README

Bidrectional iterators

Build Status Documentation

use bidir_iter::*;

let a: &[i64] = &[1, 2, 3];
let mut iter = a.bidir_iter();

assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), Some(&3));
assert_eq!(iter.prev(), Some(&2));
assert_eq!(iter.prev(), Some(&1));
assert_eq!(iter.prev(), None);
assert_eq!(iter.next(), Some(&1));
Commit count: 8

cargo fmt