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

Refactor ZFS filesystem ensure arguments #7237

Closed
smklein opened this issue Dec 12, 2024 · 0 comments · Fixed by #7246
Closed

Refactor ZFS filesystem ensure arguments #7237

smklein opened this issue Dec 12, 2024 · 0 comments · Fixed by #7246
Assignees
Labels
cleanup Code cleanliness

Comments

@smklein
Copy link
Collaborator

smklein commented Dec 12, 2024

          Not really this PR's fault, but it contributes: the args to this method can be borderline unreadable at call sites, IMO. Really wish we had a nice way to do keyed arguments. Maybe this method is worth having something like
pub struct EnsureFilesystemArgs<'a> {
    pub name: &'a str,
    pub mountpoint: Mountpoint,
    pub zoned: bool,
    pub do_format: bool,
    pub encryption_details: Option<EncryptionDetails>,
    pub size_details: Option<SizeDetails>,
    pub id: Option<DatasetUuid>,
}

to help? That would also give a nice place to attach the doc comments, too. (If we don't do this, the doc comment needs a new addition for id.)

Originally posted by @jgallagher in #7236 (comment)

@smklein smklein added the cleanup Code cleanliness label Dec 12, 2024
@smklein smklein self-assigned this Dec 12, 2024
smklein added a commit that referenced this issue Dec 13, 2024
- Moves arguments into a struct
- Removes unused "do_format" argument
- Renamed to "ensure_dataset"

Fixes #7237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanliness
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant