-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
needless_return
suggest return unit type on void returns
#8185
Conversation
Add test for nested match arms and update test to suggest replacing void return with `()`
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
I'm not completely happy with calling an empty tuple a "unit type" – you're returning a value, not a type. Please change to either "unit value", "unit expression" or "empty tuple". Otherwise this looks good to merge. |
Thank you! @bors r+ squash |
📌 Commit 020998a has been approved by |
`needless_return` suggest return unit type on void returns closes #8177 previously, `needless_return` suggests an empty block `{}` to replace void `return` on match arms, this PR improve the suggestion by suggesting a unit instead. changelog: `needless_return` suggests `()` instead of `{}` on match arms
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This was actually merged, but github UI seems to have some problems. |
It would be interesting to see what happens with a retry, but I think the best solution would be to just close it 😅 |
I did this on another PR, it was merged twice. So as it's merged I'm going to close this PR manually. Thanks @dswij and sorry for the inconvenience. |
Nothing to be sorry about here, thanks for the review 🙂 |
closes #8177
previously,
needless_return
suggests an empty block{}
to replace voidreturn
on match arms, this PR improve the suggestion by suggesting a unit instead.changelog:
needless_return
suggests()
instead of{}
on match arms