refactor: backend (#7102)

* refactor(tray): move tray log opening to utils helper

* refactor(enhance): move owned config through pipeline

* refactor(enhance): move sequence values in use_seq

* refactor(enhance): move values while sorting fields

* refactor(enhance): move values when lowercasing owned config

* refactor(backend): move owned config values in utilities

* refactor(tray): borrow hotkey accelerators

* refactor(core): borrow proxy config strings

* fix(backend): preserve config patch semantics

* refactor(enhance): clarify config transform names
This commit is contained in:
Tunglies
2026-05-26 10:47:03 +00:00
committed by GitHub
parent a287d13b4d
commit 761209bbbc
11 changed files with 198 additions and 157 deletions
+4 -3
View File
@@ -7,6 +7,7 @@ use clash_verge_logging::{Type, logging};
use serde::{Deserialize, Serialize};
use serde_yaml_ng::{Mapping, Value};
use std::{
borrow::Cow,
net::{IpAddr, Ipv4Addr, SocketAddr},
str::FromStr as _,
};
@@ -267,11 +268,11 @@ impl IClashTemp {
let val_str = val_str.trim();
let val = match val_str.starts_with(':') {
true => format!("127.0.0.1{val_str}"),
false => val_str.to_owned(),
true => Cow::Owned(format!("127.0.0.1{val_str}")),
false => Cow::Borrowed(val_str),
};
SocketAddr::from_str(val.as_str()).ok().map(|s| s.to_string())
SocketAddr::from_str(&val).ok().map(|s| s.to_string())
}
None => None,
})