Function rin::ecs::streaming_iterator::repeat[][src]

pub fn repeat<T>(item: T) -> Repeat<T>

Creates an iterator that returns an item endlessly.

let mut streaming_iter = streaming_iterator::repeat(1);
assert_eq!(streaming_iter.next(), Some(&1));
assert_eq!(streaming_iter.next(), Some(&1));
assert_eq!(streaming_iter.next(), Some(&1));
assert_eq!(streaming_iter.next(), Some(&1));
assert_eq!(streaming_iter.next(), Some(&1));
// ...