iter!() { /* proc-macro */ }
Expand description
Creates an iterator, over the given values. Other collections and iterators
may also be interspersed, or “spread”, using the ..
operator.
Usage
use velcro::iter;
let vec = vec![0, 1, 2, 3];
assert_eq!(iter![..vec, 4, 5, 6].collect::<Vec<_>>(), vec![0, 1, 2, 3, 4, 5, 6]);
for x in iter![0, 1, ..(2..=5), 6] {
println!("x = {}", x);
}
assert_eq!(iter![0, 1, ..(2..=5), 6].collect::<Vec<_>>(), vec![0, 1, 2, 3, 4, 5, 6]);