RS.CLIPPY.WILDCARD_ENUM_MATCH_ARM
A wildcard enum match arm using `_`
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: wildcard_enum_match_arm. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for wildcard enum matches using _.
Why restrict this?
New enum variants added by library updates can be missed.
Known problems
Suggested replacements may be incorrect if guards exhaustively cover some variants, and also may not use correct path to enum if it's not present in the current scope.
Example
match x {
Foo::A(_) => {},
_ => {},
}
Use instead:
match x {
Foo::A(_) => {},
Foo::B(_) => {},
}