fix: node reclaimation

This commit is contained in:
Jonathan Kelley committed 2022-11-25 02:12:29 -05:00
1 parent 5713e13ff2
commit bffb2644a3
6 files changed
+129 -125

No files matched your search

+9
View File
@@ -54,6 +54,15 @@ impl<'a> VNode<'a> {
},
})
}
pub fn dynamic_root(&self, idx: usize) -> Option<&'a DynamicNode<'a>> {
match &self.template.roots[idx] {
TemplateNode::Element { .. } | TemplateNode::Text(_) => None,
TemplateNode::Dynamic(id) | TemplateNode::DynamicText(id) => {
Some(&self.dynamic_nodes[*id])
}
}
}
}
#[derive(Debug, Clone, Copy)]