fn render_node(&mut self, node: &'a Node, buffer: &mut String) -> Result<()> {
        match *node {
            Node::Text(ref s) | Node::Raw(_, ref s, _) => buffer.push_str(s),
            Node::VariableBlock(ref expr) => buffer.push_str(&self.eval_expression(expr)?.render()),
            Node::Set(_, ref set) => self.eval_set(set)?,
            Node::FilterSection(_, FilterSection { ref filter, ref body }, _) => {
                let body = self.render_body(body)?;
                buffer.push_str(
                    &self.eval_filter(&Cow::Owned(Value::String(body)), filter)?.render(),
                );
            }
            // Macros have been imported at the beginning
            Node::ImportMacro(_, _, _) => (),
            Node::If(ref if_node, _) => buffer.push_str(&self.render_if_node(if_node)?),
            Node::Forloop(_, ref forloop, _) => buffer.push_str(&self.render_for_loop(forloop)?),
            Node::Break(_) => {
                self.call_stack.break_for_loop()?;
            }
            Node::Continue(_) => {
                self.call_stack.continue_for_loop()?;
            }
            Node::Block(_, ref block, _) => buffer.push_str(&self.render_block(block, 0)?),
            Node::Super => buffer.push_str(&self.do_super()?),
            Node::Include(_, ref tpl_name) => {
                let template = self.tera.get_template(tpl_name)?;
                self.macros.add_macros_from_template(&self.tera, template)?;
                self.call_stack.push_include_frame(tpl_name, template);
                let result = self.render_body(&template.ast)?;
                self.call_stack.pop();
                buffer.push_str(&result);
            }
            _ => unreachable!("render_node -> unexpected node: {:?}", node),
        };

        Ok(())
    }
/// Process the given node, appending the string result to the buffer
/// if it is possible
Process the given node, appending the string result to the buffer
if it is possible
Process the given node appending the string result to the buffer if it is possible
fn render_node(&mut self, node: &'a Node, buffer: &mut String) -> Result<()> {
        match *node {
            Node::Text(ref s) | Node::Raw(_, ref s, _) => buffer.push_str(s),
            Node::VariableBlock(ref expr) => buffer.push_str(&self.eval_expression(expr)?.render()),
            Node::Set(_, ref set) => self.eval_set(set)?,
            Node::FilterSection(_, FilterSection { ref filter, ref body }, _) => {
                let body = self.render_body(body)?;
                buffer.push_str(
                    &self.eval_filter(&Cow::Owned(Value::String(body)), filter)?.render(),
                );
            }
            // Macros have been imported at the beginning
            Node::ImportMacro(_, _, _) => (),
            Node::If(ref if_node, _) => buffer.push_str(&self.render_if_node(if_node)?),
            Node::Forloop(_, ref forloop, _) => buffer.push_str(&self.render_for_loop(forloop)?),
            Node::Break(_) => {
                self.call_stack.break_for_loop()?;
            }
            Node::Continue(_) => {
                self.call_stack.continue_for_loop()?;
            }
            Node::Block(_, ref block, _) => buffer.push_str(&self.render_block(block, 0)?),
            Node::Super => buffer.push_str(&self.do_super()?),
            Node::Include(_, ref tpl_name) => {
                let template = self.tera.get_template(tpl_name)?;
                self.macros.add_macros_from_template(&self.tera, template)?;
                self.call_stack.push_include_frame(tpl_name, template);
                let result = self.render_body(&template.ast)?;
                self.call_stack.pop();
                buffer.push_str(&result);
            }
            _ => unreachable!("render_node -> unexpected node: {:?}", node),
        };
        Ok(())
    }
fn render_node ( & mut self , node : & ' a Node , buffer : & mut String ) -> Result < ( ) > { match * node { Node :: Text ( ref s ) | Node :: Raw ( _ , ref s , _ ) => buffer . push_str ( s ) , Node :: VariableBlock ( ref expr ) => buffer . push_str ( & self . eval_expression ( expr ) ? . render ( ) ) , Node :: Set ( _ , ref set ) => self . eval_set ( set ) ? , Node :: FilterSection ( _ , FilterSection { ref filter , ref body } , _ ) => { let body = self . render_body ( body ) ? ; buffer . push_str ( & self . eval_filter ( & Cow :: Owned ( Value :: String ( body ) ) , filter ) ? . render ( ) , ) ; } // Macros have been imported at the beginning Node :: ImportMacro ( _ , _ , _ ) => ( ) , Node :: If ( ref if_node , _ ) => buffer . push_str ( & self . render_if_node ( if_node ) ? ) , Node :: Forloop ( _ , ref forloop , _ ) => buffer . push_str ( & self . render_for_loop ( forloop ) ? ) , Node :: Break ( _ ) => { self . call_stack . break_for_loop ( ) ? ; } Node :: Continue ( _ ) => { self . call_stack . continue_for_loop ( ) ? ; } Node :: Block ( _ , ref block , _ ) => buffer . push_str ( & self . render_block ( block , 0 ) ? ) , Node :: Super => buffer . push_str ( & self . do_super ( ) ? ) , Node :: Include ( _ , ref tpl_name ) => { let template = self . tera . get_template ( tpl_name ) ? ; self . macros . add_macros_from_template ( & self . tera , template ) ? ; self . call_stack . push_include_frame ( tpl_name , template ) ; let result = self . render_body ( & template . ast ) ? ; self . call_stack . pop ( ) ; buffer . push_str ( & result ) ; } _ => unreachable ! ( " " node ) , } ; Ok ( ( ) ) }
Process the given node, appending the string result to the buffer
if it is possible
Process the given node appending the string result to the buffer if it is possible
&mut self
node
&'a Node
buffer
&mut String
&mut self
node
&'a Node
buffer
&mut String