From b469bc208f5934fc55a7b5b57de6d961d65c015f Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 6 Mar 2017 22:42:46 +0100 Subject: Better support for Iterator variants in for loop (fixes #8) --- askama_derive/src/generator.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'askama_derive') 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); -- cgit