-
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
add [assertions_on_result_states]
lint
#9225
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @xFrednet (or someone else) soon. Please see the contribution instructions for more information. |
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.
Two small things, and then one suggested extension which should be easy enough to add.
Can you also add a check for is_err
with the suggestion to use unwrap_err
to the same lint. Could be named something like assert_result_state
.
@Jarcho Thanks for the review.
Forget it, I was being silly. |
There's one more issue to handle after the previous smaller things. This change does result in a behaviour change. Namely If you want to go further you can check if the value is both movable, and not used afterwards. I wouldn't recommend this for the current PR as it's a fair amount of extra work. |
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.
Everything looks good. You can just squash it down and we're good to merge.
Signed-off-by: tabokie <[email protected]>
@Jarcho It's done. Thanks. |
Thank you. @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Close #9162
changelog: add
[assertions_on_result_states]
lintSigned-off-by: tabokie [email protected]