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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/builder/arg_group.rs
Expand Up @@ -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

self.multiple
}

Expand Down Expand Up @@ -577,10 +577,10 @@ mod test {
fn arg_group_expose_is_multiple_helper() {
let args: Vec<Id> = vec!["a1".into(), "a4".into()];

let mut grp_multiple = ArgGroup::new("test_multiple").args(&args).multiple(true);
let grp_multiple = ArgGroup::new("test_multiple").args(&args).multiple(true);
assert!(grp_multiple.is_multiple());

let mut grp_not_multiple = ArgGroup::new("test_multiple").args(&args).multiple(false);
let grp_not_multiple = ArgGroup::new("test_multiple").args(&args).multiple(false);
assert!(!grp_not_multiple.is_multiple());
}

Expand Down