mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-12-06 14:40:08 +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:
@@ -8,7 +8,7 @@ use crate::{
|
||||
config::{
|
||||
Config,
|
||||
dns::{ProfileDnsSettings, dns_override_source},
|
||||
profiles::PROFILE_WRITE_LOCK,
|
||||
profiles::{PROFILE_WRITE_LOCK, current_mapping},
|
||||
},
|
||||
constants::files::DNS_CONFIG,
|
||||
core::CoreManager,
|
||||
@@ -36,7 +36,7 @@ pub async fn set_dns_override(
|
||||
);
|
||||
let source = dns_override_source(
|
||||
profiles.current.as_deref().unwrap_or_default(),
|
||||
&profiles.current_mapping().await?,
|
||||
¤t_mapping(&profiles).await?,
|
||||
)?;
|
||||
if enabled && let Some(source) = source.as_ref().filter(|source| Some(*source) != confirmation.as_ref()) {
|
||||
return Ok(DnsOverrideOutcome::ConfirmationRequired { source: source.clone() });
|
||||
|
||||
Reference in New Issue
Block a user