Skip to content

Commit

Permalink
fix(assert)!: Prevent require equal when it won't work
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Aug 3, 2022
1 parent ed3aa30 commit e4e8126
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/builder/debug_asserts.rs
Expand Up @@ -714,6 +714,15 @@ fn assert_arg(arg: &Arg) {
arg.name,
num_vals,
);

if 1 < num_vals.min_values() {
assert!(
!arg.is_require_equals_set(),
"Argument {}: cannot accept more than 1 arg (num_args={}) with require_equals",
arg.name,
num_vals
);
}
}
if arg.get_num_args() == Some(1.into()) {
assert!(
Expand Down

0 comments on commit e4e8126

Please sign in to comment.