Skip to content

Commit

Permalink
Allow macros to take self as an argument
Browse files Browse the repository at this point in the history
  • Loading branch information
PizzasBear authored Oct 12, 2023
1 parent ab281c8 commit e6a5e7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion askama_derive/src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit e6a5e7e

Please sign in to comment.