Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend single_match to handle return #929

Closed
mrmonday opened this issue May 15, 2016 · 2 comments
Closed

Extend single_match to handle return #929

mrmonday opened this issue May 15, 2016 · 2 comments
Labels
good-first-issue These issues are a good way to get started with Clippy S-needs-discussion Status: Needs further discussion before merging or work can be started

Comments

@mrmonday
Copy link
Contributor

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.

@mcarton
Copy link
Member

mcarton commented May 15, 2016

It was decided in #327 to limit the lint to enum we know will never be extended.
But we could have another allow-by-default lint for that.

@mcarton mcarton added good-first-issue These issues are a good way to get started with Clippy S-needs-discussion Status: Needs further discussion before merging or work can be started labels May 15, 2016
@camsteffen
Copy link
Contributor

This is now covered by single_match_else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue These issues are a good way to get started with Clippy S-needs-discussion Status: Needs further discussion before merging or work can be started
Projects
None yet
Development

No branches or pull requests

4 participants