mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 11:42:21 +08:00
fix: parse log cause panic
This commit is contained in:
parent
0cb802ed9a
commit
e90158809a
|
@ -55,10 +55,13 @@ fn clash_client_info() -> Result<(String, HeaderMap)> {
|
|||
|
||||
/// 缩短clash的日志
|
||||
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();
|
||||
}
|
||||
(&log[9..]).to_owned()
|
||||
if log.len() > 9 {
|
||||
return (&log[9..]).to_owned();
|
||||
}
|
||||
return log;
|
||||
}
|
||||
|
||||
/// 缩短clash -t的错误输出
|
||||
|
|
Loading…
Reference in New Issue
Block a user