-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #4455 - flip1995:unit_arg_appl, r=phansch
Rework suggestion generation of `unit_arg` lint Found this bug while running `cargo fix --clippy` on quite a big codebase: This would replace something like: ```rust Some(fn_that_actually_does_something(&a, b)) ``` with ```rust Some(()) ``` which obviously suppresses side effects. Since pretty much every expression could have side effects, I think making this suggestion `MaybeIncorrect` is the best thing to do here. A correct suggestion would be: ```rust fn_that_actually_does_something(&a, b); Some(()) ``` Somehow the suggestion is not correctly applied to the arguments, when more than one argument is a unit value. I have to look into this a little more, though. changelog: Fixes suggestion of `unit_arg` lint, so that it suggests semantic equivalent code Fixes #4741
- Loading branch information
Showing
6 changed files
with
353 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.