1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[macro_export]
macro_rules! chain_types {
    ( $first:ty, $( $rest:ty ),+ $(,)? ) => {
        std::iter::Chain<$crate::chain_types!($($rest),+), $first>
    };
    ( $t:ty ) => { $t };
}

#[macro_export]
macro_rules! chain_iters {
    ( $first:expr, $( $rest:expr ),+ $(,)? ) => {
        $crate::chain_iters!($($rest),+).chain($first)
    };
    ( $iter:expr ) => { $iter };
}