Skip to content

Extend single_match to handle return #929

Closed
@mrmonday

Description

@mrmonday

In the following code:

enum Foo {
    Bar(u8), Baz
}

fn main() {
    match Foo::Bar(3) {
        Foo::Bar(_) => { /* do something */ },
        _ => { return; }
    }
}

Clippy produces no warning, but it could produce the single_match warning instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-needs-discussionStatus: Needs further discussion before merging or work can be startedgood 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