Skip to content

Commit 8ea5d46

Browse files
Merge #575
575: Do no panic when passed empty string as argument. closes #466 r=Emilgardis a=sudipghimire533 When parsing argument `parse()` function in `src/cli.rs` splits the argument string without checking length which results in panic when splitting empty string. This PR pix that issue by introducing `continue` on empty string. Co-authored-by: Sudip Ghimire <[email protected]>
2 parents dc2e724 + e73c465 commit 8ea5d46

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cli.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ pub fn parse(target_list: &TargetList) -> Args {
2525
{
2626
let mut args = env::args().skip(1);
2727
while let Some(arg) = args.next() {
28+
if arg.is_empty() {
29+
continue;
30+
}
2831
if let ("+", ch) = arg.split_at(1) {
2932
channel = Some(ch.to_string());
3033
} else if arg == "--target" {

0 commit comments

Comments
 (0)