aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_text_edit/src/text_edit.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_text_edit/src/text_edit.rs')
-rw-r--r--crates/ra_text_edit/src/text_edit.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_text_edit/src/text_edit.rs b/crates/ra_text_edit/src/text_edit.rs
index 413c7d782..3291ada42 100644
--- a/crates/ra_text_edit/src/text_edit.rs
+++ b/crates/ra_text_edit/src/text_edit.rs
@@ -66,13 +66,13 @@ impl TextEdit {
66 let mut total_len = text.len(); 66 let mut total_len = text.len();
67 for atom in self.atoms.iter() { 67 for atom in self.atoms.iter() {
68 total_len += atom.insert.len(); 68 total_len += atom.insert.len();
69 total_len -= u32::from(atom.delete.end() - atom.delete.start()) as usize; 69 total_len -= (atom.delete.end() - atom.delete.start()).to_usize();
70 } 70 }
71 let mut buf = String::with_capacity(total_len); 71 let mut buf = String::with_capacity(total_len);
72 let mut prev = 0; 72 let mut prev = 0;
73 for atom in self.atoms.iter() { 73 for atom in self.atoms.iter() {
74 let start = u32::from(atom.delete.start()) as usize; 74 let start = atom.delete.start().to_usize();
75 let end = u32::from(atom.delete.end()) as usize; 75 let end = atom.delete.end().to_usize();
76 if start > prev { 76 if start > prev {
77 buf.push_str(&text[prev..start]); 77 buf.push_str(&text[prev..start]);
78 } 78 }