make insert_from_end work correctly
This commit is contained in:
@@ -82,7 +82,8 @@ impl HCValueOutputter for PrinterOutputter {
|
||||
}
|
||||
|
||||
fn insert_from_end(&mut self, idx: usize, c: char) {
|
||||
self.contents.insert(idx, c);
|
||||
let len = self.contents.len();
|
||||
self.contents.insert(len - idx, c);
|
||||
}
|
||||
|
||||
fn result(self) -> Self::Output {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user