Function
write_tokens
(file: &str, source: TokenStream)
Source from the content-addressed store, hash-verified
| 12 | }; |
| 13 | |
| 14 | fn write_tokens(file: &str, source: TokenStream) -> Result<(), Error> { |
| 15 | let contents = syn::parse_file(&source.to_string()).map_err(|e| Error::other(e.to_string()))?; |
| 16 | let contents = prettyplease::unparse(&contents); |
| 17 | write(Path::new(&env::var("OUT_DIR").unwrap()).join(file), contents) |
| 18 | } |
| 19 | |
| 20 | fn main() { |
| 21 | println!("cargo::rerun-if-changed=build.rs"); |
Tested by
no test coverage detected