-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Conversation
} | ||
|
||
impl Default for DenoSubcommand { | ||
fn default() -> DenoSubcommand { | ||
DenoSubcommand::Repl { eval: None } | ||
DenoSubcommand::Repl(ReplFlags { eval: None }) |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM.
There was a problem hiding this 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!
Ref #11776 (comment)