-
Notifications
You must be signed in to change notification settings - Fork 936
Closed
Labels
good first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors
Description
Replace ExprType::Statement
with ExprType::SubExpression
if the statement is the last statement within its enclosing block.
Line 585 in 1cea171
format_expr(ex, ExprType::Statement, context, shape).map(|s| s + suffix) |
One way to implement this is to add a wrapper type over ast::Stmt
which holds the information about whether it's the last statement or not:
struct Statement<'ast> {
stmt: &'ast ast::Stmt,
is_last: bool,
}
cc #3614.
Metadata
Metadata
Assignees
Labels
good first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors