Refactor parse_expr_res
.
This removes the final `Option<AttrWrapper>` argument.
This commit is contained in:
parent
43eae4cef4
commit
8170acb197
5 changed files with 33 additions and 28 deletions
|
@ -126,9 +126,9 @@ impl<'a> Parser<'a> {
|
|||
// Remainder are line-expr stmts.
|
||||
let e = match force_collect {
|
||||
ForceCollect::Yes => self.collect_tokens_no_attrs(|this| {
|
||||
this.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs))
|
||||
this.parse_expr_res(Restrictions::STMT_EXPR, attrs)
|
||||
})?,
|
||||
ForceCollect::No => self.parse_expr_res(Restrictions::STMT_EXPR, Some(attrs))?,
|
||||
ForceCollect::No => self.parse_expr_res(Restrictions::STMT_EXPR, attrs)?,
|
||||
};
|
||||
if matches!(e.kind, ExprKind::Assign(..)) && self.eat_keyword(kw::Else) {
|
||||
let bl = self.parse_block()?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue