From df1d1d04f2b81680f8162d1fac7261b6be069096 Mon Sep 17 00:00:00 2001 From: RoDmitry Date: Mon, 1 Jan 2024 16:40:25 +0400 Subject: [PATCH] Refactor macro --- src/lib.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9d808a1..054deb6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -203,18 +203,15 @@ pub mod option { } macro_rules! skip_merge { - ($typ: ident) => { - impl Merge for $typ { + ($($t:ty)*) => {$( + impl Merge for $t { #[inline(always)] fn merge(&mut self, _: &mut Self) {} } - }; - ($($typ: ident),*) => { - $(skip_merge!($typ);)* - }; + )*}; } -skip_merge!(u8, i8, u16, i16, u32, i32, u64, i64, usize, isize, u128, i128, f32, f64, bool); +skip_merge!(u8 i8 u16 i16 u32 i32 usize isize u64 i64 u128 i128 f32 f64 bool); /// Merge strategies for boolean types. pub mod bool {