diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-03-06 22:42:46 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-03-06 22:42:46 +0100 |
commit | b469bc208f5934fc55a7b5b57de6d961d65c015f (patch) | |
tree | d30242d040242126ba47591a5894a53bb975b815 /askama_derive | |
parent | 5763b88a707cc89fc80a611f3ef0e052a303cc19 (diff) | |
download | askama-b469bc208f5934fc55a7b5b57de6d961d65c015f.tar.gz askama-b469bc208f5934fc55a7b5b57de6d961d65c015f.tar.bz2 askama-b469bc208f5934fc55a7b5b57de6d961d65c015f.zip |
Better support for Iterator variants in for loop (fixes #8)
Diffstat (limited to 'askama_derive')
-rw-r--r-- | askama_derive/src/generator.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 16209cd..c3f8e9a 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -279,9 +279,9 @@ impl<'a> Generator<'a> { self.locals.insert(name.clone()); self.write(name); } - self.write(" in &"); + self.write(" in (&"); self.visit_expr(iter); - self.writeln(" {"); + self.writeln(").into_iter() {"); self.writeln("_loop_indexes[_loop_cur] += 1;"); self.handle(body); |