Skip to content

Commit 81c9cbe

Browse files
Philippe-Choletphimuemue
authored andcommitted
iproduct: allow commas at the end
1 parent b607fbd commit 81c9cbe

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
@@ -252,13 +252,13 @@ macro_rules! iproduct {
252252
(@flatten $I:expr, $J:expr, $($K:expr,)*) => (
253253
$crate::iproduct!(@flatten $crate::cons_tuples($crate::iproduct!($I, $J)), $($K,)*)
254254
);
255-
($I:expr) => (
255+
($I:expr $(,)?) => (
256256
$crate::__std_iter::IntoIterator::into_iter($I)
257257
);
258-
($I:expr, $J:expr) => (
258+
($I:expr, $J:expr $(,)?) => (
259259
$crate::Itertools::cartesian_product($crate::iproduct!($I), $crate::iproduct!($J))
260260
);
261-
($I:expr, $J:expr, $($K:expr),+) => (
261+
($I:expr, $J:expr, $($K:expr),+ $(,)?) => (
262262
$crate::iproduct!(@flatten $crate::iproduct!($I, $J), $($K,)+)
263263
);
264264
}

0 commit comments

Comments
 (0)