include_tt 1.1.1

Macros for ultra-flexible injection of token trees, literals, or binary data into Rust code from external files during compilation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use include_tt::inject;
use std::fmt::Write;

fn main() {
    let mut buf = String::new();

    inject! {
        write!(
            &mut buf,
            "Welcome, {}. Your score is {}!",
            #tt("examples/name.tt"),			// `"Ferris"`
            #tt("examples/" "score" ".tt")	// `100500`
        ).unwrap();
    }

    assert_eq!(buf, "Welcome, Ferris. Your score is 100500!");
}