about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorAriel Davis <ariel.z.davis@icloud.com>2023-05-06 01:37:25 -0700
committerAriel Davis <ariel.z.davis@icloud.com>2023-05-06 01:37:25 -0700
commit65004877358fc5e9b285d9a7683baf62ec541f73 (patch)
treefb57e1b5ea2685750d6362d52547cb4bcab711e4 /lib
parent0ad2450396ea72bff341c65dbf24745e1e185aad (diff)
downloadrust-65004877358fc5e9b285d9a7683baf62ec541f73.tar.gz
rust-65004877358fc5e9b285d9a7683baf62ec541f73.zip
Rename
Diffstat (limited to 'lib')
-rw-r--r--lib/line-index/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/line-index/src/lib.rs b/lib/line-index/src/lib.rs
index 2494975f9fb..ad6a79c4095 100644
--- a/lib/line-index/src/lib.rs
+++ b/lib/line-index/src/lib.rs
@@ -148,8 +148,8 @@ impl LineIndex {
     /// e.g. if it points to the middle of a multi-byte character.
     pub fn try_line_col(&self, offset: TextSize) -> Option<LineCol> {
         let line = self.newlines.partition_point(|&it| it <= offset).checked_sub(1)?;
-        let line_start_offset = self.newlines.get(line)?;
-        let col = offset - line_start_offset;
+        let start = self.newlines.get(line)?;
+        let col = offset - start;
         let ret = LineCol { line: line as u32, col: col.into() };
         self.line_wide_chars
             .get(&ret.line)