cargo-mutants icon indicating copy to clipboard operation
cargo-mutants copied to clipboard

Delete fields from struct literals that have a base (default) expression

Open sourcefrog opened this issue 1 year ago • 0 comments

let cat = Cat {
    name: "Felix", 
    coat: Coat::Tuxedo,
    ..Default::default()
};

We could try deleting name and age in two separate mutations.

https://doc.rust-lang.org/reference/expressions/struct-expr.html

Default::default() is the most common expression but there are cases where it's something else.

sourcefrog avatar Apr 12 '24 15:04 sourcefrog