diff options
| author | Kevin Butler <haqkrs@gmail.com> | 2015-10-25 01:07:12 +0100 |
|---|---|---|
| committer | Kevin Butler <haqkrs@gmail.com> | 2015-10-25 01:34:45 +0100 |
| commit | 1a235274a1aec01d8bf7f30e1631fba62e2ca411 (patch) | |
| tree | d3b6cb75a5dbca89f669428793f98c0e774ccbae /src/libsyntax/parse | |
| parent | 998914f5da91bd6e07a0bdf45612dcd446e6fa94 (diff) | |
| download | rust-1a235274a1aec01d8bf7f30e1631fba62e2ca411.tar.gz rust-1a235274a1aec01d8bf7f30e1631fba62e2ca411.zip | |
libsyntax: Consolidate branch to benefit from exhaustive checking instead of unwrapping
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 7bc9441fb9d..02faf315f01 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3304,13 +3304,13 @@ impl<'a> Parser<'a> { pat = PatEnum(path, Some(args)); } } - _ if qself.is_some() => { - // Parse qualified path - pat = PatQPath(qself.unwrap(), path); - } _ => { - // Parse nullary enum - pat = PatEnum(path, Some(vec![])); + pat = match qself { + // Parse qualified path + Some(qself) => PatQPath(qself, path), + // Parse nullary enum + None => PatEnum(path, Some(vec![])) + }; } } } |
