fix source map line offsets (#2791)

* find codepoint at `i`

* fix allocator usage

* missing comment

* switch to `Cursor` iterator
This commit is contained in:
Dylan Conway
2023-05-04 22:44:02 -07:00
committed by GitHub
parent 945d069290
commit d9386a68a4
5 changed files with 116 additions and 52 deletions

View File

@@ -250,7 +250,7 @@ pub const MutableString = struct {
return self.indexOfChar(char) != null;
}
pub fn indexOfChar(self: *const MutableString, char: u8) ?usize {
pub fn indexOfChar(self: *const MutableString, char: u8) ?u32 {
return strings.indexOfChar(self.list.items, char);
}