File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use ide_db::{
12
12
RootDatabase ,
13
13
} ;
14
14
use itertools:: Itertools ;
15
- use stdx:: never;
15
+ use stdx:: { always , never} ;
16
16
use syntax:: { ast, AstNode , SyntaxNode } ;
17
17
18
18
use text_edit:: TextEdit ;
@@ -41,13 +41,12 @@ pub(crate) fn prepare_rename(
41
41
bail ! ( "No references found at position" )
42
42
}
43
43
let frange = sema. original_range ( name_like. syntax ( ) ) ;
44
- if frange. range . contains_inclusive ( position. offset )
45
- && frange. file_id == position. file_id
46
- {
47
- Ok ( frange. range )
48
- } else {
49
- bail ! ( "invalid text range" )
50
- }
44
+
45
+ always ! (
46
+ frange. range. contains_inclusive( position. offset)
47
+ && frange. file_id == position. file_id
48
+ ) ;
49
+ Ok ( frange. range )
51
50
} )
52
51
. reduce ( |acc, cur| match ( acc, cur) {
53
52
// ensure all ranges are the same
You can’t perform that action at this time.
0 commit comments