fixed unique_args tests

This commit is contained in:
Alena Yuryeva 2018-08-11 21:32:06 +03:00
parent deb9fc91f6
commit b48ef85ece
2 changed files with 1 additions and 5 deletions

View file

@ -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 {

View file

@ -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);