Rust

Rust

Made by DeepSource

Found unneeded field pattern RS-C1010

Anti-pattern
Minor
Autofix

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: _, .. } => (),
}

Recommended

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