Skip to content

Commit

Permalink
Refactor macro
Browse files Browse the repository at this point in the history
  • Loading branch information
RoDmitry committed Jan 1, 2024
1 parent f91646a commit df1d1d0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit df1d1d0

Please sign in to comment.