From eb14cec0b84ff13770df2714bfc22aa781cfd8fa Mon Sep 17 00:00:00 2001 From: kdletters Date: Tue, 1 Sep 2026 20:17:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 同步 Rust 更新下载与重启逻辑的 rustfmt 输出 --- apps/ai-game-creator-shell/src-tauri/src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/main.rs b/apps/ai-game-creator-shell/src-tauri/src/main.rs index 468bbcc5b..245918c85 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/main.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/main.rs @@ -97,7 +97,8 @@ async fn download_agc_update( expected_sha256: Option, expected_size: Option, ) -> Result { - let parsed = url::Url::parse(download_url.trim()).map_err(|_| "更新下载地址无效".to_string())?; + let parsed = + url::Url::parse(download_url.trim()).map_err(|_| "更新下载地址无效".to_string())?; if parsed.scheme() != "https" || parsed.host_str() != Some(AGC_UPDATE_OSS_HOST) { return Err("更新下载地址必须来自受信任的 OSS".to_string()); } @@ -215,8 +216,8 @@ async fn download_agc_update( let _ = fs::remove_file(&temporary); return Err(format!("提交更新文件失败:{error}")); } - let relaunch_path = std::env::current_exe() - .map_err(|error| format!("无法定位客户端程序:{error}"))?; + let relaunch_path = + std::env::current_exe().map_err(|error| format!("无法定位客户端程序:{error}"))?; launch_agc_installer(&target, &relaunch_path)?; app.exit(0); Ok(target.to_string_lossy().into_owned())