-
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
Destructure args in methods
#6913
Conversation
r? @flip1995 (rust-highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #6896) made this pull request unmergeable. Please resolve the merge conflicts. |
33a5600
to
966494f
Compare
methods
methods
☔ The latest upstream changes (presumably #6952) made this pull request unmergeable. Please resolve the merge conflicts. |
966494f
to
0193ffa
Compare
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.
I kinda disliked the first version of this PR, because I thought it made the logic harder. But I really like this version now. Great work!
☔ The latest upstream changes (presumably #6342) made this pull request unmergeable. Please resolve the merge conflicts. |
0193ffa
to
2108387
Compare
@bors r=flip1995 |
📌 Commit 2108387 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
changelog: none
This changes the main pattern in
methods
to match and destructure the method call args at the same time as the method name, and pass individual argExpr
s to the lint impls.This makes the code safer since there is no risk of out of bounds
args[n]
everywhere. There will be no more collectingmethod_names
,arg_lists
,method_spans
as a separate step - everything comes out of thematch
es. Chained methods are parsed in a nestedmatch
. This makes the code more verbose in some ways, but IMO it is much easier to follow.Definitely should wait for #6896. Just putting out the idea.