mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
Auto merge of #441 - kbknapp:vecmap-update, r=kbknapp
Update VecMap to 0.6 @alexbool This is the new PR for your commit - no further action required, all rebasing is good!
This commit is contained in:
commit
e2c104c8c5
2 changed files with 6 additions and 6 deletions
|
@ -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 }
|
||||
|
|
|
@ -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)));
|
||||
|
|
Loading…
Reference in a new issue