Skip to content
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

Swap return value of pipes::init Fixes #4501 #6896

Merged
merged 1 commit into from
Jun 2, 2013
Merged

Swap return value of pipes::init Fixes #4501 #6896

merged 1 commit into from
Jun 2, 2013

Conversation

nickdesaulniers
Copy link

review? @brson

@brson
Copy link
Contributor

brson commented Jun 2, 2013

Thanks! 🎆

bors added a commit that referenced this pull request Jun 2, 2013
@bors bors closed this Jun 2, 2013
@bors bors merged commit ecd08b9 into rust-lang:incoming Jun 2, 2013
@nickdesaulniers nickdesaulniers deleted the issue4501 branch June 2, 2013 06:38
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.~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants