aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/flip_binexpr.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-25 11:16:02 +0100
committerGitHub <[email protected]>2020-04-25 11:16:02 +0100
commit29fc409e7fe5b12dcf6bfbcca622d79c4c8fcb72 (patch)
treee42f7bd1490bca66e0786d5bf2b3194aeaa57a93 /crates/ra_assists/src/handlers/flip_binexpr.rs
parent27a7718880d93f55f905da606d108d3b3c682ab4 (diff)
parente87346950039a54c3f0b02d6056cbb92ca38eb28 (diff)
Merge #4131
4131: Switch to text-size r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/flip_binexpr.rs')
-rw-r--r--crates/ra_assists/src/handlers/flip_binexpr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_assists/src/handlers/flip_binexpr.rs b/crates/ra_assists/src/handlers/flip_binexpr.rs
index bfcc09e90..8030efb35 100644
--- a/crates/ra_assists/src/handlers/flip_binexpr.rs
+++ b/crates/ra_assists/src/handlers/flip_binexpr.rs
@@ -23,7 +23,7 @@ pub(crate) fn flip_binexpr(ctx: AssistCtx) -> Option<Assist> {
23 let rhs = expr.rhs()?.syntax().clone(); 23 let rhs = expr.rhs()?.syntax().clone();
24 let op_range = expr.op_token()?.text_range(); 24 let op_range = expr.op_token()?.text_range();
25 // The assist should be applied only if the cursor is on the operator 25 // The assist should be applied only if the cursor is on the operator
26 let cursor_in_range = ctx.frange.range.is_subrange(&op_range); 26 let cursor_in_range = op_range.contains_range(ctx.frange.range);
27 if !cursor_in_range { 27 if !cursor_in_range {
28 return None; 28 return None;
29 } 29 }