How to iterate or map over tuples?
Here’s an overly-clever macro solution: trait JoinTuple { fn join_tuple(&self, sep: &str) -> String; } macro_rules! tuple_impls { () => {}; ( ($idx:tt => $typ:ident), $( ($nidx:tt => $ntyp:ident), )* ) => { impl<$typ, $( $ntyp ),*> JoinTuple for ($typ, $( $ntyp ),*) where $typ: ::std::fmt::Display, $( $ntyp: ::std::fmt::Display ),* { fn join_tuple(&self, sep: &str) … Read more