repeat

Crates.iorepeat
lib.rsrepeat
version0.1.0
sourcesrc
created_at2018-05-12 13:35:46.490082
updated_at2018-05-12 13:35:46.490082
descriptionRepeats an iterator.
homepage
repositoryhttps://github.com/thelearnerofcode/repeat
max_upload_size
id65053
size2,532
(thelearnerofcode)

documentation

README

Repeat

A crate for repeating an iterator.

Unlike Iterator::cycle() in the standard library, repeat iterator stops repeating after a certain count.

Example

/// /// use repeat::Repeat; /// let mut iter = Repeat::new([1, 2, 3, 4, 5].iter(), 2); /// assert_eq!(iter.next().unwrap().as_slice(), &[1, 2, 3, 4, 5]); /// assert_eq!(iter.next().unwrap().as_slice(), &[1, 2, 3, 4, 5]); ///

Commit count: 0

cargo fmt