adjacent-pair-iterator

Crates.ioadjacent-pair-iterator
lib.rsadjacent-pair-iterator
version1.0.0
sourcesrc
created_at2019-05-24 19:25:28.440299
updated_at2021-11-09 12:26:46.777638
descriptionAn iterator over adjacent pairs in another iterator.
homepagehttps://github.com/FSMaxB/rust-adjacent-pair-iterator
repositoryhttps://github.com/FSMaxB/rust-adjacent-pair-iterator
max_upload_size
id136758
size14,147
Max Bruckner (FSMaxB)

documentation

README

adjacent-pair-iterator

A #![no_std] library that takes an iterator and turns it into an iterator over adjacent pairs.

Minimum rust version (MSRV)

This library works with Rust versions since 1.31.

Example:

use adjacent_pair_iterator::AdjacentPairIterator;

pub fn main() {
	let vector = vec![1, 2, 3, 4];
	for pair in vector.adjacent_pairs() {
		println!("{:?}", pair);
	}
}

Prints:

(1, 2)
(2, 3)
(3, 4)
Commit count: 40

cargo fmt