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

fix: Misc clean up in prep for #2688 #3999

Merged
merged 9 commits into from Jul 28, 2022
Merged

fix: Misc clean up in prep for #2688 #3999

merged 9 commits into from Jul 28, 2022

Conversation

epage
Copy link
Member

@epage epage commented Jul 28, 2022

Splitting this out and getting it merged so I can more easily iterate on different approaches to resolving #2688.

With `number_of_values` being per-occurrence now, its doesn't make sense
for `number_of_values(0)` to set `takes_value(true)` or for
`number_of_values(1)` to set `multiple_values(true)`.

In addition, an assert is made if the user works around this
Rendering of usage is not in a critical path, so should be more worried
about binary size than performance.  That only leaves avoiding coloring
spaces.  That shouldn't be a problem, so let's make the binary smaller.
@epage
Copy link
Member Author

epage commented Jul 28, 2022

btw according to cargo-bloat, this saved us 2k in .text

I ran

$  cargo bloat --release --example cargo-example --features cargo

@epage epage merged commit 4887695 into clap-rs:master Jul 28, 2022
@epage epage deleted the usage branch July 28, 2022 20:25
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

1 participant