(&mut self, pos: StrSize)
| 634 | } |
| 635 | |
| 636 | fn restart_from(&mut self, pos: StrSize) -> Result<(), Self::Error> { |
| 637 | if pos.chars > self.data.char_len() { |
| 638 | return Err(self.vm.new_index_error(format!( |
| 639 | "position {} from error handler out of bounds", |
| 640 | pos.chars |
| 641 | ))); |
| 642 | } |
| 643 | assert!( |
| 644 | self.data.as_wtf8().is_code_point_boundary(pos.bytes), |
| 645 | "invalid pos {pos:?} for {:?}", |
| 646 | self.data.as_wtf8() |
| 647 | ); |
| 648 | self.pos = pos; |
| 649 | Ok(()) |
| 650 | } |
| 651 | |
| 652 | fn error_encoding(&self, range: Range<StrSize>, reason: Option<&str>) -> Self::Error { |
| 653 | let vm = self.vm; |
no test coverage detected