Closed ijackson closed 8 months ago
To reproduce:
use itertools::iproduct; fn main() { for e in iproduct!( [1,2], [3,4], ) { println!("{e:?}"); } }
Expected output: it works (printing 4 lines of output).
Actual output:
error: unexpected end of macro invocation --> src/main.rs:6:15 | 6 | [3,4], | ^ missing tokens in macro arguments | note: while trying to match meta-variable `$K:expr` --> /playground/.cargo/registry/src/index.crates.io-6f17d22bba15001f/itertools-0.12.0/src/lib.rs:259:26 | 259 | ($I:expr, $J:expr, $($K:expr),+) => ( | ^^^^^^^
chain! and izip! are fine.
chain!
izip!
Removing the trailing comma works:
use itertools::iproduct; fn main() { for e in iproduct!( [1,2], [3,4] ) { println!("{e:?}"); } }
I agree.
Add $(,)? at the end of each pattern of the macro would solve this.
$(,)?
To reproduce:
Expected output: it works (printing 4 lines of output).
Actual output:
chain!
andizip!
are fine.Removing the trailing comma works: