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));
}
}
_ 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![]))
};
}
}
}