-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iproduct
: generate tuples for simpler cases too
#870
iproduct
: generate tuples for simpler cases too
#870
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #870 +/- ##
==========================================
- Coverage 94.20% 94.08% -0.12%
==========================================
Files 48 48
Lines 6676 6676
==========================================
- Hits 6289 6281 -8
- Misses 387 395 +8 ☔ View full report in Codecov by Sentry. |
Iproduct
: generate tuples for simpler cases tooiproduct
: generate tuples for simpler cases too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do this.
my gut feeling is that the Macro has a bit many branches, but I think we can clean that up later if we want to
Test name `iproduct1` starts with `i` because `product1` is for another kind of test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little hesitant to make this breaking change. I appreciate the argument for consistency, but (T,)
is a somewhat exotic type — unary tuples are basically never used in Rust. However, I concede that this might be useful in tandem with code that abstracts over tuple arity, e.g., with frunk
or in the invocation of another macro. I also don't think we need to wait for someone to run into this particular edge case, since it's not particularly likely they'll also report it. Given this, I'm okay with approving this PR.
Indeed. But
Thanks. |
Fixes #868
Allow trailing commas is convenient when the macro is on multiple lines.
Fixes #869
It is more consistent to return tuples in every case.
It however is a breaking change.
Note the new case: the empty product generating a single unit tuple
()
, similar to the recent #835.What do you think?
EDIT: 2nd option, we can fix the first one and close the second.
PS: I note that semver-checks does not see much breaking changes lately.