I have a Rust structure that looks something like this:
struct Root{
as: Vec<A>,
}
struct A {
bs: Vec<B>,
cs: Vec<C>,
}
struct B {
strings: Vec<String>,
}
struct C {
strings: Vec<u32>,
}
and i'm trying to get output using Rocket.rs and Handlebars templating.
My handlebars template currently looks like this, but it doesn't work.
{{#each as}}
{{#each bs}}
<h4>{{@index}}</h4>
<pre>{{bs.@index}}</pre>
<pre>{{cs.@index}}</pre>
{{/each}}
{{/each}}
I get the following error Error: Error rendering Handlebars template 'index' Error rendering "index" line 28, col 18: invalid digit found in string
, which probably has to do with the @index
variables I'm using in the HBS tags.
Is there any other way I could only get one item out of two arrays and place them side-by-side without having to alter my structure?