refactor(enhance): rename ChainSupport variants to Mihomo names

Clash is a legacy name; the variants match the verge-mihomo and
verge-mihomo-alpha cores they gate.
This commit is contained in:
Tunglies
2026-10-28 09:15:46 +08:00
parent e5b691b47a
commit 93f70f4c36
2 changed files with 8 additions and 7 deletions
+1
View File
@@ -16,6 +16,7 @@ pub mod network {
pub mod proxy {
/// Single source of the macOS default bypass list; both proxy backends compose from it.
#[cfg(target_os = "macos")]
pub const MACOS_DEFAULT_BYPASS: &str =
"127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,localhost,*.local,*.crashlytics.com,<local>";
}
+7 -7
View File
@@ -24,8 +24,8 @@ pub enum ChainType {
#[derive(Debug, Clone)]
pub enum ChainSupport {
ClashMeta,
ClashMetaAlpha,
Mihomo,
MihomoAlpha,
}
// Helper trait to allow async conversion
@@ -74,10 +74,10 @@ impl ChainItem {
let meta_guard = Self::to_script("verge_meta_guard", "");
vec![
(ChainSupport::ClashMeta, hy_alpn.clone()),
(ChainSupport::ClashMeta, meta_guard.clone()),
(ChainSupport::ClashMetaAlpha, hy_alpn),
(ChainSupport::ClashMetaAlpha, meta_guard),
(ChainSupport::Mihomo, hy_alpn.clone()),
(ChainSupport::Mihomo, meta_guard.clone()),
(ChainSupport::MihomoAlpha, hy_alpn),
(ChainSupport::MihomoAlpha, meta_guard),
]
}
@@ -94,7 +94,7 @@ impl ChainSupport {
match core {
Some(core) => matches!(
(self, core.as_str()),
(Self::ClashMeta, "verge-mihomo") | (Self::ClashMetaAlpha, "verge-mihomo-alpha")
(Self::Mihomo, "verge-mihomo") | (Self::MihomoAlpha, "verge-mihomo-alpha")
),
None => true,
}