From 7184b64e6df998eef8ab6510fd449740caf79a78 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Sun, 26 Nov 2023 12:14:51 +0000 Subject: [PATCH] cargo fmt --- crates/wasi-vfs-cli/src/lib.rs | 2 +- src/lib.rs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/wasi-vfs-cli/src/lib.rs b/crates/wasi-vfs-cli/src/lib.rs index a77f701..8b11eb8 100644 --- a/crates/wasi-vfs-cli/src/lib.rs +++ b/crates/wasi-vfs-cli/src/lib.rs @@ -95,7 +95,7 @@ fn is_wasi_reactor(bytes: &[u8]) -> bool { return false; } wasmparser::Payload::End(_) => return false, - _ => continue + _ => continue, } } false diff --git a/src/lib.rs b/src/lib.rs index 5852666..0d8777d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 @@ -63,11 +66,12 @@ impl FileSystem { }; 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); }