Closed maghoff closed 7 years ago
I'd like to be able to iterate over slices, such as &'a [i32]. Right now, it is possible to iterate over Vec<i32>, but not a slice.
&'a [i32]
Vec<i32>
For the template {{#list}}{{.}}{{/list}}, the generated code is something like:
{{#list}}{{.}}{{/list}}
for _s1 in &self.list { ... }
If I remove the &, iterating over slices starts to work, but iterating over Vecs stops working.
&
Vec
Perhaps this can be solved generically by way of some AsRef or Borrow shenannigans?
I'd like to be able to iterate over slices, such as
&'a [i32]
. Right now, it is possible to iterate overVec<i32>
, but not a slice.For the template
{{#list}}{{.}}{{/list}}
, the generated code is something like:If I remove the
&
, iterating over slices starts to work, but iterating overVec
s stops working.Perhaps this can be solved generically by way of some AsRef or Borrow shenannigans?