mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-06 09:02:08 +08:00
refactor(profile): improve error handling for file not found case
refactor(merge): simplify deep_merge function signature chore: remove unused fmt_bytes function and related tests chore: clean up help module by removing unused macros chore: remove format module from utils
This commit is contained in:
@@ -13,7 +13,6 @@ use crate::{
|
||||
feat,
|
||||
module::auto_backup::{AutoBackupManager, AutoBackupTrigger},
|
||||
process::AsyncHandler,
|
||||
ret_err,
|
||||
utils::{dirs, help},
|
||||
};
|
||||
use clash_verge_draft::SharedDraft;
|
||||
@@ -455,7 +454,7 @@ pub async fn view_profile(index: String) -> CmdResult {
|
||||
|
||||
let path = dirs::app_profiles_dir().stringify_err()?.join(file.as_str());
|
||||
if !path.exists() {
|
||||
ret_err!("the file not found");
|
||||
return CmdResult::Err(format!("file not found \"{}\"", path.display()).into());
|
||||
}
|
||||
|
||||
help::open_file(path).stringify_err()
|
||||
|
||||
Reference in New Issue
Block a user