refactor(seq): use if let filter for selector group dedup

This commit is contained in:
Slinetrac 2025-12-28 11:05:28 +08:00
parent c40cdf6b55
commit 0193ba7bf9
No known key found for this signature in database

View File

@ -109,14 +109,13 @@ pub fn use_seq(seq: SeqMap, mut config: Mapping, field: &str) -> Mapping {
}
}
for value in base_seq {
match &value {
Value::String(name) => {
if existing.insert(name.to_owned()) {
seq.push(value);
}
}
_ => seq.push(value),
if let Value::String(name) = &value
&& !existing.insert(name.to_owned())
{
continue;
}
seq.push(value);
}
proxies_seq = Some(seq);
appended_to_selector = true;