-
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
New lint [needless_return_with_question_mark
]
#11031
Conversation
r? @giraffate (rustbot has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #11061) made this pull request unmergeable. Please resolve the merge conflicts. |
I didn't immediately understand |
I'm fine with that, |
97e6924
to
77512cd
Compare
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.
Overall looks good, thanks! I made some comments.
/// Ok(()) | ||
/// } | ||
/// ``` | ||
/// if paired with `try_err`, use instead: |
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.
IMO it would be better to change suggestions by using is_lint_allowed
when warning try_err
, but it can be done in another pull request.
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.
We should probably move around try_err
then, probably to returns
instead of matches
, that way we can reuse the logic. But I'm ok with this.
Okay. Then can we update the version #11031 (comment) ? |
Yeah, but I'll also move |
This actually seems too complex to tackle rn, I'll take another look at some point and potentially create a followup PR |
@bors r+ Thanks! |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
needless_return_with_try
]needless_return_with_question_mark
]
Closes #10902
Rather than having a config option, this will just suggest removing the "return"; if
try_err
is used as well, then it'll be added again but without the?
.changelog: New lint [
needless_return_with_try
]