From c8399c75ed0b90f0976ffeaa220150b8c1c22421 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Tue, 1 Aug 2023 12:49:17 +0200 Subject: parser: `node::Loop` is much bigger than the other variants --- askama_derive/src/heritage.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'askama_derive') diff --git a/askama_derive/src/heritage.rs b/askama_derive/src/heritage.rs index d34ef33..4e12f35 100644 --- a/askama_derive/src/heritage.rs +++ b/askama_derive/src/heritage.rs @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; use crate::config::Config; use crate::CompileError; -use parser::node::{BlockDef, Loop, Macro, Match, Node}; +use parser::node::{BlockDef, Macro, Match, Node}; pub(crate) struct Heritage<'a> { pub(crate) root: &'a Context<'a>, @@ -86,13 +86,9 @@ impl Context<'_> { nested.push(&cond.nodes); } } - Node::Loop(Loop { - body, - else_nodes: else_block, - .. - }) => { - nested.push(body); - nested.push(else_block); + Node::Loop(l) => { + nested.push(&l.body); + nested.push(&l.else_nodes); } Node::Match(Match { arms, .. }) => { for arm in arms { -- cgit