From 0d9515fe1a8c89e9604beb1a69370256d0f23f08 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sat, 16 Dec 2017 08:30:37 -0700 Subject: [PATCH] fix(for): Remove non-standard for_loop variable `for` loops provided both a `forloop` and `for_loop` variable, only the former being shopify compatible. BREAKING CHANGE: Change `for_loop` to `forloop`. --- src/tags/for_block.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tags/for_block.rs b/src/tags/for_block.rs index 6bb07f7b0..ae8a83b3f 100644 --- a/src/tags/for_block.rs +++ b/src/tags/for_block.rs @@ -97,10 +97,10 @@ impl Renderable for For { helper_vars.insert("first".to_owned(), Value::Bool(i == 0)); helper_vars.insert("last".to_owned(), Value::Bool(i == (range_len - 1))); - scope.set_local_val("for_loop", Value::Object(helper_vars.clone())); scope.set_local_val("forloop", Value::Object(helper_vars.clone())); scope.set_local_val(&self.var_name, v.clone()); - let inner = try!(self.item_template.render(&mut scope)) + let inner = self.item_template + .render(&mut scope)? .unwrap_or_else(String::new); ret = ret + &inner;