-
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
"if let &foo = bar" triggers match_ref_pats #532
Comments
I believe both situations are intentional? |
do you mean intentional by servo or by clippy? imo changing one |
Intentional by clippy. Servo has tons of cases of nonstandard code style since it comes from a time when Rust had different syntax and features and has incrementally updated over Rust changes over time. So there's a lot of old-Rust style left over. For example, Servo had tons of cases of |
alright, i'll just have to believe you on this one :) but i think the documentation can be improved then. it says "checks for matches where all arms match a reference", which doesn't apply to if lets intuitively (although maybe technically). also, an explanation why this makes sense even if there is only one arm would be helpful for newbies. |
in servo,
if let &DisplayItem::StackingContextClass(ref stacking_context) = kid {
triggers match_ref_pats.complete output:
also, match-patterns where only one arm does the dereferencing also triggers it:
The text was updated successfully, but these errors were encountered: