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

is_multiple shouldn't require &mut self #4708

Open
2 tasks done
klnusbaum opened this issue Feb 14, 2023 · 0 comments
Open
2 tasks done

is_multiple shouldn't require &mut self #4708

klnusbaum opened this issue Feb 14, 2023 · 0 comments
Labels
A-builder Area: Builder API C-bug Category: Updating dependencies E-easy Call for participation: Experience needed to fix: Easy / not much M-breaking-change Meta: Implementing or merging this will introduce a breaking change.
Milestone

Comments

@klnusbaum
Copy link

klnusbaum commented Feb 14, 2023

Please complete the following tasks

Clap Version

4.1.4

Describe your use case

ArgGroup::is_multiple requires a &mut self, yet the function does not itself do any mutations to the ArgGroup. The &mut is unnecessary. It also means that when you have an immutable reference to an ArgGroup (like the one you would get from calling groups() on a command), you can't check it the group allows multiple options.

Describe the solution you'd like

We should remove the &mut from the function signature.

Alternatives, if applicable

No response

Additional Context

No response

@klnusbaum klnusbaum added the C-enhancement Category: Raise on the bar on expectations label Feb 14, 2023
@epage epage added C-bug Category: Updating dependencies M-breaking-change Meta: Implementing or merging this will introduce a breaking change. A-builder Area: Builder API E-easy Call for participation: Experience needed to fix: Easy / not much and removed C-enhancement Category: Raise on the bar on expectations labels Feb 14, 2023
@epage epage added this to the 5.0 milestone Feb 14, 2023
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-bug Category: Updating dependencies E-easy Call for participation: Experience needed to fix: Easy / not much M-breaking-change Meta: Implementing or merging this will introduce a breaking change.
Projects
None yet
Development

No branches or pull requests

2 participants