Skip to content

Commit

Permalink
Avoid questionmark for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Dec 1, 2024
1 parent b92729d commit 5b91b17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions minijinja/src/compiler/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 5b91b17

Please sign in to comment.