Skip to content

Commit 13a5e29

Browse files
author
cht
committed
fmt
1 parent ad59a08 commit 13a5e29

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

src/spider.rs

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ impl Information {
8383
}
8484
pub fn running_json(&self) -> String {
8585
if self.func == *"\"vmess\"" {
86-
format!(
87-
"{{
86+
format!(
87+
"{{
8888
\"inbounds\":[{{
8989
\"port\":8889,
9090
\"listen\":\"127.0.0.1\",
@@ -198,10 +198,19 @@ impl Information {
198198
}}]
199199
}}
200200
}}",
201-
self.func, self.add, remove_quotation(self.port.clone()), remove_quotation(self.aid.clone()), self.id, self.path, self.path, self.net, self.path
202-
)
203-
}else{
204-
format!("{{
201+
self.func,
202+
self.add,
203+
remove_quotation(self.port.clone()),
204+
remove_quotation(self.aid.clone()),
205+
self.id,
206+
self.path,
207+
self.path,
208+
self.net,
209+
self.path
210+
)
211+
} else {
212+
format!(
213+
"{{
205214
\"api\":{{
206215
\"service\":[
207216
\"HandlerService\",
@@ -411,9 +420,13 @@ impl Information {
411420
}},
412421
\"stats\": {{
413422
}}
414-
}}",self.add,self.net,self.id,remove_quotation(self.port.clone()))
423+
}}",
424+
self.add,
425+
self.net,
426+
self.id,
427+
remove_quotation(self.port.clone())
428+
)
415429
}
416-
417430
}
418431
fn get_the_link(&self) -> String {
419432
let mut temp = String::new();

src/utils.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn start_v2core() -> String {
4848
Err(_) => {
4949
let core = "{\n\"v2core\":\"/usr/bin/v2ray\"\n}".to_string();
5050
if let Err(err) = create_json_file(Save::V2ray, core.clone()) {
51-
panic!("{}",err);
51+
panic!("{}", err);
5252
}
5353
core
5454
}
@@ -62,7 +62,8 @@ pub fn start() -> Vec<Information> {
6262
let messages = match get_json(Save::Storage) {
6363
Ok(output) => output,
6464
Err(_) => {
65-
create_json_file(Save::Storage, "[]".to_string()).unwrap_or_else(|err| panic!("{}", err));
65+
create_json_file(Save::Storage, "[]".to_string())
66+
.unwrap_or_else(|err| panic!("{}", err));
6667
"[]".to_string()
6768
}
6869
};

0 commit comments

Comments
 (0)