Add an is_directory() helper method. (#1373)
This allows `ctx` to avoid depending on wasi::FileType.
This commit is contained in:
@@ -137,6 +137,10 @@ pub(crate) trait VirtualFile: MovableFile {
|
||||
|
||||
fn get_file_type(&self) -> types::Filetype;
|
||||
|
||||
fn is_directory(&self) -> bool {
|
||||
self.get_file_type() == types::Filetype::Directory
|
||||
}
|
||||
|
||||
fn get_rights_base(&self) -> types::Rights {
|
||||
types::Rights::empty()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user