tuple-into 0.1.0

A trait providing a convenient way to convert tuples of convertible elements.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use seq_macro::seq;

pub trait TupleInto<T> {
    fn tuple_into(self) -> T;
}

seq!(N in 0..=127 {
    #(
        seq!(M in 0..=N {
            impl <#(Out~M, )* #(In~M: Into<Out~M>, )*> TupleInto<(#(Out~M, )*)> for (#(In~M, )*) {
                fn tuple_into(self) -> (#(Out~M, )*) {
                    (#(self.M.into(), )*)
                }
            }
        });
    )*
});