Skip to content

Commit 786b30d

Browse files
committed
Add test case for select non-first branch
1 parent 13f5a92 commit 786b30d

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

crates/ide-assists/src/handlers/move_guard.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,32 @@ fn main() {
439439
move_guard_to_arm_body,
440440
r#"
441441
fn main() {
442+
match 92 {
443+
x @ 0..30 if x % 3 == 0 => false,
444+
x @ 0..30 $0if x % 2 == 0$0 => true,
445+
x @ 0..30 => false,
446+
_ => true
447+
}
448+
}
449+
"#,
450+
r#"
451+
fn main() {
452+
match 92 {
453+
x @ 0..30 if x % 3 == 0 => false,
454+
x @ 0..30 => if x % 2 == 0 {
455+
true
456+
},
457+
x @ 0..30 => false,
458+
_ => true
459+
}
460+
}
461+
"#,
462+
);
463+
464+
check_assist(
465+
move_guard_to_arm_body,
466+
r#"
467+
fn main() {
442468
match 92 {
443469
x @ 0..30 $0if x % 3 == 0 => false,
444470
x @ 0..30 $0if x % 2 == 0 => true,

0 commit comments

Comments
 (0)