Procházet zdrojové kódy

Update build.rs to print path when writing version_string.txt fails

ariasuni před 4 roky
rodič
revize
d2b6cc9185
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      build.rs

+ 2 - 1
build.rs

@@ -38,9 +38,10 @@ fn main() -> io::Result<()> {
 
     // We need to create these files in the Cargo output directory.
     let out = PathBuf::from(env::var("OUT_DIR").unwrap());
+    let path = &out.join("version_string.txt");
 
     // Bland version text
-    let mut f = File::create(&out.join("version_string.txt"))?;
+    let mut f = File::create(path).expect(&path.to_string_lossy());
     writeln!(f, "{}", strip_codes(&ver))?;
 
     Ok(())