utils/chain.rs
1
2
3/// A macro used to simplify chaining together multiple `IntoIter` types.
4///
5/// Returns a single iterator yielding all of the chained elements.
6#[macro_export]
7macro_rules! chain {
8 () => { ::std::iter::empty() };
9 ($first: expr) => { $first.into_iter() };
10 ($first: expr, $($iter:expr),*) => { $first.into_iter()$(.chain($iter))* };
11}
12
13
14