https://github.com/harryscholes/iters
Rust iterators and iterator adaptors
https://github.com/harryscholes/iters
Last synced: 2 months ago
JSON representation
Rust iterators and iterator adaptors
- Host: GitHub
- URL: https://github.com/harryscholes/iters
- Owner: harryscholes
- Created: 2022-12-30T10:11:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-14T09:32:34.000Z (over 2 years ago)
- Last Synced: 2025-02-05T10:49:08.997Z (4 months ago)
- Language: Rust
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iters
Rust iterators and iterator adaptors
```rs
assert_eq!(
(1..=5)
.every(2) // Every second element `(1, 3, 5)`
.repeat(2) // Repeat each element twice `(1, 1, 3, 3, 5, 5)`
.times(2) // Repeat the entire iterator twice `(1, 1, 3, 3, 5, 5, 1, 1, 3, 3, 5, 5)`
.collect::>(),
vec![1, 1, 3, 3, 5, 5, 1, 1, 3, 3, 5, 5]
)
```