Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit e27abd1

Browse files
bennetthardwickbennett-microsoft
authored andcommitted
Remove duplicate code
1 parent a6addc5 commit e27abd1

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

rls-vfs/src/lib.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -754,14 +754,7 @@ impl TextFile {
754754
}
755755

756756
fn load_line(&self, line: span::Row<span::ZeroIndexed>) -> Result<&str, Error> {
757-
let start = *try_opt_loc!(self.line_indices.get(line.0 as usize));
758-
let end = *try_opt_loc!(self.line_indices.get(line.0 as usize + 1));
759-
760-
if (end as usize) <= self.text.len() && start <= end {
761-
Ok(&self.text[start as usize..end as usize])
762-
} else {
763-
Err(Error::BadLocation)
764-
}
757+
self.load_lines(line, line)
765758
}
766759

767760
fn load_lines(

0 commit comments

Comments
 (0)