mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 15:14:35 +01:00
quick fmt
This commit is contained in:
@@ -214,11 +214,11 @@ fn restart_grasscutter(window: tauri::Window) -> bool {
|
||||
// Kill it
|
||||
if process.kill() {
|
||||
// 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();
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ struct ProxyHandler;
|
||||
|
||||
#[tauri::command]
|
||||
pub fn set_proxy_addr(addr: String) {
|
||||
if addr.contains(" ") {
|
||||
let addr2 = addr.replace(" ", "");
|
||||
if addr.contains(' ') {
|
||||
let addr2 = addr.replace(' ', "");
|
||||
*SERVER.lock().unwrap() = addr2;
|
||||
} else {
|
||||
*SERVER.lock().unwrap() = addr;
|
||||
@@ -93,11 +93,7 @@ impl HttpHandler for ProxyHandler {
|
||||
async fn should_intercept(&mut self, _ctx: &HttpContext, _req: &Request<Body>) -> bool {
|
||||
let uri = _req.uri().to_string();
|
||||
|
||||
if uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com") {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user