aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/generator.rs
diff options
context:
space:
mode:
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r--askama_derive/src/generator.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index 5ec2238..07c87bf 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -720,6 +720,9 @@ impl<'a> Generator<'a> {
return DisplayWrap::Unwrapped;
} else if attr == "index0" {
return DisplayWrap::Unwrapped;
+ } else if attr == "first" {
+ code.push_str(" == 0");
+ return DisplayWrap::Unwrapped;
} else {
panic!("unknown loop variable");
}