Implement function to convert IceResult into a BreadcrumbTreeElement.
This commit is contained in:
@@ -27,8 +27,8 @@ pub struct ParametersContext<'a> {
|
||||
impl<'a> ParametersContext<'a> {
|
||||
pub fn new(
|
||||
renderer: &DustRenderer,
|
||||
breadcrumbs: Option<&BreadcrumbTree>,
|
||||
params: &Vec<KVPair>,
|
||||
breadcrumbs: Option<&'a BreadcrumbTree>,
|
||||
params: &'a Vec<KVPair>,
|
||||
) -> Self {
|
||||
// If the parameter is a Path, then we resolve it immediately
|
||||
// to a context element because those are resolved using the
|
||||
@@ -38,8 +38,27 @@ impl<'a> ParametersContext<'a> {
|
||||
// then those are resolved at the time of access rather than
|
||||
// the time of assignment, so we leave them into their
|
||||
// original IntoContextElement state.
|
||||
let rendered_params = params
|
||||
.iter()
|
||||
.map(|kvpair| {
|
||||
let k = kvpair.key;
|
||||
let v: &dyn IntoContextElement = match &kvpair.value {
|
||||
RValue::RVLiteral(owned_literal) => &kvpair.value,
|
||||
/*RValue::RVPath(path) => kvpair
|
||||
.value
|
||||
.into_context_element(renderer, breadcrumbs)
|
||||
.unwrap()
|
||||
.get_context_element_reference()
|
||||
.from_context_element(),*/
|
||||
RValue::RVPath(path) => todo!(),
|
||||
RValue::RVTemplate(template) => todo!(),
|
||||
};
|
||||
(k, v)
|
||||
})
|
||||
.collect();
|
||||
|
||||
ParametersContext {
|
||||
params: HashMap::new(),
|
||||
params: rendered_params,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user