refactor(profile): extract profile models and index rules

Move profile models and index rules into the crate, preserving serialization and returning a typed missing-profile error.
This commit is contained in:
Tunglies
2026-12-02 02:10:09 +08:00
committed by GitHub
parent 0605236489
commit 9de413db1e
19 changed files with 1018 additions and 856 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
use crate::{
config::{Config, IClashTemp, IProfiles, IVerge},
config::{Config, IClashTemp, IVerge, profiles::load_profiles},
core::{CoreManager, auto_backup, backup, proxy_control, proxy_control::SystemProxyStateUnknown},
process::AsyncHandler,
utils::{
@@ -46,7 +46,7 @@ async fn finalize_restored_verge_config(
});
clash_draft.apply();
let restored_profiles = IProfiles::new().await;
let restored_profiles = load_profiles().await;
let profiles_draft = Config::profiles().await;
profiles_draft.edit_draft(|d| {
*d = restored_profiles;