Turns out I was wrong, the @size helper attempts to cast to a number regardless of the input and it uses that. Fixed the test.

This commit is contained in:
Tom Alexander
2020-06-14 15:20:54 -04:00
parent e70f397545
commit 648ae5dfdb
4 changed files with 30 additions and 32 deletions

View File

@@ -141,32 +141,6 @@ impl<'a> IntoContextElement for RValue<'a> {
.map(|ice| ice.into_context_element(renderer, breadcrumbs))
.ok()
.flatten(),
// Special case: if the template is only a reference to a
// single variable without any additional text, then
// simply resolve that variable.
//
// TODO: What if the reference has filters?
// RValue::RVTemplate(template)
// if template.len() == 1
// && template.iter().all(|pne| match pne {
// PartialNameElement::PNReference { .. } => true,
// PartialNameElement::PNSpan { .. } => false,
// }) =>
// {
// let path = match template
// .first()
// .expect("Match guard proves theres one element")
// {
// PartialNameElement::PNReference { path, .. } => path,
// PartialNameElement::PNSpan { .. } => {
// panic!("Match guard prevents spans from hitting this code")
// }
// };
// walk_path(breadcrumbs, &path)
// .map(|ice| ice.into_context_element(renderer, breadcrumbs))
// .ok()
// .flatten()
// }
RValue::RVTemplate(template) => renderer
.render_partial_name(template, breadcrumbs)
.map(|rendered| OwnedLiteral::LString(rendered))