1313//! [`pyo3`]: https://pyo3.rs/
1414use sha2:: Digest ;
1515use std:: {
16- fs:: { self , File } ,
17- io:: { self , Read } ,
16+ fs:: File ,
17+ io:: { Read , Write } ,
1818 path:: PathBuf ,
1919} ;
2020
@@ -37,7 +37,7 @@ fn download_wasi_sdk() -> Result<(), Box<dyn std::error::Error>> {
3737 println ! ( "cargo:rerun-if-changed=build.rs" ) ;
3838
3939 let downloads_dir = PathBuf :: from ( "downloads" ) ;
40- fs:: create_dir_all ( & downloads_dir) ?;
40+ std :: fs:: create_dir_all ( & downloads_dir) ?;
4141
4242 let wasi_sysroot_dir = downloads_dir. join ( "wasi-sysroot" ) ;
4343
@@ -76,7 +76,7 @@ fn download_wasi_sdk() -> Result<(), Box<dyn std::error::Error>> {
7676 let digest = hasher. finalize ( ) ;
7777 let hex_digest = format ! ( "{:x}" , digest) ;
7878 if hex_digest != SHA256_WASI_SDK_SYSROOT {
79- fs:: remove_file ( & tar_gz_path) ?;
79+ std :: fs:: remove_file ( & tar_gz_path) ?;
8080 return Err ( format ! (
8181 "SHA256 mismatch for wasi-sysroot.tar.gz: expected {}, got {}" ,
8282 SHA256_WASI_SDK_SYSROOT , hex_digest
@@ -100,10 +100,10 @@ fn download_wasi_sdk() -> Result<(), Box<dyn std::error::Error>> {
100100 if !extracted_path. exists ( ) {
101101 return Err ( format ! ( "expected directory not found: {}" , extracted_path. display( ) ) . into ( ) ) ;
102102 }
103- fs:: rename ( extracted_path, & wasi_sysroot_dir) ?;
103+ std :: fs:: rename ( extracted_path, & wasi_sysroot_dir) ?;
104104
105105 // Clean up the downloaded tar.gz file
106- fs:: remove_file ( & tar_gz_path) ?;
106+ std :: fs:: remove_file ( & tar_gz_path) ?;
107107
108108 println ! ( "cargo:warning=WASI SDK sysroot downloaded and extracted successfully" ) ;
109109
0 commit comments