Skip to content

Commit bd10591

Browse files
committed
In Foundry backend, track bytes rather than chars
1 parent 1ffe27f commit bd10591

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

backends/src/foundry/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,12 +505,12 @@ impl LocWithOptionalSemicolon for Statement {
505505
let loc = self.loc();
506506
match loc {
507507
Loc::File(file_no, start, mut end) => {
508-
let mut chars = contents.chars().skip(end).peekable();
509-
while chars.peek().copied().is_some_and(char::is_whitespace) {
508+
let mut bytes = contents.bytes().skip(end).peekable();
509+
while bytes.peek().is_some_and(u8::is_ascii_whitespace) {
510510
end += 1;
511-
let _: Option<char> = chars.next();
511+
let _: Option<u8> = bytes.next();
512512
}
513-
if chars.next() == Some(';') {
513+
if bytes.next() == Some(b';') {
514514
Loc::File(file_no, start, end + 1)
515515
} else {
516516
loc

0 commit comments

Comments
 (0)