Skip to content

Commit b32a3b3

Browse files
Philippe-Choletphimuemue
authored andcommitted
iproduct: yield one unit for the empty product
1 parent 248ab7d commit b32a3b3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ 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+
() => (
256+
$crate::__std_iter::once(())
257+
);
255258
($I:expr $(,)?) => (
256259
$crate::__std_iter::IntoIterator::into_iter($I).map(|elt| (elt,))
257260
);

0 commit comments

Comments
 (0)