Skip to content

Commit e02d16a

Browse files
committed
Change the signature of next_token to match Tokenizer::next()
This was causing unaligned moves (movups instructions), for some reason.
1 parent b7d278f commit e02d16a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tokenizer.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl<'a> Tokenizer<'a> {
262262

263263
#[inline]
264264
pub fn next(&mut self) -> Result<Token<'a>, ()> {
265-
next_token(self).ok_or(())
265+
next_token(self)
266266
}
267267

268268
#[inline]
@@ -401,9 +401,9 @@ pub struct SourceLocation {
401401
}
402402

403403

404-
fn next_token<'a>(tokenizer: &mut Tokenizer<'a>) -> Option<Token<'a>> {
404+
fn next_token<'a>(tokenizer: &mut Tokenizer<'a>) -> Result<Token<'a>, ()> {
405405
if tokenizer.is_eof() {
406-
return None
406+
return Err(())
407407
}
408408
let c = tokenizer.next_byte_unchecked();
409409
let token = match_byte! { c,
@@ -564,7 +564,7 @@ fn next_token<'a>(tokenizer: &mut Tokenizer<'a>) -> Option<Token<'a>> {
564564
}
565565
},
566566
};
567-
Some(token)
567+
Ok(token)
568568
}
569569

570570

0 commit comments

Comments
 (0)