Skip to content

unnested_or_patterns can actually expand code (in text size) #6973

@matthiaskrgr

Description

@matthiaskrgr
#![warn(clippy::unnested_or_patterns)]
pub enum E {
    A,
    B,
}


pub fn a(enm: &E) {
    match enm {
        &E::A | &E::B => {} 
    }
}


pub fn main() {}

clippy will suggest to use
&(E::A | E::B) instead of
&E::A | &E::B
this actually makes the code a bit bigger.
Is this intended?

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't havegood 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