tera-macro 0.0.1

Macro for writing compile time Rust code with Tera templates
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use tera_macro::tera;

tera! {
    r#"{ "x" : "1" }"#,
    const w: usize = {{ x }};
}


#[test]
fn it_works() {
    tera! {
        r#"{ "x" : "2" }"#,
        let y: usize = {{ x }};
    }
    assert_eq!(y, 2);
    assert_eq!(w, 1);
}