Skip to content

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

Open
@joshtriplett

Description

@joshtriplett

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions