From e97bba72ebe3850a819796c0718441b8d6562297 Mon Sep 17 00:00:00 2001 From: Duckonaut Date: Wed, 4 Nov 2026 12:35:04 +0100 Subject: update: update dependencies, move to mlua --- src/luax/lexer.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/luax/lexer.rs') diff --git a/src/luax/lexer.rs b/src/luax/lexer.rs index c075b3a..c304412 100644 --- a/src/luax/lexer.rs +++ b/src/luax/lexer.rs @@ -23,10 +23,6 @@ macro_rules! try_all_paths { }; } -pub trait TokenProducer { - fn next(&mut self) -> Option; -} - #[derive(Debug)] pub struct Lexer<'s> { src: &'s str, @@ -297,18 +293,18 @@ impl<'s> Lexer<'s> { } fn number(&mut self) -> TokenizeResult<'s> { - if !self.current.map_or(false, |c| c.is_numeric()) { + if !self.current.is_some_and(|c| c.is_numeric()) { return TokenizeResult::None; } let start = self.current_pos_in_bytes; - while self.current.map_or(false, |c| c.is_numeric()) { + while self.current.is_some_and(|c| c.is_numeric()) { self.advance(); } if self.match_char('.') { - while self.current.map_or(false, |c| c.is_numeric()) { + while self.current.is_some_and(|c| c.is_numeric()) { self.advance(); } } @@ -317,7 +313,7 @@ impl<'s> Lexer<'s> { if self.match_char('-') || self.match_char('+') { self.advance(); } - while self.current.map_or(false, |c| c.is_numeric()) { + while self.current.is_some_and(|c| c.is_numeric()) { self.advance(); } } -- cgit v1.3.1