MCPcopy Create free account
hub / github.com/csskit/csskit / write_tokens

Function write_tokens

crates/css_ast/build.rs:14–18  ·  view source on GitHub ↗
(file: &str, source: TokenStream)

Source from the content-addressed store, hash-verified

12};
13
14fn 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
20fn main() {
21 println!("cargo::rerun-if-changed=build.rs");

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected