问题描述
我有一个看起来像这样的Rust结构:
struct Root{
as: Vec<A>,}
struct A {
bs: Vec<B>,cs: Vec<C>,}
struct B {
strings: Vec<String>,}
struct C {
strings: Vec<u32>,}
我正在尝试使用Rocket.rs和Handlebars模板获取输出。
我的车把模板当前看起来像这样,但是它不起作用。
{{#each as}}
{{#each bs}}
<h4>{{@index}}</h4>
<pre>{{bs.@index}}</pre>
<pre>{{cs.@index}}</pre>
{{/each}}
{{/each}}
我收到以下错误Error: Error rendering Handlebars template 'index' Error rendering "index" line 28,col 18: invalid digit found in string
,这可能与我在HBS标签中使用的@index
变量有关。
还有其他方法可以只从两个数组中取出一个项并将它们并排放置,而不必更改我的结构吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)