mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 05:07:55 +00:00
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:
@@ -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,)* }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user