Skip to content

Commit df9fb9b

Browse files
author
Anatol Ulrich
committed
re-introduce always!
1 parent 28c73f8 commit df9fb9b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

crates/ide/src/rename.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use ide_db::{
1212
RootDatabase,
1313
};
1414
use itertools::Itertools;
15-
use stdx::never;
15+
use stdx::{always, never};
1616
use syntax::{ast, AstNode, SyntaxNode};
1717

1818
use text_edit::TextEdit;
@@ -41,13 +41,12 @@ pub(crate) fn prepare_rename(
4141
bail!("No references found at position")
4242
}
4343
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)
5150
})
5251
.reduce(|acc, cur| match (acc, cur) {
5352
// ensure all ranges are the same

0 commit comments

Comments
 (0)