fix: un-wrap Result for init_plugin_dir

This commit is contained in:
YuKun Liu 2023-05-23 13:45:45 -07:00
parent 3b1eec2ed2
commit 719015378b

View file

@ -42,7 +42,7 @@ impl PluginManager {
let manager = lua.create_table().unwrap();
let name_index = lua.create_table().unwrap();
let plugin_dir = Self::init_plugin_dir().unwrap();
let plugin_dir = Self::init_plugin_dir();
let api = lua.create_table().unwrap();
@ -288,7 +288,7 @@ impl PluginManager {
Ok(())
}
pub fn init_plugin_dir() -> anyhow::Result<PathBuf> {
pub fn init_plugin_dir() -> PathBuf {
let app_path = app_path();
let plugin_path = app_path.join("plugins");
if !plugin_path.is_dir() {
@ -298,7 +298,7 @@ impl PluginManager {
log::error!("Failed to init plugin dir, error caused by {}. ", err);
}
}
Ok(plugin_path)
plugin_path
}
pub fn plugin_list() -> Vec<String> {