From 91ca1a3125efacf0eba5a547b0df5ad303b14cc1 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Tue, 21 Feb 2023 08:10:22 +0800 Subject: [PATCH] make README.md build.rs compile (#340) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fbe67d4..4c4295d 100644 --- a/README.md +++ b/README.md @@ -97,16 +97,16 @@ The `build.rs` file should look something like this: fn main() { let src = "../sample_openapi/keeper.json"; println!("cargo:rerun-if-changed={}", src); - let file = File::open(src).unwrap(); + let file = std::fs::File::open(src).unwrap(); let spec = serde_json::from_reader(file).unwrap(); let mut generator = progenitor::Generator::default(); let content = generator.generate_text(&spec).unwrap(); - let mut out_file = Path::new(&env::var("OUT_DIR").unwrap()).to_path_buf(); + let mut out_file = std::path::Path::new(&std::env::var("OUT_DIR").unwrap()).to_path_buf(); out_file.push("codegen.rs"); - fs::write(out_file, content).unwrap(); + std::fs::write(out_file, content).unwrap(); } ```