Macro macro_io::read_file[][src]

read_file!() { /* proc-macro */ }

Read the contents of a file to a string and places the string as a literal in the Rust code.

Expects a string literal for filename as input.

Examples

let hello = macro_io::read_file!("tests/testfiles/hello_world.txt");
assert_eq!(hello, "Hello world!");
let formatted = format!(macro_io::read_file!("tests/testfiles/fmt.txt"), "foo", "bar");
assert_eq!(formatted, "foo: bar");