fix: move is_dir & is_file to path

This commit is contained in:
YuKun Liu committed 2022-09-22 17:01:38 -07:00
1 parent 1c59c902a6
commit b59e41eaee
2 files changed
+21 -9

No files matched your search

-8
View File
@@ -14,14 +14,6 @@ impl UserData for PluginFileSystem {
let path = PathBuf::from(path);
Ok(path.exists())
});
methods.add_function("is_dir", |_, path: String| {
let path = PathBuf::from(path);
Ok(path.is_dir())
});
methods.add_function("is_file", |_, path: String| {
let path = PathBuf::from(path);
Ok(path.is_file())
});
methods.add_function("create_dir", |_, args: (String, bool)| {
let path = args.0;
let recursive = args.1;