From ed7d80de6c95d7e6b9a5966bc2b9271ed780ec70 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 6 Jun 2020 19:57:33 -0400 Subject: [PATCH] Handling RVPath for ParametersContext constructor. --- src/renderer/parameters_context.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/renderer/parameters_context.rs b/src/renderer/parameters_context.rs index e614adc..ade5aa2 100644 --- a/src/renderer/parameters_context.rs +++ b/src/renderer/parameters_context.rs @@ -43,21 +43,19 @@ impl<'a> ParametersContext<'a> { .iter() .map(|kvpair| { let k = kvpair.key; - let v: BreadcrumbTreeElement<'a> = match &kvpair.value { + let v: Option> = match &kvpair.value { RValue::RVLiteral(owned_literal) => { - BreadcrumbTreeElement::Borrowed(&kvpair.value) + Some(BreadcrumbTreeElement::Borrowed(&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::RVPath(path) => kvpair + .value + .into_context_element(renderer, breadcrumbs) + .map(std::convert::From::from), RValue::RVTemplate(template) => todo!(), }; - (k, v) + v.map(|some_v| (k, some_v)) }) + .filter_map(|pair| pair) .collect(); ParametersContext {