@@ -30,8 +30,8 @@ use ast::{MatchArm, Pat};
30
30
//
31
31
// fn handle(action: Action) {
32
32
// match action {
33
- // Action::Move { distance } => (),
34
- // Action::Stop => (),
33
+ // Action::Move { distance } => {}
34
+ // Action::Stop => {}
35
35
// }
36
36
// }
37
37
// ```
@@ -57,7 +57,7 @@ pub(crate) fn fill_match_arms(ctx: AssistCtx) -> Option<Assist> {
57
57
. into_iter ( )
58
58
. filter_map ( |variant| build_pat ( ctx. db , module, variant) )
59
59
. filter ( |variant_pat| is_variant_missing ( & mut arms, variant_pat) )
60
- . map ( |pat| make:: match_arm ( iter:: once ( pat) , make:: expr_unit ( ) ) )
60
+ . map ( |pat| make:: match_arm ( iter:: once ( pat) , make:: expr_empty_block ( ) ) )
61
61
. collect ( )
62
62
} else if let Some ( enum_defs) = resolve_tuple_of_enum_def ( & ctx. sema , & expr) {
63
63
// Partial fill not currently supported for tuple of enums.
@@ -86,7 +86,7 @@ pub(crate) fn fill_match_arms(ctx: AssistCtx) -> Option<Assist> {
86
86
ast:: Pat :: from ( make:: tuple_pat ( patterns) )
87
87
} )
88
88
. filter ( |variant_pat| is_variant_missing ( & mut arms, variant_pat) )
89
- . map ( |pat| make:: match_arm ( iter:: once ( pat) , make:: expr_unit ( ) ) )
89
+ . map ( |pat| make:: match_arm ( iter:: once ( pat) , make:: expr_empty_block ( ) ) )
90
90
. collect ( )
91
91
} else {
92
92
return None ;
@@ -192,8 +192,8 @@ mod tests {
192
192
fn main() {
193
193
match A::As<|> {
194
194
A::As,
195
- A::Bs{x,y:Some(_)} => (),
196
- A::Cs(_, Some(_)) => (),
195
+ A::Bs{x,y:Some(_)} => {}
196
+ A::Cs(_, Some(_)) => {}
197
197
}
198
198
}
199
199
"# ,
@@ -227,8 +227,8 @@ mod tests {
227
227
}
228
228
fn main() {
229
229
match A::As<|> {
230
- A::Bs{x,y:Some(_)} => (),
231
- A::Cs(_, Some(_)) => (),
230
+ A::Bs{x,y:Some(_)} => {}
231
+ A::Cs(_, Some(_)) => {}
232
232
}
233
233
}
234
234
"# ,
@@ -240,9 +240,9 @@ mod tests {
240
240
}
241
241
fn main() {
242
242
match <|>A::As {
243
- A::Bs{x,y:Some(_)} => (),
244
- A::Cs(_, Some(_)) => (),
245
- A::As => (),
243
+ A::Bs{x,y:Some(_)} => {}
244
+ A::Cs(_, Some(_)) => {}
245
+ A::As => {}
246
246
}
247
247
}
248
248
"# ,
@@ -261,7 +261,7 @@ mod tests {
261
261
}
262
262
fn main() {
263
263
match A::As<|> {
264
- A::Cs(_) | A::Bs => (),
264
+ A::Cs(_) | A::Bs => {}
265
265
}
266
266
}
267
267
"# ,
@@ -273,8 +273,8 @@ mod tests {
273
273
}
274
274
fn main() {
275
275
match <|>A::As {
276
- A::Cs(_) | A::Bs => (),
277
- A::As => (),
276
+ A::Cs(_) | A::Bs => {}
277
+ A::As => {}
278
278
}
279
279
}
280
280
"# ,
@@ -299,8 +299,8 @@ mod tests {
299
299
}
300
300
fn main() {
301
301
match A::As<|> {
302
- A::Bs if 0 < 1 => (),
303
- A::Ds(_value) => (),
302
+ A::Bs if 0 < 1 => {}
303
+ A::Ds(_value) => { let x = 1; }
304
304
A::Es(B::Xs) => (),
305
305
}
306
306
}
@@ -319,11 +319,11 @@ mod tests {
319
319
}
320
320
fn main() {
321
321
match <|>A::As {
322
- A::Bs if 0 < 1 => (),
323
- A::Ds(_value) => (),
322
+ A::Bs if 0 < 1 => {}
323
+ A::Ds(_value) => { let x = 1; }
324
324
A::Es(B::Xs) => (),
325
- A::As => (),
326
- A::Cs => (),
325
+ A::As => {}
326
+ A::Cs => {}
327
327
}
328
328
}
329
329
"# ,
@@ -360,11 +360,11 @@ mod tests {
360
360
fn main() {
361
361
let a = A::As;
362
362
match <|>a {
363
- A::As => (),
364
- A::Bs => (),
365
- A::Cs(_) => (),
366
- A::Ds(_, _) => (),
367
- A::Es { x, y } => (),
363
+ A::As => {}
364
+ A::Bs => {}
365
+ A::Cs(_) => {}
366
+ A::Ds(_, _) => {}
367
+ A::Es { x, y } => {}
368
368
}
369
369
}
370
370
"# ,
@@ -405,10 +405,10 @@ mod tests {
405
405
let a = A::One;
406
406
let b = B::One;
407
407
match <|>(a, b) {
408
- (A::One, B::One) => (),
409
- (A::One, B::Two) => (),
410
- (A::Two, B::One) => (),
411
- (A::Two, B::Two) => (),
408
+ (A::One, B::One) => {}
409
+ (A::One, B::Two) => {}
410
+ (A::Two, B::One) => {}
411
+ (A::Two, B::Two) => {}
412
412
}
413
413
}
414
414
"# ,
@@ -449,10 +449,10 @@ mod tests {
449
449
let a = A::One;
450
450
let b = B::One;
451
451
match <|>(&a, &b) {
452
- (A::One, B::One) => (),
453
- (A::One, B::Two) => (),
454
- (A::Two, B::One) => (),
455
- (A::Two, B::Two) => (),
452
+ (A::One, B::One) => {}
453
+ (A::One, B::Two) => {}
454
+ (A::Two, B::One) => {}
455
+ (A::Two, B::Two) => {}
456
456
}
457
457
}
458
458
"# ,
@@ -477,7 +477,7 @@ mod tests {
477
477
let a = A::One;
478
478
let b = B::One;
479
479
match (a<|>, b) {
480
- (A::Two, B::One) => (),
480
+ (A::Two, B::One) => {}
481
481
}
482
482
}
483
483
"# ,
@@ -502,10 +502,10 @@ mod tests {
502
502
let a = A::One;
503
503
let b = B::One;
504
504
match (a<|>, b) {
505
- (A::Two, B::One) => (),
506
- (A::One, B::One) => (),
507
- (A::One, B::Two) => (),
508
- (A::Two, B::Two) => (),
505
+ (A::Two, B::One) => {}
506
+ (A::One, B::One) => {}
507
+ (A::One, B::Two) => {}
508
+ (A::Two, B::Two) => {}
509
509
}
510
510
}
511
511
"# ,
@@ -555,7 +555,7 @@ mod tests {
555
555
556
556
fn foo(a: &A) {
557
557
match <|>a {
558
- A::As => (),
558
+ A::As => {}
559
559
}
560
560
}
561
561
"# ,
@@ -580,7 +580,7 @@ mod tests {
580
580
581
581
fn foo(a: &mut A) {
582
582
match <|>a {
583
- A::Es { x, y } => (),
583
+ A::Es { x, y } => {}
584
584
}
585
585
}
586
586
"# ,
@@ -611,7 +611,7 @@ mod tests {
611
611
612
612
fn main() {
613
613
match E::X {
614
- <|>_ => {},
614
+ <|>_ => {}
615
615
}
616
616
}
617
617
"# ,
@@ -620,8 +620,8 @@ mod tests {
620
620
621
621
fn main() {
622
622
match <|>E::X {
623
- E::X => (),
624
- E::Y => (),
623
+ E::X => {}
624
+ E::Y => {}
625
625
}
626
626
}
627
627
"# ,
@@ -648,8 +648,8 @@ mod tests {
648
648
649
649
fn main() {
650
650
match <|>X {
651
- X => (),
652
- foo::E::Y => (),
651
+ X => {}
652
+ foo::E::Y => {}
653
653
}
654
654
}
655
655
"# ,
0 commit comments