sourcefrog / cargo-mutants

:zombie: Inject bugs and see if your tests catch them!

Home Page:https://mutants.rs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

sourcefrog opened this issue · 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.