From dd9635ace66089bda485d4da30cfc6fe131d25f7 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 11 Sep 2023 11:37:46 +0200 Subject: Rename some variables --- askama_parser/src/expr.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/askama_parser/src/expr.rs b/askama_parser/src/expr.rs index ca1dc9b..3e63d93 100644 --- a/askama_parser/src/expr.rs +++ b/askama_parser/src/expr.rs @@ -248,15 +248,15 @@ impl<'a> Suffix<'a> { } fn r#macro(i: &'a str) -> IResult<&'a str, Self> { - fn nested_parenthesis(i: &str) -> IResult<&str, ()> { + fn nested_parenthesis(input: &str) -> IResult<&str, ()> { let mut nested = 0; let mut last = 0; let mut in_str = false; let mut escaped = false; - for (i, b) in i.chars().enumerate() { - if !(b == '(' || b == ')') || !in_str { - match b { + for (i, c) in input.chars().enumerate() { + if !(c == '(' || c == ')') || !in_str { + match c { '(' => nested += 1, ')' => { if nested == 0 { @@ -281,16 +281,16 @@ impl<'a> Suffix<'a> { } } - if escaped && b != '\\' { + if escaped && c != '\\' { escaped = false; } } if nested == 0 { - Ok((&i[last..], ())) + Ok((&input[last..], ())) } else { Err(nom::Err::Error(error_position!( - i, + input, ErrorKind::SeparatedNonEmptyList ))) } -- cgit