Skip to content

Unneeded multiple pattern with wildcard #4640

Closed
@ghost

Description

Any multiple patterns with the wildcard pattern can be removed as the wildcard will match anyway

match "foo" {
    "a" => {
        dbg!("matched a");
    }
    "bar" | _ => {
        dbg!("bar or wildcat");
    }
}

Should be written as

match "foo" {
    "a" => {
        dbg!("matched a");
    }
    _ => {
        dbg!("matched (bar or) wildcard");
    }
}

cc #1272

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-complexityLint: Belongs in the complexity lint groupL-suggestionLint: Improving, adding or fixing lint suggestionsgood 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