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

Commit

Permalink
Remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
bennetthardwick authored and bennett-microsoft committed Dec 17, 2019
1 parent a6addc5 commit e27abd1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions rls-vfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,14 +754,7 @@ impl TextFile {
}

fn load_line(&self, line: span::Row<span::ZeroIndexed>) -> Result<&str, Error> {
let start = *try_opt_loc!(self.line_indices.get(line.0 as usize));
let end = *try_opt_loc!(self.line_indices.get(line.0 as usize + 1));

if (end as usize) <= self.text.len() && start <= end {
Ok(&self.text[start as usize..end as usize])
} else {
Err(Error::BadLocation)
}
self.load_lines(line, line)
}

fn load_lines(
Expand Down

0 comments on commit e27abd1

Please sign in to comment.