Add an is_directory() helper method. (#1373)
This allows `ctx` to avoid depending on wasi::FileType.
This commit is contained in:
@@ -351,7 +351,7 @@ impl WasiCtxBuilder {
|
||||
}
|
||||
}
|
||||
Descriptor::VirtualFile(virt) => {
|
||||
if virt.get_file_type() != types::Filetype::Directory {
|
||||
if !virt.is_directory() {
|
||||
return Err(WasiCtxBuilderError::NotADirectory(guest_path));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user