1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use crate::{uDebug, uWrite, Formatter};

macro_rules! tuple {
    ($($T:ident),*; $($i:tt),*) => {
        impl<$($T,)*> uDebug for ($($T,)*)
        where
            $($T: uDebug,)*
        {
            fn fmt<W>(&self, f: &mut Formatter<'_, W>) -> Result<(), W::Error>
            where
                W: uWrite + ?Sized,
            {
                f.debug_tuple("")?$(.field(&self.$i)?)*.finish()
            }
        }

    }
}

impl uDebug for () {
    fn fmt<W>(&self, f: &mut Formatter<'_, W>) -> Result<(), W::Error>
    where
        W: uWrite + ?Sized,
    {
        f.write_str("()")
    }
}

tuple!(A; 0);
tuple!(A, B; 0, 1);
tuple!(A, B, C; 0, 1, 2);
tuple!(A, B, C, D; 0, 1, 2, 3);
tuple!(A, B, C, D, E; 0, 1, 2, 3, 4);
tuple!(A, B, C, D, E, F; 0, 1, 2, 3, 4, 5);
tuple!(A, B, C, D, E, F, G; 0, 1, 2, 3, 4, 5, 6);
tuple!(A, B, C, D, E, F, G, H; 0, 1, 2, 3, 4, 5, 6, 7);
tuple!(A, B, C, D, E, F, G, H, I; 0, 1, 2, 3, 4, 5, 6, 7, 8);
tuple!(A, B, C, D, E, F, G, H, I, J; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
tuple!(A, B, C, D, E, F, G, H, I, J, K; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
tuple!(A, B, C, D, E, F, G, H, I, J, K, L; 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);