From 4d3760a0b3f5bebe15794929efc5e809c4538bca Mon Sep 17 00:00:00 2001 From: CreepySkeleton Date: Mon, 20 Apr 2020 13:51:48 +0300 Subject: [PATCH] =?UTF-8?q?Correctly=20handle=20`-=E7=A3=A8FOO`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parse/parser.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 1046bdf3..9c00d32f 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -367,7 +367,8 @@ where self.app.args.insert_key(k, i); } - debug_assert!(self._verify_positionals()); + #[cfg(debug_assertions)] + self._verify_positionals(); // Set the LowIndexMultiple flag if required if positionals!(self.app).any(|a| { @@ -1214,7 +1215,7 @@ where p[0].as_bytes(), p[1].as_bytes() ); - let i = p[0].as_bytes().len() + 1; + let i = p[0].as_bytes().len() + c.len_utf8(); let val = if !p[1].is_empty() { debugln!( "Parser::parse_short_arg:iter:{}: val={:?} (bytes), val={:?} (ascii)",