mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-11-30 01:44:58 +03:00
Format Rust code using rustfmt
This commit is contained in:
parent
859d7db4fa
commit
7a43270559
26
build.rs
26
build.rs
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user