drew.tupletimestamp - Add tuple macro for timestamps too, break macro out into support (#1372)

* Add tuple and dont mess up spacing

* Update lib.rs

* Add timestamp tuple macro
:

* Tabs

* Add docs.
This commit is contained in:
Drew Stone
2019-01-09 13:18:09 +02:00
committed by Gav Wood
parent 079eb39559
commit 43269f0dbc
3 changed files with 31 additions and 21 deletions
+15
View File
@@ -134,3 +134,18 @@ pub use mashup::*;
#[cfg(feature = "std")]
#[doc(hidden)]
pub use serde_derive::*;
/// Programatically create derivations for tuples of up to 19 elements. You provide a second macro
/// which is called once per tuple size, along with a number of identifiers, one for each element
/// of the tuple.
#[macro_export]
macro_rules! for_each_tuple {
($m:ident) => {
for_each_tuple! { @IMPL $m !! A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, }
};
(@IMPL $m:ident !!) => { $m! { } };
(@IMPL $m:ident !! $h:ident, $($t:ident,)*) => {
$m! { $h $($t)* }
for_each_tuple! { @IMPL $m !! $($t,)* }
}
}