Skip to content

Commit 049b42a

Browse files
committed
Introduced a simpler pattern for calling for_each_prefix macro
1 parent de984fd commit 049b42a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ macro_rules! tuple_impl {
9595
}
9696

9797
macro_rules! for_each_prefix (
98+
($m:ident, [$(($arg:tt),)*]) => {
99+
for_each_prefix!($m, [], [$(($arg),)*]);
100+
};
98101
($m:ident, [$(($acc:tt),)*], []) => {
99102
$m!($($acc,)*);
100103
};
@@ -106,7 +109,6 @@ macro_rules! for_each_prefix (
106109

107110
for_each_prefix! {
108111
tuple_impl,
109-
[],
110112
[(T0), (T1), (T2), (T3), (T4), (T5), (T6), (T7), (T8), (T9), (T10), (T11), (T12), (T13), (T14), (T15),]
111113
}
112114

@@ -159,7 +161,6 @@ macro_rules! merge_impl2(
159161

160162
for_each_prefix! {
161163
merge_impl2,
162-
[],
163164
[(T0), (T1), (T2), (T3), (T4), (T5), (T6), (T7), (T8), (T9), (T10), (T11), (T12), (T13), (T14), (T15),]
164165
}
165166

@@ -200,7 +201,6 @@ macro_rules! split_impl (
200201

201202
for_each_prefix! {
202203
split_impl,
203-
[],
204204
[((T0, T1)), ((T2, T3)), ((T4, T5)), ((T6, T7)), ((T8, T9)), ((T10, T11)), ((T12, T13)), ((T14, T15)),]
205205
}
206206

0 commit comments

Comments
 (0)