Use correct heuristic for match block flattening
This commit is contained in:
parent
f116baeed7
commit
838df8dfb6
4 changed files with 22 additions and 20 deletions
12
src/expr.rs
12
src/expr.rs
|
|
@ -179,11 +179,13 @@ pub fn format_expr(
|
|||
Some(format!("break{}", id_str))
|
||||
}
|
||||
}
|
||||
ast::ExprKind::Yield(ref opt_expr) => if let Some(ref expr) = *opt_expr {
|
||||
rewrite_unary_prefix(context, "yield ", &**expr, shape)
|
||||
} else {
|
||||
Some("yield".to_string())
|
||||
},
|
||||
ast::ExprKind::Yield(ref opt_expr) => {
|
||||
if let Some(ref expr) = *opt_expr {
|
||||
rewrite_unary_prefix(context, "yield ", &**expr, shape)
|
||||
} else {
|
||||
Some("yield".to_string())
|
||||
}
|
||||
}
|
||||
ast::ExprKind::Closure(capture, asyncness, movability, ref fn_decl, ref body, _) => {
|
||||
closures::rewrite_closure(
|
||||
capture, asyncness, movability, fn_decl, body, expr.span, context, shape,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue