1
Fork 0

parse: refactor fun ret ty & param ty

This commit is contained in:
Mazdak Farrokhzad 2019-12-01 16:00:08 +01:00
parent 404013e015
commit 34d91709b6
12 changed files with 77 additions and 107 deletions

View file

@ -182,11 +182,7 @@ impl<'a> Parser<'a> {
// `(T, U) -> R`
let (inputs, _) = self.parse_paren_comma_seq(|p| p.parse_ty())?;
let span = ident.span.to(self.prev_span);
let output = if self.eat(&token::RArrow) {
Some(self.parse_ty_common(false, false, false)?)
} else {
None
};
let output = self.parse_ret_ty(false, false)?;
ParenthesizedArgs { inputs, output, span }.into()
};