Skip to content

Instantly share code, notes, and snippets.

@nilsso
Created August 9, 2020 22:10
Show Gist options
  • Select an option

  • Save nilsso/7d6f270fef77965f0b1d4ccd889433ce to your computer and use it in GitHub Desktop.

Select an option

Save nilsso/7d6f270fef77965f0b1d4ccd889433ce to your computer and use it in GitHub Desktop.
Rust helper to chain two or more iterators
macro_rules! ichain {
($a:expr, $b:expr) => {
$a.chain($b)
};
($a:expr, $b:expr, $($others:expr),+) => {
$a.chain(ichain!($b, $($others),+))
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment