Implement a recursive get_block.
This commit is contained in:
parent
6837fba489
commit
403f9e6530
@ -19,6 +19,16 @@ impl<'a> InlinePartialTreeElement<'a> {
|
||||
blocks: blocks,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_block(&self, name: &str) -> Option<&'a Option<Body<'a>>> {
|
||||
match self.blocks.get(name) {
|
||||
None => match self.parent {
|
||||
None => None,
|
||||
Some(parent_tree_element) => parent_tree_element.get_block(name),
|
||||
},
|
||||
Some(interior) => Some(interior),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn extract_inline_partials<'a>(
|
||||
|
Loading…
x
Reference in New Issue
Block a user