Skip to content

Commit

Permalink
Introduced a simpler pattern for calling for_each_prefix macro
Browse files Browse the repository at this point in the history
  • Loading branch information
garlic0708 committed Jan 28, 2021
1 parent de984fd commit 049b42a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ macro_rules! tuple_impl {
}

macro_rules! for_each_prefix (
($m:ident, [$(($arg:tt),)*]) => {
for_each_prefix!($m, [], [$(($arg),)*]);
};
($m:ident, [$(($acc:tt),)*], []) => {
$m!($($acc,)*);
};
Expand All @@ -106,7 +109,6 @@ macro_rules! for_each_prefix (

for_each_prefix! {
tuple_impl,
[],
[(T0), (T1), (T2), (T3), (T4), (T5), (T6), (T7), (T8), (T9), (T10), (T11), (T12), (T13), (T14), (T15),]
}

Expand Down Expand Up @@ -159,7 +161,6 @@ macro_rules! merge_impl2(

for_each_prefix! {
merge_impl2,
[],
[(T0), (T1), (T2), (T3), (T4), (T5), (T6), (T7), (T8), (T9), (T10), (T11), (T12), (T13), (T14), (T15),]
}

Expand Down Expand Up @@ -200,7 +201,6 @@ macro_rules! split_impl (

for_each_prefix! {
split_impl,
[],
[((T0, T1)), ((T2, T3)), ((T4, T5)), ((T6, T7)), ((T8, T9)), ((T10, T11)), ((T12, T13)), ((T14, T15)),]
}

Expand Down

0 comments on commit 049b42a

Please sign in to comment.