mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-23 08:32:23 +03:00
Format Rust code using rustfmt
This commit is contained in:
parent
31aad8d5e3
commit
1620538e46
@ -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",
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user