refactor: pure merge

This commit is contained in:
MystiPanda
2024-06-30 07:52:30 +08:00
parent 171bd6b327
commit 28fb0b433b
4 changed files with 36 additions and 112 deletions

View File

@@ -11,8 +11,8 @@ pub const HANDLE_FIELDS: [&str; 11] = [
"allow-lan",
"log-level",
"ipv6",
"secret",
"external-controller",
"secret",
];
pub const DEFAULT_FIELDS: [&str; 5] = [
@@ -23,19 +23,6 @@ pub const DEFAULT_FIELDS: [&str; 5] = [
"rules",
];
pub fn use_filter(config: Mapping, filter: &Vec<String>) -> Mapping {
let mut ret = Mapping::new();
for (key, value) in config.into_iter() {
if let Some(key) = key.as_str() {
if filter.contains(&key.to_string()) {
ret.insert(Value::from(key), value);
}
}
}
ret
}
pub fn use_lowercase(config: Mapping) -> Mapping {
let mut ret = Mapping::new();