Skip to content

fix: count zero for multi_product with a later empty factor - #1141

Draft
liuyinchu wants to merge 1 commit into
rust-itertools:masterfrom
liuyinchu:fix/multiproduct-count-empty-factor
Draft

liuyinchu wants to merge 1 commit into
rust-itertools:masterfrom
liuyinchu:fix/multiproduct-count-empty-factor

Conversation

@liuyinchu

Copy link
Copy Markdown

A fresh product with a zero-length factor has zero items, even when multiplying earlier nonempty factor counts would overflow usize. Check for the empty factor before reporting overflow. Genuine nonempty products with unrepresentable counts still panic.

Regression reproduced on master and passed after the fix; alloc-only build check and Clippy passed. Prepared with AI assistance.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant