chore: inline crate clash-verge-types to module for better maintenance (#6142)

This commit is contained in:
Tunglies
2026-01-23 14:00:51 +00:00
committed by GitHub
parent d81aa5f233
commit 5e976c2fe1
11 changed files with 13 additions and 52 deletions
+7 -10
View File
@@ -61,14 +61,11 @@ pub fn use_sort(config: Mapping) -> Mapping {
ret
}
pub fn use_keys(config: &Mapping) -> Vec<String> {
config
.iter()
.filter_map(|(key, _)| key.as_str())
.map(|s: &str| {
let mut s: String = s.into();
s.make_ascii_lowercase();
s
})
.collect()
#[inline]
pub fn use_keys<'a>(config: &'a Mapping) -> impl Iterator<Item = String> + 'a {
config.iter().filter_map(|(key, _)| key.as_str()).map(|s: &str| {
let mut s: String = s.into();
s.make_ascii_lowercase();
s
})
}
+1 -1
View File
@@ -310,7 +310,7 @@ fn process_global_items(
profile_name: &String,
) -> (Mapping, Vec<String>, HashMap<String, ResultLog>) {
let mut result_map = HashMap::new();
let mut exists_keys = use_keys(&config);
let mut exists_keys = use_keys(&config).collect::<Vec<_>>();
if let ChainType::Merge(merge) = global_merge.data {
exists_keys.extend(use_keys(&merge));