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(builder): don't require mut for is_multiple #4704

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

klnusbaum
Copy link

While pursuing an implementation for #4574, I noticed the that the is_multiple function requires a mutable reference to self. But this function is just a simple accessor. The mut requirement is onerous. Let's relax the requirement so that we don't need to have a mutable version of an ArgGroup just to check if it allows multiple arguments.

@@ -270,7 +270,7 @@ impl ArgGroup {
///
/// assert!(group.is_multiple());
/// ```
pub fn is_multiple(&mut self) -> bool {
pub fn is_multiple(&self) -> bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks to b a breaking change as you can no longer capture the function with the old signature (example).

Options:

  • Create an issue and we can flag it for v5
  • Put this change behind the unstable-v5 feature flag

@klnusbaum
Copy link
Author

Oh interesting. I didn't realize this would be a breaking change. My bad. I'll make an issue in a bit and we can just flag it for v5.

In the mean time, I'll just use mut where I need to.

@klnusbaum
Copy link
Author

@epage made a new issue here #4708

@epage epage added the M-breaking-change Meta: Implementing or merging this will introduce a breaking change. label Feb 14, 2023
@epage epage added this to the 5.0 milestone Feb 14, 2023
@epage
Copy link
Member

epage commented Feb 14, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-breaking-change Meta: Implementing or merging this will introduce a breaking change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants