I am stuck in a simple problem but not able to figure it. I am not sure if this is the right place to ask the question on a package in Rust. Most of the time, in the template, we will want to transform our data. For example, I wanted to concat n arrays in one line. I can use ~ operator only if I know the number of arrays. Below is the requirement I am looking for,
{% macro generate_table(table) %}
{% for rows in 0..table.length %}
{{ table[table.col_header[0]][row] ~ " || " ~ [table.col_header[1]][row] }}
{% endfor %}
{% endmacro input %}
I want to do.
{% macro generate_table(table) %}
{% for rows in 0..table.rlength %}
{% for cols in 0..table.clength %}
{{ arr.insert(table[table.col_header[cols]][row]) }}
{% endfor %}
{{ arr | join(sep=" || ") }}
{% endfor %}
{% endmacro input %}
I figured it out. Using
concat(with="")