-
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
fix: manual_unwrap_or_default
suggests falsely when condition type is uncertain
#13889
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Jarcho (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
ca507e7
to
e6044a5
Compare
r? clippy |
MANUAL_UNWRAP_OR_DEFAULT, | ||
expr.span, | ||
format!("{expr_name} can be simplified with `.unwrap_or_default()`"), | ||
format!("explicit the type {expr_type} and replace your expression with"), |
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.
format!("explicit the type {expr_type} and replace your expression with"), | |
format!("ascribe the type {expr_type} and replace your expression with"), |
Or we could maybe even do a multispan suggestion using a empty span at the end of the let
pattern, to be replaced with the type.
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.
updated
Can you squash your commits, please? |
squashed |
Thank you! |
fixes #12670
Continuation of #12688. r? @Jarcho if you don't mind?
changelog: [
manual_unwrap_or_default
] fix wrong suggestions when condition type is uncertain