Format Rust code using rustfmt

This commit is contained in:
github-actions[bot] 2023-10-05 17:42:51 +00:00 committed by GitHub
parent 31aad8d5e3
commit 1620538e46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 6 deletions

View File

@ -19,7 +19,9 @@ pub async fn load_fs(
// load/create fs directory, manifest + log if none.
let fs_directory_path_str = format!("{}/fs", &home_directory_path);
let new_boot = create_dir_if_dne(&fs_directory_path_str).await.expect("failed creating fs dir!");
let new_boot = create_dir_if_dne(&fs_directory_path_str)
.await
.expect("failed creating fs dir!");
let fs_directory_path: std::path::PathBuf =
fs::canonicalize(fs_directory_path_str).await.unwrap();
@ -73,15 +75,27 @@ pub async fn load_fs(
if new_boot {
// bootstrap filesystem
let _ = bootstrap(&our_name, &kernel_process_id, &mut process_map, &mut manifest).await.expect("fresh bootstrap failed!");
let _ = bootstrap(
&our_name,
&kernel_process_id,
&mut process_map,
&mut manifest,
)
.await
.expect("fresh bootstrap failed!");
}
Ok((process_map, manifest))
}
// function run only upon fresh boot.
// goes through /modules, gets their .wasm bytes, injects into fs and kernel state.
async fn bootstrap(our_name: &str, kernel_process_id: &FileIdentifier, process_map: &mut ProcessMap, manifest: &mut Manifest) -> Result<()> {
// function run only upon fresh boot.
// goes through /modules, gets their .wasm bytes, injects into fs and kernel state.
async fn bootstrap(
our_name: &str,
kernel_process_id: &FileIdentifier,
process_map: &mut ProcessMap,
manifest: &mut Manifest,
) -> Result<()> {
let names_and_bytes = get_processes_from_directories().await;
const RUNTIME_MODULES: [&str; 8] = [
"filesystem",

View File

@ -188,7 +188,7 @@ async fn main() {
let http_server_port = http_server::find_open_port(8080).await.unwrap();
let (kill_tx, kill_rx) = oneshot::channel::<bool>();
let keyfile = fs::read(format!("{}/.keys", home_directory_path)).await;
let (our, networking_keypair, jwt_secret_bytes, file_key): (
Identity,
signature::Ed25519KeyPair,