Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sourcefrog opened this issue Apr 12, 2024 · 0 comments
Open
Labels
generate Patterns of mutation

Comments

@sourcefrog
Copy link
Owner

sourcefrog commented Apr 12, 2024

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 sourcefrog added the generate Patterns of mutation label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
generate Patterns of mutation
Projects
None yet
Development

No branches or pull requests

1 participant