@@ -193,9 +193,10 @@ impl ChangeSet {
193 head_b = changes_b.next();
193 head_b = changes_b.next();
195 Ordering::Greater => {
195 Ordering::Greater => {
196+ // TODO: cover this with a test
196 // figure out the byte index of the truncated string end
197 // figure out the byte index of the truncated string end
197 let (pos, _) = s.char_indices().nth(len - j).unwrap();
198 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);
199 head_a = Some(Insert(s));
200 head_a = Some(Insert(s));
200 head_b = changes_b.next();
201 head_b = changes_b.next();