From 16526ec45f5cc020ea93f7ef932540295bd3c20a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 4 Jan 2023 13:51:54 -0700 Subject: [PATCH] update `readdir` etc to use new error handling scheme Signed-off-by: Joel Dice --- host/src/filesystem.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/host/src/filesystem.rs b/host/src/filesystem.rs index 52bf362d..03364a42 100644 --- a/host/src/filesystem.rs +++ b/host/src/filesystem.rs @@ -342,6 +342,7 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { self.table_mut() .push(Box::new(Mutex::new(iterator))) + .map(Ok) .map_err(convert) } @@ -359,11 +360,11 @@ impl wasi_filesystem::WasiFilesystem for WasiCtx { .transpose() .map_err(convert)?; - Ok(entity.map(|e| wasi_filesystem::DirEntry { + Ok(Ok(entity.map(|e| wasi_filesystem::DirEntry { ino: Some(e.inode), type_: e.filetype.into(), name: e.name, - })) + }))) } async fn close_dir_entry_stream(