Skip to content

Commit

Permalink
Un-invert a needlessly inverted condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 17, 2024
1 parent 398d873 commit 87d4485
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,7 @@ pub(crate) fn parse(f: &mut RustFlags) -> Option<Flag> {
arg
};
(constructor, arg)
} else if !f.encoded[f.pos..].starts_with('-') {
match f.encoded[f.pos..].find(SEPARATOR) {
// `nonflag` ...
Some(i) => f.pos += i + 1,
// `nonflag`$
None => f.pos = f.encoded.len(),
}
continue;
} else {
} else if f.encoded[f.pos..].starts_with('-') {
match f.encoded[f.pos + 1..].chars().next() {
// `-` ...
Some(SEPARATOR) => {
Expand Down Expand Up @@ -449,6 +441,14 @@ pub(crate) fn parse(f: &mut RustFlags) -> Option<Flag> {
continue;
}
}
} else {
match f.encoded[f.pos..].find(SEPARATOR) {
// `nonflag` ...
Some(i) => f.pos += i + 1,
// `nonflag`$
None => f.pos = f.encoded.len(),
}
continue;
};

enum ConstructorFn {
Expand Down

0 comments on commit 87d4485

Please sign in to comment.