@@ -55,7 +55,7 @@ pub(crate) fn rewrite_closure(
55
55
// 1 = space between `|...|` and body.
56
56
let body_shape = shape. offset_left ( extra_offset, span) ?;
57
57
58
- if let ast:: ExprKind :: Block ( ref block, ref label ) = body. kind {
58
+ if let ast:: ExprKind :: Block ( ref block, _ ) = body. kind {
59
59
// The body of the closure is an empty block.
60
60
if block. stmts . is_empty ( ) && !block_contains_comment ( context, block) {
61
61
return body
@@ -72,7 +72,7 @@ pub(crate) fn rewrite_closure(
72
72
73
73
result. or_else ( |_| {
74
74
// Either we require a block, or tried without and failed.
75
- rewrite_closure_block ( block , label , & prefix, context, body_shape)
75
+ rewrite_closure_block ( body , & prefix, context, body_shape)
76
76
} )
77
77
} else {
78
78
rewrite_closure_expr ( body, & prefix, context, body_shape) . or_else ( |_| {
@@ -236,26 +236,16 @@ fn rewrite_closure_expr(
236
236
237
237
// Rewrite closure whose body is block.
238
238
fn rewrite_closure_block (
239
- block : & ast:: Block ,
240
- label : & Option < Label > ,
239
+ block : & ast:: Expr ,
241
240
prefix : & str ,
242
241
context : & RewriteContext < ' _ > ,
243
242
shape : Shape ,
244
243
) -> RewriteResult {
245
- if let Some ( label) = label {
246
- Ok ( format ! (
247
- "{} {}: {}" ,
248
- prefix,
249
- context. snippet( label. ident. span) ,
250
- block. rewrite_result( context, shape) ?
251
- ) )
252
- } else {
253
- Ok ( format ! (
254
- "{} {}" ,
255
- prefix,
256
- block. rewrite_result( context, shape) ?
257
- ) )
258
- }
244
+ Ok ( format ! (
245
+ "{} {}" ,
246
+ prefix,
247
+ block. rewrite_result( context, shape) ?
248
+ ) )
259
249
}
260
250
261
251
// Return type is (prefix, extra_offset)
0 commit comments