Can be reproduced with this code:
use askama::Template;
use std::borrow::Borrow;
pub fn bar(_: &String) -> String {
String::new()
}
#[derive(Template)]
#[template(source = r#"
{{ crate::bar(b.to_string().borrow()) }}
"#, ext = "txt")]
struct Foo {
b: u32,
}
Problem here is that b.to_string().borrow() is generated surrounded with {}. If you expand the code and removed the surrounding braces, code compiles just fine.
Can be reproduced with this code:
Problem here is that
b.to_string().borrow()is generated surrounded with{}. If you expand the code and removed the surrounding braces, code compiles just fine.