Skip to content

Possible suggestion improvements on match_ref_pats #849

Open
@llogiq

Description

@llogiq

Another example from Carboxyl:

        match &mut *current.borrow_mut() {
            &mut Some(ref mut trans) => action(trans),
            _ => panic!("there is no active transaction to register a callback"),
        }

Our lint suggests using match *&mut *current.borrow_mut() { .. } while actually match *current.borrow_mut() { .. } (and removing &mut in the arm) will suffice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesT-ASTType: Requires working with the ASTgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions