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

Port default_value_t to the Builder API #3807

Open
epage opened this issue Jun 9, 2022 · 1 comment
Open

Port default_value_t to the Builder API #3807

epage opened this issue Jun 9, 2022 · 1 comment
Labels
A-builder Area: Builder API C-enhancement Category: Raise on the bar on expectations S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing

Comments

@epage
Copy link
Member

epage commented Jun 9, 2022

With #3732, we now have a typed API. This means we can move the derive's default_value_t down into the builder API

This would supersede #2813

@epage epage added C-enhancement Category: Raise on the bar on expectations A-builder Area: Builder API S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing labels Jun 9, 2022
@epage
Copy link
Member Author

epage commented Jun 9, 2022

This requires the ability to render a string for help.

I would suggest TypedValueParser gaining

fn display(&self) -> Option<String> {
    None
}

We would then provide it for all of the built-in value parsers. The question is if we should make ToString a requirement for the FromStr blanket impl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builder Area: Builder API C-enhancement Category: Raise on the bar on expectations S-waiting-on-design Status: Waiting on user-facing design to be resolved before implementing
Projects
None yet
Development

No branches or pull requests

1 participant