Skip to content

Commit

Permalink
Minor refactor of child.handle() call in handle_include()
Browse files Browse the repository at this point in the history
Signed-off-by: max <[email protected]>
  • Loading branch information
PizzasBear committed Jan 17, 2024
1 parent f885dfb commit 575a849
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions askama_derive/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,13 +865,13 @@ impl<'a> Generator<'a> {
None
};

let handle_ctx = match &heritage {
Some(heritage) => heritage.root,
None => child_ctx,
};
let locals = MapChain::with_parent(&self.locals);
let mut child = Self::new(self.input, self.contexts, heritage.as_ref(), locals);
let mut size_hint = if let Some(heritage) = &heritage {
child.handle(heritage.root, heritage.root.nodes, buf, AstLevel::Top)
} else {
child.handle(child_ctx, child_ctx.nodes, buf, AstLevel::Top)
}?;
let mut size_hint = child.handle(handle_ctx, handle_ctx.nodes, buf, AstLevel::Top)?;
size_hint += child.write_buf_writable(buf)?;
self.prepare_ws(i.ws);

Expand Down

0 comments on commit 575a849

Please sign in to comment.