修复客户端更新代码格式
Project CI / Frontend tests (push) Successful in 4m4s
Project CI / Backend tests (push) Successful in 8m3s
Project CI / Repository checks (push) Successful in 2m48s
Project CI / Native shell tests (push) Failing after 17m21s

同步 Rust 更新下载与重启逻辑的 rustfmt 输出
This commit is contained in:
2026-09-01 20:17:42 +08:00
parent 89e021f52b
commit eb14cec0b8
@@ -97,7 +97,8 @@ async fn download_agc_update(
expected_sha256: Option<String>,
expected_size: Option<u64>,
) -> Result<String, String> {
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())