Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iproduct: yield one unit for the empty product
Browse files Browse the repository at this point in the history
Philippe-Cholet committed Feb 1, 2024
1 parent 518efd3 commit 8297524
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -249,6 +249,9 @@ macro_rules! iproduct {
(@flatten $I:expr, $J:expr, $($K:expr,)*) => (
$crate::iproduct!(@flatten $crate::cons_tuples($crate::iproduct!($I, $J)), $($K,)*)
);
() => (
$crate::__std_iter::once(())
);
($I:expr $(,)?) => (
$crate::__std_iter::IntoIterator::into_iter($I).map(|elt| (elt,))
);

0 comments on commit 8297524

Please sign in to comment.