We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_directory()
1 parent a7d84af commit 815e340Copy full SHA for 815e340
crates/wasi-common/src/ctx.rs
@@ -351,7 +351,7 @@ impl WasiCtxBuilder {
351
}
352
353
Descriptor::VirtualFile(virt) => {
354
- if virt.get_file_type() != types::Filetype::Directory {
+ if !virt.is_directory() {
355
return Err(WasiCtxBuilderError::NotADirectory(guest_path));
356
357
crates/wasi-common/src/virtfs.rs
@@ -137,6 +137,10 @@ pub(crate) trait VirtualFile: MovableFile {
137
138
fn get_file_type(&self) -> types::Filetype;
139
140
+ fn is_directory(&self) -> bool {
141
+ self.get_file_type() == types::Filetype::Directory
142
+ }
143
+
144
fn get_rights_base(&self) -> types::Rights {
145
types::Rights::empty()
146
0 commit comments