diff options
| author | Duckonaut <duckonaut@#gmail.com> | 2026-11-04 12:35:04 +0100 |
|---|---|---|
| committer | Duckonaut <duckonaut@#gmail.com> | 2026-11-04 12:35:04 +0100 |
| commit | e97bba72ebe3850a819796c0718441b8d6562297 (patch) | |
| tree | d8162187c9884414bef69af714cb7247cf064e85 /src/luax/lexer.rs | |
| parent | c81da897d170ae245b6b3dd3559d10f3e7c787c5 (diff) | |
update: update dependencies, move to mlua
Diffstat (limited to 'src/luax/lexer.rs')
| -rw-r--r-- | src/luax/lexer.rs | 12 |
1 files changed, 4 insertions, 8 deletions
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<Token>; -} - #[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(); } } |
