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

Make CreateOpts fields public #263

Open
skeet70 opened this issue Apr 14, 2022 · 2 comments
Open

Make CreateOpts fields public #263

skeet70 opened this issue Apr 14, 2022 · 2 comments

Comments

@skeet70
Copy link
Member

skeet70 commented Apr 14, 2022

Right now you either enumerate all the fields on a struct, or use default to get only defaults. Neither of those is super useful, most likely you just want a few fields set at a time and everything else default. Making fields public would enable the normal pattern of

GroupCreateOpts {
    name: Some("word up".to_string()),
    ..Default::default()
}
@BobWall23
Copy link
Member

Didn't want to make fields public so that we can force validation. Need to investigate alternatives - builder pattern might work. Might be able to make fields public if the right validation pattern is available.

@BobWall23
Copy link
Member

Once we figure out a pattern, should probably do the same for other larger Opt structs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants