From 326b2c4582daea8eead519be0bbdac6cf4bd0f7d Mon Sep 17 00:00:00 2001 From: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> Date: Fri, 24 May 2024 13:15:58 -0700 Subject: [PATCH] Revert macro changes Signed-off-by: Chris Hennick <4961925+Pr0methean@users.noreply.github.com> --- src/spec.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/spec.rs b/src/spec.rs index 3726a58f..8738a7bd 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -158,6 +158,9 @@ macro_rules! from_le { ($obj:ident, $field:ident, $type:ty) => { $obj.$field = <$type>::from_le($obj.$field); }; + ($obj:ident, [($field:ident, $type:ty) $(,)?]) => { + from_le![$obj, $field, $type]; + }; ($obj:ident, [($field:ident, $type:ty), $($rest:tt),+ $(,)?]) => { from_le![$obj, $field, $type]; from_le!($obj, [$($rest),+]); @@ -169,6 +172,9 @@ macro_rules! to_le { ($obj:ident, $field:ident, $type:ty) => { $obj.$field = <$type>::to_le($obj.$field); }; + ($obj:ident, [($field:ident, $type:ty) $(,)?]) => { + to_le![$obj, $field, $type]; + }; ($obj:ident, [($field:ident, $type:ty), $($rest:tt),+ $(,)?]) => { to_le![$obj, $field, $type]; to_le!($obj, [$($rest),+]);