make insert_from_end work correctly

This commit is contained in:
Mark Thom
2018-12-19 09:27:08 -07:00
parent 6f0018c3e0
commit b42706c1d6
2 changed files with 4 additions and 2 deletions

View File

@@ -51,7 +51,8 @@ impl HCValueOutputter for TestOutputter {
}
fn insert_from_end(&mut self, idx: usize, c: char) {
self.focus.insert(idx, c);
let len = self.focus.len();
self.focus.insert(len - idx, c);
}
fn result(self) -> Self::Output {