mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-01 06:51:15 +00:00
Allow macros to take self
as an argument
This commit is contained in:
parent
ab281c8236
commit
ac73f1d535
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user