mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 05:13:44 +08:00
fix: parse log cause panic
This commit is contained in:
parent
1a209a54c6
commit
ff3460e100
@ -55,10 +55,13 @@ fn clash_client_info() -> Result<(String, HeaderMap)> {
|
|||||||
|
|
||||||
/// 缩短clash的日志
|
/// 缩短clash的日志
|
||||||
pub fn parse_log(log: String) -> String {
|
pub fn parse_log(log: String) -> String {
|
||||||
if log.starts_with("time=") {
|
if log.starts_with("time=") && log.len() > 33 {
|
||||||
return (&log[33..]).to_owned();
|
return (&log[33..]).to_owned();
|
||||||
}
|
}
|
||||||
(&log[9..]).to_owned()
|
if log.len() > 9 {
|
||||||
|
return (&log[9..]).to_owned();
|
||||||
|
}
|
||||||
|
return log;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 缩短clash -t的错误输出
|
/// 缩短clash -t的错误输出
|
||||||
|
Loading…
x
Reference in New Issue
Block a user