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 15:44:09 -0700
committerAriel Davis <ariel.z.davis@icloud.com>2023-05-06 15:44:09 -0700
commit9d4d45215a95c92f05189e51131c60c1d15702d4 (patch)
tree08502691df68cfb4faed2d1e9577a3717540e4ec /lib
parent369e430b05534e694183b6faa8e4e0e540973158 (diff)
downloadrust-9d4d45215a95c92f05189e51131c60c1d15702d4.tar.gz
rust-9d4d45215a95c92f05189e51131c60c1d15702d4.zip
Rename
Diffstat (limited to 'lib')
-rw-r--r--lib/line-index/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/line-index/src/lib.rs b/lib/line-index/src/lib.rs
index 23f9d989c0c..aac5b156499 100644
--- a/lib/line-index/src/lib.rs
+++ b/lib/line-index/src/lib.rs
@@ -87,8 +87,8 @@ pub struct LineIndex {
     newlines: Box<[TextSize]>,
     /// List of non-ASCII characters on each line.
     line_wide_chars: IntMap<u32, Box<[WideChar]>>,
-    /// The size of the entire text.
-    size: TextSize,
+    /// The length of the entire text.
+    len: TextSize,
 }
 
 impl LineIndex {
@@ -135,7 +135,7 @@ impl LineIndex {
         LineIndex {
             newlines: newlines.into_boxed_slice(),
             line_wide_chars,
-            size: TextSize::of(text),
+            len: TextSize::of(text),
         }
     }
 
@@ -153,7 +153,7 @@ impl LineIndex {
     /// Returns `None` if the `offset` was invalid, e.g. if it extends past the end of the text or
     /// points to the middle of a multi-byte character.
     pub fn try_line_col(&self, offset: TextSize) -> Option<LineCol> {
-        if offset > self.size {
+        if offset > self.len {
             return None;
         }
         let line = self.newlines.partition_point(|&it| it <= offset);