From b1d5817dd18b7b5fc102a63b084b1ee7ff4f9996 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 23:40:41 +0200 Subject: Convert code to text-size --- crates/ra_assists/src/handlers/invert_if.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_assists/src/handlers/invert_if.rs') 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 { let if_keyword = ctx.find_token_at_offset(T![if])?; let expr = ast::IfExpr::cast(if_keyword.parent())?; let if_range = if_keyword.text_range(); - let cursor_in_range = ctx.frange.range.is_subrange(&if_range); + let cursor_in_range = if_range.contains_range(ctx.frange.range); if !cursor_in_range { return None; } -- cgit v1.2.3