Skip to content

Possible suggestion improvements on match_ref_pats #849

Open

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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