I think I need to implement iterating on the tree nodes.
This commit is contained in:
parent
3f49519bea
commit
89c751e849
@ -18,6 +18,15 @@ where
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn get_first_non_pseudo_element<'a, B>(
|
||||
breadcrumbs: &'a BreadcrumbTreeNode<B>,
|
||||
) -> Option<&'a dyn IntoContextElement>
|
||||
where
|
||||
B: IntoContextElement,
|
||||
{
|
||||
breadcrumbs.iter().filter(|b| b.is_pseudo_element()).next()
|
||||
}
|
||||
|
||||
pub fn walk_path<'a, B, P>(
|
||||
maybe_breadcrumbs: Option<&'a BreadcrumbTreeNode<B>>,
|
||||
path: &Vec<P>,
|
||||
@ -29,7 +38,13 @@ where
|
||||
match (maybe_breadcrumbs, path.first()) {
|
||||
(None, _) => return Err(WalkError::CantWalk),
|
||||
(Some(breadcrumbs), None) => return Ok(breadcrumbs.get_ice()),
|
||||
(Some(breadcrumbs), Some(path_first)) if path_first.borrow() == "." => (),
|
||||
(Some(breadcrumbs), Some(path_first)) if path_first.borrow() == "." => {
|
||||
let first_non_pseudo_element = get_first_non_pseudo_element(breadcrumbs);
|
||||
// return match first_non_pseudo_element {
|
||||
// None => Err(WalkError::CantWalk),
|
||||
// Some(current_context)
|
||||
// }
|
||||
}
|
||||
(Some(breadcrumbs), Some(path_first)) => (),
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user