1fn main() {2 #[cfg(feature = "codegenerated-stdlib")]3 {4 use std::{env, fs::File, io::Write, path::Path};56 use jrsonnet_parser::{parse, ParserSettings, Source};7 use structdump::CodegenResult;89 let parsed = parse(10 include_str!("./src/std.jsonnet"),11 &ParserSettings {12 source: Source::new_virtual(13 "<std>".into(),14 include_str!("./src/std.jsonnet").into(),15 ),16 },17 )18 .expect("parse");1920 let mut out = CodegenResult::default();2122 let v = out.codegen(&parsed, true);2324 {25 let out_dir = env::var("OUT_DIR").unwrap();26 let dest_path = Path::new(&out_dir).join("stdlib.rs");27 let mut f = File::create(dest_path).unwrap();28 f.write_all(29 ("#[allow(clippy::redundant_clone)]".to_owned() + &v.to_string()).as_bytes(),30 )31 .unwrap();32 }33 }34}