blob: c6e97ce857002b9728ad7e21e8cf117d62b8d746 (
plain) (
tree)
|
|
#[macro_use]
extern crate askama;
use askama::Template;
macro_rules! hello {
($name:expr) => {
"world"
}
}
#[derive(Template)]
#[template(path = "rust-macros.html")]
struct RustMacrosTemplate<'a> {
name: &'a str,
}
#[test]
fn main() {
let template = RustMacrosTemplate { name: "foo" };
assert_eq!("Hello, world!", template.render().unwrap());
}
|