From 93ae424e7088281b3fd71850a81b0cbad6f10902 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Thu, 28 Dec 2023 16:49:28 +0200 Subject: [PATCH] saturating sub --- src/utils/lte.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/lte.rs b/src/utils/lte.rs index 69a0e33d1c..76f4133b65 100644 --- a/src/utils/lte.rs +++ b/src/utils/lte.rs @@ -91,7 +91,7 @@ impl<'a> Lexer<'a> { } fn prev_char(&self) -> char { - self.bytes[self.cursor - 1] as char + self.bytes[self.cursor.saturating_sub(1)] as char } fn skip_whitespace(&mut self) {