Open
Description
What it does
Looks for unnecessary uses of matches!
that can be replaced with ==
or !=
Advantage
Using matches!
can produce unnecessarily complex code. When negated, you also get the "double-bang" confusion of !matches!(…)
, where tje twp !
means different things.
Drawbacks
No response
Example
if !matches!(value, Enum::Variant) { …
Could be written as:
if value != Enum::Variant { …