diff options
Diffstat (limited to 'crates/ra_assists/src/handlers/invert_if.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/invert_if.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_assists/src/handlers/invert_if.rs b/crates/ra_assists/src/handlers/invert_if.rs index 4c5716868..682e08512 100644 --- a/crates/ra_assists/src/handlers/invert_if.rs +++ b/crates/ra_assists/src/handlers/invert_if.rs | |||
@@ -28,7 +28,7 @@ pub(crate) fn invert_if(ctx: AssistCtx) -> Option<Assist> { | |||
28 | let if_keyword = ctx.find_token_at_offset(T![if])?; | 28 | let if_keyword = ctx.find_token_at_offset(T![if])?; |
29 | let expr = ast::IfExpr::cast(if_keyword.parent())?; | 29 | let expr = ast::IfExpr::cast(if_keyword.parent())?; |
30 | let if_range = if_keyword.text_range(); | 30 | let if_range = if_keyword.text_range(); |
31 | let cursor_in_range = ctx.frange.range.is_subrange(&if_range); | 31 | let cursor_in_range = if_range.contains_range(ctx.frange.range); |
32 | if !cursor_in_range { | 32 | if !cursor_in_range { |
33 | return None; | 33 | return None; |
34 | } | 34 | } |