Skip to content

Commit 9d4d452

Browse files
committed
Rename
1 parent 369e430 commit 9d4d452

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/line-index/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ pub struct LineIndex {
8787
newlines: Box<[TextSize]>,
8888
/// List of non-ASCII characters on each line.
8989
line_wide_chars: IntMap<u32, Box<[WideChar]>>,
90-
/// The size of the entire text.
91-
size: TextSize,
90+
/// The length of the entire text.
91+
len: TextSize,
9292
}
9393

9494
impl LineIndex {
@@ -135,7 +135,7 @@ impl LineIndex {
135135
LineIndex {
136136
newlines: newlines.into_boxed_slice(),
137137
line_wide_chars,
138-
size: TextSize::of(text),
138+
len: TextSize::of(text),
139139
}
140140
}
141141

@@ -153,7 +153,7 @@ impl LineIndex {
153153
/// Returns `None` if the `offset` was invalid, e.g. if it extends past the end of the text or
154154
/// points to the middle of a multi-byte character.
155155
pub fn try_line_col(&self, offset: TextSize) -> Option<LineCol> {
156-
if offset > self.size {
156+
if offset > self.len {
157157
return None;
158158
}
159159
let line = self.newlines.partition_point(|&it| it <= offset);

0 commit comments

Comments
 (0)