diff options
| author | Jeroen Vannevel <jer_vannevel@outlook.com> | 2022-01-10 18:14:29 +0000 |
|---|---|---|
| committer | Jeroen Vannevel <jer_vannevel@outlook.com> | 2022-01-14 01:32:09 +0000 |
| commit | 6a1b4912bf2d65ac2176cddf6556eb7c68ba5b31 (patch) | |
| tree | 27c258144cc2131064b0c5dc858dd654e66a1d09 | |
| parent | c9fc91822f4bd110bdda7fb30d568871139f72d0 (diff) | |
| download | rust-6a1b4912bf2d65ac2176cddf6556eb7c68ba5b31.tar.gz rust-6a1b4912bf2d65ac2176cddf6556eb7c68ba5b31.zip | |
removed some unused stuff
| -rw-r--r-- | crates/ide_assists/src/handlers/merge_match_arms.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/crates/ide_assists/src/handlers/merge_match_arms.rs b/crates/ide_assists/src/handlers/merge_match_arms.rs index 4f4f5290fdd..81089771e16 100644 --- a/crates/ide_assists/src/handlers/merge_match_arms.rs +++ b/crates/ide_assists/src/handlers/merge_match_arms.rs @@ -48,7 +48,7 @@ pub(crate) fn merge_match_arms(acc: &mut Assists, ctx: &AssistContext) -> Option // compare to the previous match arm as well. let arms_to_merge = successors(Some(current_arm), |it| neighbor(it, Direction::Next)) .take_while(|arm| match arm.expr() { - Some(expr) if arm.guard().is_none() && arm.pat().is_some() => { + Some(expr) if arm.guard().is_none() => { let same_text = expr.syntax().text() == current_expr.syntax().text(); if !same_text { return false; @@ -59,15 +59,7 @@ pub(crate) fn merge_match_arms(acc: &mut Assists, ctx: &AssistContext) -> Option let other_arm_type = &arm_types[i].as_ref(); let current_arm_type = current_arm_types[i].as_ref(); if let (Some(other_arm_type), Some(current_arm_type)) = (other_arm_type, current_arm_type) { - let other_arm_type = &other_arm_type.original; - let current_arm_type = ¤t_arm_type.original; - - println!("Same types!"); - println!("{:?}", other_arm_type); - println!("{:?}", current_arm_type); - return other_arm_type == current_arm_type; - - + return &other_arm_type.original == ¤t_arm_type.original; } } |
