Swap return value of pipes::init Fixes #4501#6896
Merged
bors merged 1 commit intorust-lang:incomingfrom Jun 2, 2013
nickdesaulniers:issue4501
Merged
Swap return value of pipes::init Fixes #4501#6896bors merged 1 commit intorust-lang:incomingfrom nickdesaulniers:issue4501
bors merged 1 commit intorust-lang:incomingfrom
nickdesaulniers:issue4501
Conversation
Contributor
|
Thanks! 🎆 |
bors
added a commit
that referenced
this pull request
Jun 2, 2013
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Mar 25, 2021
…le, r=phansch Refactor lints in methods module This PR refactors methods lints other than the lints I refactored in rust-lang/rust-clippy#6826 and moves some functions to methods/utils.rs. Basically, I follow the instruction described in rust-lang#6680. **For ease of review, I refactored step by step, keeping each commit small.** closes rust-lang/rust-clippy#6886 cc: `@phansch,` `@flip1995,` `@Y-Nak` changelog: Move lints in methods module to their own modules and some function to methods/utils.rs.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Apr 8, 2021
Destructure args in `methods`
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 arg `Expr`s to the lint impls.
```rust
// before
["expect", ..] => expect::check(cx, expr, arg_lists[0]);
// after
("expect", [arg]) => expect::check(cx, expr, recv, arg);
```
This makes the code safer since there is no risk of out of bounds `args[n]` everywhere. There will be no more collecting `method_names`, `arg_lists`, `method_spans` as a separate step - everything comes out of the `match`es. Chained methods are parsed in a nested `match`. This makes the code more verbose in some ways, but IMO it is much easier to follow.
~Definitely should wait for rust-lang#6896. Just putting out the idea.~
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
review? @brson