Skip to content

Commit 1a23527

Browse files
committed
libsyntax: Consolidate branch to benefit from exhaustive checking instead of unwrapping
1 parent 998914f commit 1a23527

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3304,13 +3304,13 @@ impl<'a> Parser<'a> {
33043304
pat = PatEnum(path, Some(args));
33053305
}
33063306
}
3307-
_ if qself.is_some() => {
3308-
// Parse qualified path
3309-
pat = PatQPath(qself.unwrap(), path);
3310-
}
33113307
_ => {
3312-
// Parse nullary enum
3313-
pat = PatEnum(path, Some(vec![]));
3308+
pat = match qself {
3309+
// Parse qualified path
3310+
Some(qself) => PatQPath(qself, path),
3311+
// Parse nullary enum
3312+
None => PatEnum(path, Some(vec![]))
3313+
};
33143314
}
33153315
}
33163316
}

0 commit comments

Comments
 (0)