clippy::redundant_pattern_matching
does not check for matches!()
#10694
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Summary
Uses of the
matches!()
macro - where the first argument is/returns aResult
orOption
, and the second argument only matches the variant but not the value inside the variant (meaningOk(_)
,Err(_)
,Some(_)
, andNone
) - do not triggerclippy::redundant_pattern_matching
, despite being equivalent to code that would triggerclippy::redundant_pattern_matching
.Lint Name
clippy::redundant_pattern_matching
Reproducer
I tried this code:
which gets expanded to the functional equivalent of:
which should trigger
clippy::redundant_pattern_matching
, and suggest the code be changed to the following:Instead, it did not trigger at all.
Version
The text was updated successfully, but these errors were encountered: