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

perf(parser): Take up less memory with ArgAction::Count #3810

Merged
merged 2 commits into from
Jun 9, 2022

Commits on Jun 9, 2022

  1. Configuration menu
    Copy the full SHA
    acfb130 View commit details
    Browse the repository at this point in the history
  2. perf(parser): Take up less memory with ArgAction::Count

    Someone should not reasonably expect a coun flag to go up to billions,
    millions, or even thousands.  255 should be sufficient for anyone,
    right?
    
    The original type was selected to be consistent with
    `ArgMatches::occurrences_of` but that is also used for tracking how
    many values appear which can be large with `xargs`.
    
    I'm still conflicted on what the "right type" is an wish we could
    support any numeric type.  When I did a search on github though, every
    case was for debug/quiet flags and only supported 2-3 occurrences,
    making a `u8` overkill.
    
    This came out of a discussion on clap-rs#3792
    epage committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    31b22d1 View commit details
    Browse the repository at this point in the history