diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2018-09-11 08:41:16 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2018-09-11 08:54:43 +0300 |
| commit | 838df8dfb60e8a17b3b3b43a642da0d8ca9828e2 (patch) | |
| tree | e4b3ef7a65e3d770e5beddf87ce49fa8c4cdad26 /src/expr.rs | |
| parent | f116baeed7072d7126c4cf844dbd02fc4e49080f (diff) | |
Use correct heuristic for match block flattening
Diffstat (limited to 'src/expr.rs')
| -rw-r--r-- | src/expr.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/expr.rs b/src/expr.rs index 329081f5d70..fef4a024cf5 100644 --- a/src/expr.rs +++ b/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, |
