mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 22:32:33 +00:00
fixed unique_args tests
This commit is contained in:
parent
deb9fc91f6
commit
b48ef85ece
2 changed files with 1 additions and 5 deletions
|
@ -1590,11 +1590,6 @@ impl<'a, 'b> App<'a, 'b> {
|
|||
// Perform expensive assertions on the Arg instance
|
||||
fn _arg_debug_asserts(&self, a: &Arg) -> bool {
|
||||
debugln!("App::_arg_debug_asserts:{}", a.name);
|
||||
// No naming conflicts
|
||||
assert!(
|
||||
arg_names!(self).fold(0, |acc, n| if n == a.name { acc + 1 } else { acc }) < 2,
|
||||
format!("Non-unique argument name: {} is already in use", a.name)
|
||||
);
|
||||
|
||||
// Long conflicts
|
||||
if let Some(l) = a.long {
|
||||
|
|
|
@ -48,6 +48,7 @@ where
|
|||
.map(|&x| (x, &self.value_index[x]))
|
||||
.find(|(_i, x)| x == &&value)
|
||||
}) {
|
||||
debug_assert!(false, "Non-unique value found");
|
||||
index = idx;
|
||||
} else {
|
||||
self.value_index.push(value);
|
||||
|
|
Loading…
Reference in a new issue