From e6a5e7e1e40ec6ac9875073e569d76b53c2384d3 Mon Sep 17 00:00:00 2001 From: PizzasBear <43722034+PizzasBear@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:23:24 +0300 Subject: [PATCH] Allow macros to take `self` as an argument --- askama_derive/src/generator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 76b775b8b..6f561f83b 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -952,7 +952,7 @@ impl<'a> Generator<'a> { // If `expr` is already a form of variable then // don't reintroduce a new variable. This is // to avoid moving non-copyable values. - Expr::Var(name) => { + &Expr::Var(name) if name != "self" => { let var = self.locals.resolve_or_self(name); self.locals.insert(arg, LocalMeta::with_ref(var)); }