askama/testing/tests/ui/loop-fields.rs
René Kijewski 50e0a96481 Rename LoopItem::index to LoopItem::index0
That's what the element is called in the template syntax.

Also refactor `Generator::visit_attr()` at bit to make it more readable.
Also add `__askama` prefix to `_len`.
2025-06-11 18:53:42 +02:00

13 lines
215 B
Rust

use askama::Template;
// Fail on unknown `loop` fields
#[derive(Template)]
#[template(
source = "{% for _ in 0..10 %} {{ loop.index1 }} {% endfor %}",
ext = "txt"
)]
struct UnknownLoopField;
fn main() {}