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: factor out DenoSubcommand enum variant into structs #11896

Merged
merged 4 commits into from
Sep 3, 2021

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Sep 1, 2021

}

impl Default for DenoSubcommand {
fn default() -> DenoSubcommand {
DenoSubcommand::Repl { eval: None }
DenoSubcommand::Repl(ReplFlags { eval: None })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should implement default for the new command flag sets as-well?

filter,
shuffle,
concurrent_jobs,
test_flags.include,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is pretty much exactly what I had in mind.
I'll follow up with a cleanup of these signatures.

@@ -3665,7 +3712,7 @@ mod tests {
assert_eq!(
r.unwrap(),
Flags {
subcommand: DenoSubcommand::Test {
subcommand: DenoSubcommand::Test(TestFlags {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests could be simpler if we used defaults.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, but I think this could be done in a follow up

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for doing this!

@bartlomieju bartlomieju merged commit 44ca3ce into denoland:main Sep 3, 2021
@bartlomieju bartlomieju deleted the refactor_flags branch September 3, 2021 23:33
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

Successfully merging this pull request may close these issues.

None yet

3 participants