https://github.com/fsmaxb/rust-adjacent-pair-iterator
A rust iterator that iterates over adjacent pairs in another iterator, e.g. (1,2,3) -> ((1,2),(2,3)).
https://github.com/fsmaxb/rust-adjacent-pair-iterator
Last synced: 20 days ago
JSON representation
A rust iterator that iterates over adjacent pairs in another iterator, e.g. (1,2,3) -> ((1,2),(2,3)).
- Host: GitHub
- URL: https://github.com/fsmaxb/rust-adjacent-pair-iterator
- Owner: FSMaxB
- License: isc
- Created: 2019-05-24T18:18:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-04T15:24:52.000Z (over 1 year ago)
- Last Synced: 2025-04-10T06:09:40.670Z (21 days ago)
- Language: Rust
- Size: 26.4 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
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:
```rust
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)
```