Format Rust code using rustfmt

This commit is contained in:
github-actions[bot] 2023-12-19 22:05:20 +00:00 committed by GitHub
parent 859d7db4fa
commit 7a43270559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,14 +159,13 @@ fn main() {
run_command(Command::new("touch").args([&format!("{}/world", pwd.display())])).unwrap();
// Build wasm32-wasi apps, zip, and add to bootstrapped_processes.rs
let mut bootstrapped_processes = fs::File::create(format!(
"{}/src/bootstrapped_processes.rs",
pwd.display(),
)).unwrap();
let mut bootstrapped_processes =
fs::File::create(format!("{}/src/bootstrapped_processes.rs", pwd.display(),)).unwrap();
writeln!(
bootstrapped_processes,
"pub static BOOTSTRAPPED_PROCESSES: &[(&str, &'static [u8])] = &[",
).unwrap();
)
.unwrap();
let modules_dir = format!("{}/modules", pwd.display());
for entry in std::fs::read_dir(modules_dir).unwrap() {
let entry_path = entry.unwrap().path();
@ -193,15 +192,8 @@ fn main() {
}
// After processing all sub-apps, zip the parent's pkg/ directory
let zip_filename = format!(
"{}.zip",
entry_path.file_name().unwrap().to_str().unwrap(),
);
let zip_path = format!(
"{}/target/{}",
pwd.display(),
zip_filename,
);
let zip_filename = format!("{}.zip", entry_path.file_name().unwrap().to_str().unwrap(),);
let zip_path = format!("{}/target/{}", pwd.display(), zip_filename,);
let writer = std::fs::File::create(&zip_path).unwrap();
let options = zip::write::FileOptions::default()
.compression_method(zip::CompressionMethod::Stored)
@ -233,9 +225,9 @@ fn main() {
writeln!(
bootstrapped_processes,
" (\"{}\", include_bytes!(\"{}\")),",
zip_filename,
zip_path,
).unwrap();
zip_filename, zip_path,
)
.unwrap();
}
writeln!(bootstrapped_processes, "];").unwrap();
}