Rust logoRust/
RS-C1010

Found unneeded field patternRS-C1010

Minor severityMinor
Anti-pattern categoryAnti-pattern

This checker looks for struct field patterns bound to wildcards. Prefer .. instead, as it is shorter and directs focus towards fields that are actually bound.

Replace occurrences of wildcard field patterns with the rest operator, ...

Bad practice

match s {
    S { a: 0, b: _, c: _ } => (),
    S { a: _, b: _, c: _, .. } => (),
}
match s {
    S { a: 0, .. } => (),
    S { .. } => (),
}