diff options
Diffstat (limited to 'crates/ra_assists/src/handlers/invert_if.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/invert_if.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_assists/src/handlers/invert_if.rs b/crates/ra_assists/src/handlers/invert_if.rs index 682e08512..b16271443 100644 --- a/crates/ra_assists/src/handlers/invert_if.rs +++ b/crates/ra_assists/src/handlers/invert_if.rs | |||
@@ -47,8 +47,7 @@ pub(crate) fn invert_if(ctx: AssistCtx) -> Option<Assist> { | |||
47 | let else_node = else_block.syntax(); | 47 | let else_node = else_block.syntax(); |
48 | let else_range = else_node.text_range(); | 48 | let else_range = else_node.text_range(); |
49 | let then_range = then_node.text_range(); | 49 | let then_range = then_node.text_range(); |
50 | return ctx.add_assist(AssistId("invert_if"), "Invert if", |edit| { | 50 | return ctx.add_assist(AssistId("invert_if"), "Invert if", if_range, |edit| { |
51 | edit.target(if_range); | ||
52 | edit.replace(cond_range, flip_cond.syntax().text()); | 51 | edit.replace(cond_range, flip_cond.syntax().text()); |
53 | edit.replace(else_range, then_node.text()); | 52 | edit.replace(else_range, then_node.text()); |
54 | edit.replace(then_range, else_node.text()); | 53 | edit.replace(then_range, else_node.text()); |
@@ -62,7 +61,7 @@ pub(crate) fn invert_if(ctx: AssistCtx) -> Option<Assist> { | |||
62 | mod tests { | 61 | mod tests { |
63 | use super::*; | 62 | use super::*; |
64 | 63 | ||
65 | use crate::helpers::{check_assist, check_assist_not_applicable}; | 64 | use crate::tests::{check_assist, check_assist_not_applicable}; |
66 | 65 | ||
67 | #[test] | 66 | #[test] |
68 | fn invert_if_remove_inequality() { | 67 | fn invert_if_remove_inequality() { |