fix: code lint

This commit is contained in:
huzibaca
2024-09-24 20:06:25 +08:00
parent d9e5387bff
commit 57f1c005e6
7 changed files with 24 additions and 32 deletions

View File

@@ -48,11 +48,11 @@ pub fn app_home_dir() -> Result<PathBuf> {
match app_handle.path().data_dir() {
Ok(dir) => {
return Ok(dir.join(APP_ID));
Ok(dir.join(APP_ID))
}
Err(e) => {
log::error!("Failed to get the app home directory: {}", e);
return Err(anyhow::anyhow!("Failed to get the app homedirectory"));
Err(anyhow::anyhow!("Failed to get the app homedirectory"))
}
}
}
@@ -62,13 +62,13 @@ pub fn app_resources_dir() -> Result<PathBuf> {
let app_handle = handle::Handle::global().app_handle().unwrap();
match app_handle.path().resource_dir() {
Ok(dir) => {
return Ok(dir.join("resources"));
Ok(dir.join("resources"))
}
Err(e) => {
log::error!("Failed to get the resource directory: {}", e);
return Err(anyhow::anyhow!("Failed to get the resource directory"));
Err(anyhow::anyhow!("Failed to get the resource directory"))
}
};
}
}
/// profiles dir

View File

@@ -332,7 +332,7 @@ pub async fn startup_script() -> Result<()> {
app_handle
.shell()
.command(shell_type)
.current_dir(working_dir.to_path_buf())
.current_dir(working_dir)
.args(&[script_path])
.output()
.await?;