From be45ccd203262833fbc829dc36756e5ebf2f35c4 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 18 Nov 2018 14:57:18 +0100 Subject: [PATCH] fix getopts when called without any argument --- src/getopts.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/getopts.rs b/src/getopts.rs index 074899ea..fe3e844e 100644 --- a/src/getopts.rs +++ b/src/getopts.rs @@ -60,7 +60,7 @@ pub fn parse_arguments( let mut skip = false; - loop { + while pos < args.len() { if skip { rest.push(args[pos].clone()); } else { @@ -127,7 +127,6 @@ pub fn parse_arguments( } pos += 1; - if pos >= args.len() { break; } } for i in 0..arg_param.len() {