Skip to content

harryscholes/iters

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iters

Rust iterators and iterator adaptors

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<i32>>(),
    vec![1, 1, 3, 3, 5, 5, 1, 1, 3, 3, 5, 5]
)

About

Rust iterators and iterator adaptors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages