-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Elide unit variables linted by let_unit
and use ()
directly instead
#12603
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
Conversation
r? @Manishearth rustbot has assigned @Manishearth. Use |
🤔 would it be worth it to continue linting but suggest replacing every use of the binding with |
I think we could do that. It could look be a bit silly buuuuuuut why not? :D |
let_unit
bindings that are usedlet_unit
and use ()
directly instead
Situation: `let_unit` lints when an expression binds a unit (`()`) to a variable. In some cases this binding may be passed down to another function. Currently, the lint removes the binding without considering usage. Change: All usages of the elided variable are now replaced with `()`. fixes: #12594
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.
nicely done!
@bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
1 similar comment
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request. |
Situation:
let_unit
lints when an expression binds a unit (()
) to a variable. In some cases this binding may be passed down to another function. Currently, the lint removes the binding without considering usage.fixes: #12594
changelog: Suggestion Fix [
let_unit
]. Clippy will remove unit bindings and replace all their instances in the body with()
.