quick fmt

This commit is contained in:
SpikeHD
2023-04-21 12:49:09 -07:00
parent 829b9822cb
commit 5480af7835
2 changed files with 5 additions and 9 deletions

View File

@@ -214,11 +214,11 @@ fn restart_grasscutter(window: tauri::Window) -> bool {
// Kill it // Kill it
if process.kill() { if process.kill() {
// Also kill the cmd it was open in // Also kill the cmd it was open in
if let Some(parent) = system.process(Pid::from(process.parent().unwrap())) { if let Some(parent) = system.process(process.parent().unwrap()) {
parent.kill(); parent.kill();
} }
for process_gc in system.processes_by_name("java") { for process_gc in system.processes_by_name("java") {
if process_gc.cmd().last().unwrap().contains(&"grasscutter") { if process_gc.cmd().last().unwrap().contains("grasscutter") {
process_gc.kill(); process_gc.kill();
} }
} }

View File

@@ -41,8 +41,8 @@ struct ProxyHandler;
#[tauri::command] #[tauri::command]
pub fn set_proxy_addr(addr: String) { pub fn set_proxy_addr(addr: String) {
if addr.contains(" ") { if addr.contains(' ') {
let addr2 = addr.replace(" ", ""); let addr2 = addr.replace(' ', "");
*SERVER.lock().unwrap() = addr2; *SERVER.lock().unwrap() = addr2;
} else { } else {
*SERVER.lock().unwrap() = addr; *SERVER.lock().unwrap() = addr;
@@ -93,11 +93,7 @@ impl HttpHandler for ProxyHandler {
async fn should_intercept(&mut self, _ctx: &HttpContext, _req: &Request<Body>) -> bool { async fn should_intercept(&mut self, _ctx: &HttpContext, _req: &Request<Body>) -> bool {
let uri = _req.uri().to_string(); let uri = _req.uri().to_string();
if uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com") { uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com")
true
} else {
false
}
} }
} }