diff --git a/Cargo.toml b/Cargo.toml index f69aed55..bcec105a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["argument", "command", "arg", "parser", "parse"] [dependencies] bitflags = "~0.4" -vec_map = "~0.4" +vec_map = "~0.6" ansi_term = { version = "~0.7.2", optional = true } strsim = { version = "~0.4.0", optional = true } yaml-rust = { version = "~0.3", optional = true } diff --git a/src/app/parser.rs b/src/app/parser.rs index 93a010c7..5450bb0b 100644 --- a/src/app/parser.rs +++ b/src/app/parser.rs @@ -147,7 +147,7 @@ impl<'a, 'b> Parser<'a, 'b> where 'a: 'b { } else { a.index.unwrap() as usize }; - assert!(!self.positionals.contains_key(&i), + assert!(!self.positionals.contains_key(i), format!("Argument \"{}\" has the same index as another positional \ argument\n\n\tPerhaps try .multiple(true) to allow one positional argument \ to take multiple values", a.name)); @@ -479,7 +479,7 @@ impl<'a, 'b> Parser<'a, 'b> where 'a: 'b { } } - if let Some(p) = self.positionals.get(&pos_counter) { + if let Some(p) = self.positionals.get(pos_counter) { parse_positional!(self, p, arg_os, pos_only, pos_counter, matcher); } else { if self.settings.is_set(AppSettings::AllowExternalSubcommands) { @@ -1172,9 +1172,9 @@ impl<'a, 'b> Parser<'a, 'b> where 'a: 'b { if (ma.vals.len() as u64) > num { debugln!("Sending error TooManyValues"); return Err(Error::too_many_values( - ma.vals.get(&ma.vals.keys() - .last() - .expect(INTERNAL_ERROR_MSG)) + ma.vals.get(ma.vals.keys() + .last() + .expect(INTERNAL_ERROR_MSG)) .expect(INTERNAL_ERROR_MSG).to_str().expect(INVALID_UTF8), a, &*self.create_current_usage(matcher)));