-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix unnecessary_unwrap
emitted twice in closure (#14763)
#14770
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
rustbot has assigned @samueltardieu. Use |
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.
LGTM, except for a minor comment fix to explain why we don't recurse into closures
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.
Can you please squash the commits together? Then it will be ready to be merged.
Sure. |
I have a question. Why using |
No particular reason, except that since You prefer to use the short form? |
No, your change looks good for me. Because I'm new, so I just have some doubts. Thanks for your reply. You can merge it now.😊 |
Sory, I just want to make sure what else do I need to do now? It seems that you need to accept the changes firstly. |
The problem is that
check_fn
is triggered by both function and closure, andvisit_expr
can visit expressions in another closures within a function or closure.So just skip walking in a inner closure.
changelog: Fix [
unnecessary_unwrap
] emitted twice in closure which inside in a function or another closure.Fixes: #14763