1
Fork 0

libsyntax: Consolidate branch to benefit from exhaustive checking instead of unwrapping

This commit is contained in:
Kevin Butler 2015-10-25 01:07:12 +01:00
parent 998914f5da
commit 1a235274a1

View file

@ -3304,13 +3304,13 @@ impl<'a> Parser<'a> {
pat = PatEnum(path, Some(args)); pat = PatEnum(path, Some(args));
} }
} }
_ if qself.is_some() => {
// Parse qualified path
pat = PatQPath(qself.unwrap(), path);
}
_ => { _ => {
// Parse nullary enum pat = match qself {
pat = PatEnum(path, Some(vec![])); // Parse qualified path
Some(qself) => PatQPath(qself, path),
// Parse nullary enum
None => PatEnum(path, Some(vec![]))
};
} }
} }
} }