mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Use a from
This commit is contained in:
parent
84a6cb3bfc
commit
8012acc90e
@ -161,7 +161,7 @@ impl LineIndex {
|
|||||||
let mut res: usize = col.into();
|
let mut res: usize = col.into();
|
||||||
if let Some(wide_chars) = self.line_wide_chars.get(&line_col.line) {
|
if let Some(wide_chars) = self.line_wide_chars.get(&line_col.line) {
|
||||||
for c in wide_chars.iter() {
|
for c in wide_chars.iter() {
|
||||||
if c.end <= col {
|
if u32::from(c.end) <= line_col.col {
|
||||||
res -= usize::from(c.len()) - c.wide_len(enc);
|
res -= usize::from(c.len()) - c.wide_len(enc);
|
||||||
} else {
|
} else {
|
||||||
// From here on, all utf16 characters come *after* the character we are mapping,
|
// From here on, all utf16 characters come *after* the character we are mapping,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user