mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-05 05:50:04 +08:00
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:
@@ -6,7 +6,7 @@ use crate::core::handle::Handle;
|
||||
use crate::core::notify::NoticeStatus;
|
||||
use crate::utils::dirs;
|
||||
use crate::{
|
||||
config::{Config, IProfiles, IVerge, PrfItem},
|
||||
config::{Config, IProfiles, IVerge, PrfItem, profiles::current_mapping},
|
||||
constants,
|
||||
utils::tmpl,
|
||||
};
|
||||
@@ -139,8 +139,7 @@ async fn collect_profile_items(profiles: &IProfiles) -> Result<RenderProfile> {
|
||||
None => return Ok(default_profile()),
|
||||
};
|
||||
|
||||
let current = profiles
|
||||
.current_mapping()
|
||||
let current = current_mapping(profiles)
|
||||
.await
|
||||
.with_context(|| format!("failed to read current profile \"{current_profile_uid}\""))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user