First I'll try to eliminate the duplication between the BreadcrumbTree and BreadcrumbTreeNode.

This commit is contained in:
Tom Alexander 2020-05-31 18:05:49 -04:00
parent 1111b48270
commit 439601bbb5
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -86,18 +86,15 @@ impl<'a> DustRenderer<'a> {
}; };
let mut new_nodes = Vec::new(); let mut new_nodes = Vec::new();
explicit_context.as_ref().map(|path| { // explicit_context.as_ref().map(|path| {
let x = walk_path(maybe_breadcrumbs, &path.keys); // let x = walk_path(maybe_breadcrumbs, &path.keys);
x.map(|ice| ice.into_context_element(self, breadcrumbs)) // x.map(|ice| ice.into_context_element(self, breadcrumbs))
.map(|val| if val.is_truthy() {});
// walk_path(breadcrumbs, &path.keys)
// .map(|ice| ice.into_context_element(self, breadcrumbs))
// .map(|val| { // .map(|val| {
// if val.is_truthy() { // if val.is_truthy() {
// new_stack.push(val.from_context_element()) // new_nodes.push(val.from_context_element())
// } // }
// }); // });
}); // });
injected_context.map(|ctx| new_nodes.push(BreadcrumbTreeNodeElement::Borrowed(ctx))); injected_context.map(|ctx| new_nodes.push(BreadcrumbTreeNodeElement::Borrowed(ctx)));
new_context_element.map(|ctx| { new_context_element.map(|ctx| {
new_nodes.push(BreadcrumbTreeNodeElement::Borrowed( new_nodes.push(BreadcrumbTreeNodeElement::Borrowed(