From 5b91b179401fa4c36da124db31ad9428c6696098 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sun, 1 Dec 2024 10:42:38 +0100 Subject: [PATCH] Avoid questionmark for now --- minijinja/src/compiler/lexer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minijinja/src/compiler/lexer.rs b/minijinja/src/compiler/lexer.rs index 602a684c..24bb236f 100644 --- a/minijinja/src/compiler/lexer.rs +++ b/minijinja/src/compiler/lexer.rs @@ -87,7 +87,7 @@ fn find_start_marker_memchr(a: &str) -> Option<(usize, StartMarker, usize, White let bytes = a.as_bytes(); let mut offset = 0; loop { - let idx = memchr(&bytes[offset..], b'{')?; + let idx = some!(memchr(&bytes[offset..], b'{')); let marker = match bytes.get(offset + idx + 1).copied() { Some(b'{') => StartMarker::Variable, Some(b'%') => StartMarker::Block, @@ -527,7 +527,7 @@ impl<'s> Tokenizer<'s> { let s = self.advance(str_len + 2); Ok(if has_escapes { ( - Token::String(unescape(&s[1..s.len() - 1])?), + Token::String(ok!(unescape(&s[1..s.len() - 1]))), self.span(old_loc), ) } else {