Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Nov 26, 2023
1 parent 313771e commit 7184b64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/wasi-vfs-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fn is_wasi_reactor(bytes: &[u8]) -> bool {
return false;
}
wasmparser::Payload::End(_) => return false,
_ => continue
_ => continue,
}
}
false
Expand Down
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ mod wasi_snapshot_preview1;
use embed::LinkedStorage as DefaultStorage;
use embed::{EmbeddedFs, NodeIdTrait, Storage};

use std::{collections::HashMap, ffi::{CStr, CString}};
use std::{
collections::HashMap,
ffi::{CStr, CString},
};
use wasi::Fd;

/// User-facing file descriptor managed by wasi-vfs
Expand Down Expand Up @@ -63,11 +66,12 @@ impl<S: Storage> FileSystem<S> {
};

let mut prefix = Vec::with_capacity(prestat.u.dir.pr_name_len + 1);
match wasi::fd_prestat_dir_name(fd, prefix.as_mut_ptr(), prestat.u.dir.pr_name_len) {
match wasi::fd_prestat_dir_name(fd, prefix.as_mut_ptr(), prestat.u.dir.pr_name_len)
{
Ok(_) => {
prefix.set_len(prestat.u.dir.pr_name_len + 1);
prefix[prestat.u.dir.pr_name_len] = 0;
},
}
Err(other) => {
panic!("failed to get prestat dir name: {}", other);
}
Expand Down

0 comments on commit 7184b64

Please sign in to comment.