-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add "unnecessary mut passed" lint #354
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
Conversation
}, | ||
ExprMethodCall(ref name, _, ref arguments) => { | ||
let method_call = MethodCall::expr(e.id); | ||
let borrowed_table = cx.tcx.tables.borrow(); |
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.
These two blocks are almost duplicated. It should be possible to factor the common code out into a helper method.
A few test cases would be nice :) |
Thanks for the feedback 😄. I'm still a bit new to rust, but it get's better every day. |
Any idea why this build is failing? The file that the compiler complained about hasn't changed. |
We needed a rustup. Fixed |
Add "unnecessary mut passed" lint
Sorry about forgetting about this |
This is the implementation of the first lint mentioned in issue #353. I tested it on some external crates (racer, winapi-rs, ...) and some of my own projects, seems to work properly.
Note that this doesn't work for methods currently.
Edit: It does now.