aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/generator.rs
diff options
context:
space:
mode:
authorLibravatar Matthew Taylor <wrapperup4@gmail.com>2023-07-24 05:39:14 -0400
committerLibravatar GitHub <noreply@github.com>2023-07-24 11:39:14 +0200
commitac8de6260e34c7dc7f7f2228e832d1860a31707d (patch)
treedbdceecef23a2db606c6d5df33deefb783798686 /askama_derive/src/generator.rs
parent31e9ed52bebb6d026dc3a8ae29c28af4beb7122e (diff)
downloadaskama-ac8de6260e34c7dc7f7f2228e832d1860a31707d.tar.gz
askama-ac8de6260e34c7dc7f7f2228e832d1860a31707d.tar.bz2
askama-ac8de6260e34c7dc7f7f2228e832d1860a31707d.zip
Fix Rust macro invocations not accepting a path (#837)
Diffstat (limited to 'askama_derive/src/generator.rs')
-rw-r--r--askama_derive/src/generator.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs
index d9ddfc8..f990330 100644
--- a/askama_derive/src/generator.rs
+++ b/askama_derive/src/generator.rs
@@ -1373,7 +1373,7 @@ impl<'a> Generator<'a> {
}
Expr::Group(ref inner) => self.visit_group(buf, inner)?,
Expr::Call(ref obj, ref args) => self.visit_call(buf, obj, args)?,
- Expr::RustMacro(name, args) => self.visit_rust_macro(buf, name, args),
+ Expr::RustMacro(ref path, args) => self.visit_rust_macro(buf, path, args),
Expr::Try(ref expr) => self.visit_try(buf, expr.as_ref())?,
Expr::Tuple(ref exprs) => self.visit_tuple(buf, exprs)?,
})
@@ -1390,8 +1390,8 @@ impl<'a> Generator<'a> {
Ok(DisplayWrap::Unwrapped)
}
- fn visit_rust_macro(&mut self, buf: &mut Buffer, name: &str, args: &str) -> DisplayWrap {
- buf.write(name);
+ fn visit_rust_macro(&mut self, buf: &mut Buffer, path: &[&str], args: &str) -> DisplayWrap {
+ self.visit_path(buf, path);
buf.write("!(");
buf.write(args);
buf.write(")");