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

Small case left out by clippy::match_like_matches_macro #6346

Closed
kamulos opened this issue Nov 19, 2020 · 3 comments
Closed

Small case left out by clippy::match_like_matches_macro #6346

kamulos opened this issue Nov 19, 2020 · 3 comments
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@kamulos
Copy link

kamulos commented Nov 19, 2020

Just a suggestion for a small improvement:

This code gets a suggestion from clippy::match_like_matches_macro

    match &args[1][..] {
        "--version" => true,
        _ => false,
    }

While this one does not, while it still benefits from being converted to the matches macro:

    match &args[1][..] {
        "-v" => true,
        "--version" => true,
        _ => false,
    }
@kamulos kamulos added the C-bug Category: Clippy is not doing the correct thing label Nov 19, 2020
@giraffate
Copy link
Contributor

Could you provide an example on playground? I tried this on playground but the lint was emitted.

@giraffate
Copy link
Contributor

#6216 may have fixed this case. I think this would be released at next beta release(Rust 1.49).

@flip1995
Copy link
Member

Yes, I remember putting this in the changelog for beta today. This is linted in nightly (and soon on beta)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

No branches or pull requests

3 participants