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

Suggestions for toplevel_ref_arg should not move mut to the right-hand side #3110

Open
joshtriplett opened this issue Sep 2, 2018 · 0 comments

Comments

@joshtriplett
Copy link
Member

When clippy sees code like this:

let ref mut foo = false;

It'll suggest changing it to this:

let foo = &mut false;

However, while ref on the left-hand side is not idiomatic Rust, mut on the left-hand side is, and often the code would look much clearer if written as:

let mut foo = false;

(With corresponding changes to code using foo.)

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

No branches or pull requests

1 participant