- try_rewrite_without_block(block, fn_decl, &prefix, context, shape, body_shape).or_else(|| {
+ // The body of the closure is an empty block.
+ if block.stmts.is_empty() && !block_contains_comment(block, context.codemap) {
+ return Some(format!("{} {{}}", prefix));
+ }
+
+ let result = match fn_decl.output {
+ ast::FunctionRetTy::Default(_) => {
+ try_rewrite_without_block(body, &prefix, context, shape, body_shape)
+ }
+ _ => None,
+ };
+
+ result.or_else(|| {