Skip to content

Commit d9c8846

Browse files
committed
Use cur
1 parent 4b7c759 commit d9c8846

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/line-index/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,31 +86,31 @@ impl LineIndex {
8686
let mut newlines = Vec::with_capacity(16);
8787
newlines.push(TextSize::from(0));
8888

89-
let mut curr_row = 0.into();
90-
let mut curr_col = 0.into();
89+
let mut cur_row = 0.into();
90+
let mut cur_col = 0.into();
9191
let mut line = 0;
9292
for c in text.chars() {
9393
let c_len = TextSize::of(c);
94-
curr_row += c_len;
94+
cur_row += c_len;
9595
if c == '\n' {
96-
newlines.push(curr_row);
96+
newlines.push(cur_row);
9797

9898
// Save any utf-16 characters seen in the previous line
9999
if !wide_chars.is_empty() {
100100
line_wide_chars.insert(line, std::mem::take(&mut wide_chars));
101101
}
102102

103103
// Prepare for processing the next line
104-
curr_col = 0.into();
104+
cur_col = 0.into();
105105
line += 1;
106106
continue;
107107
}
108108

109109
if !c.is_ascii() {
110-
wide_chars.push(WideChar { start: curr_col, end: curr_col + c_len });
110+
wide_chars.push(WideChar { start: cur_col, end: cur_col + c_len });
111111
}
112112

113-
curr_col += c_len;
113+
cur_col += c_len;
114114
}
115115

116116
// Save any utf-16 characters seen in the last line

0 commit comments

Comments
 (0)