You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lint if lets that could be better worded as equality #1716
This would also affect the single_match lint. Essentially, whenever someone writes a pattern like this:
if let Ordering::Greater = a.cmp(b) { ... }
It would be a bit clearer to write something like this:
if a.cmp(b) == Ordering::Greater { ... }
Specifically, if the left hand side of the if let contains a value that can be constructed directly, and the destructured value implements PartialEq, then is makes a lot more sense to refactor the if let into a direct comparison.
This would also affect the single_match and single_match_else lints to give proper suggestions, i.e. changing:
Activity
Auto merge of #7762 - HKalbasi:master, r=Manishearth
Auto merge of #7762 - HKalbasi:master, r=Manishearth