mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-30 18:52:12 +08:00
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:
@@ -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>";
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user