@@ -193,9 +193,10 @@ impl ChangeSet {
193193 head_b = changes_b.next();
194194 }
195195 Ordering::Greater => {
196+ // TODO: cover this with a test
196197 // figure out the byte index of the truncated string end
197198 let (pos, _) = s.char_indices().nth(len - j).unwrap();
198− s.pop_front(s.len() as u32 - pos as u32);
199+ s.pop_front(pos as u32);
199200 head_a = Some(Insert(s));
200201 head_b = changes_b.next();
201202 }