-
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
trigger obfuscated_if_else
for .then(..).unwrap_or(..)
#14021
trigger obfuscated_if_else
for .then(..).unwrap_or(..)
#14021
Conversation
0fb2747
to
4eb060d
Compare
52e688c
to
ef52d42
Compare
Also I'm willing to implement for other patterns that should be covered by |
ef52d42
to
190af4c
Compare
May I ask why you don't want to do it in this PR? As far as I can tell, those patterns are all pretty similar and can be split into three categories:
Or are there some subtleties I am missing there? |
Aren't there quite a lot of patterns that should really be handled by |
In my opinion, this lint is for something which doesn't return an
I'll open an issue btw since this gave us a chance to notice that it doesn't detect side effects (not caused by your PR of course). |
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.
Only a few small nits, otherwise this looks good to me.
190af4c
to
f42093c
Compare
f42093c
to
db97768
Compare
Thank you! |
part of #9100
The
obfuscated_if_else
lint currently only triggers for the pattern.then_some(..).unwrap_or(..)
, but there're other cases where this lint should be triggered, one of which is.then(..).unwrap_or(..)
.changelog: [
obfuscated_if_else
]: trigger lint for the.then(..).unwrap_or(..)
pattern as well