Skip to content

Commit

Permalink
Improve macro call arguments loop
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez authored and djc committed Nov 20, 2023
1 parent 9de2336 commit 70b5b14
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions askama_derive/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,7 @@ impl<'a> Generator<'a> {
args.len()
)));
}
for (i, arg) in def.args.iter().enumerate() {
let expr = args.get(i).ok_or_else(|| {
CompileError::from(format!("macro {name:?} takes more than {i} arguments"))
})?;
for (expr, arg) in std::iter::zip(args, &def.args) {
match expr {
// If `expr` is already a form of variable then
// don't reintroduce a new variable. This is
Expand Down

0 comments on commit 70b5b14

Please sign in to comment.