From f776bf89951f2007f63391c010015f5eb7f67649 Mon Sep 17 00:00:00 2001 From: Ap_Tx <3045929398@qq.com> Date: Sat, 3 Oct 2026 11:20:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=A8=20crate=20?= =?UTF-8?q?=E5=8F=AF=E8=A7=81=E6=80=A7=E4=B8=8E=20Version=20=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=EF=BC=8C=E8=A1=A5=E5=85=85=20semver=20=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - updater_impl.rs: Version 改从 semver 导入(tauri_plugin_updater::Version 是私有) - files.rs: 移除未使用的 list 导入 - state/mod.rs: update_http_client_for_settings 由 pub(crate) 改 pub(apps/app 跨 crate 调用) - workspace 与 apps/app 补充 semver 依赖,同步 Cargo.lock --- Cargo.lock | 1 + Cargo.toml | 1 + apps/app/Cargo.toml | 1 + apps/app/src/api/files.rs | 2 +- apps/app/src/updater_impl.rs | 3 ++- packages/app-lib/src/state/mod.rs | 2 +- 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9782bb4..4d43cbf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6973,6 +6973,7 @@ dependencies = [ "path-util", "quartz_nbt", "regex", + "semver", "serde", "serde_json", "serde_with", diff --git a/Cargo.toml b/Cargo.toml index 1338da0..6a7a81b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,6 +84,7 @@ rgb = "0.8.52" rustls = { version = "0.23.42", default-features = false, features = ["ring", "std", "tls12"] } rustls-native-certs = "0.8.4" rustls-pki-types = "1.15.0" +semver = "1.0.28" serde = "1.0.228" serde_bytes = "0.11.19" serde_cbor = "0.11.2" diff --git a/apps/app/Cargo.toml b/apps/app/Cargo.toml index 2b66379..8a45c99 100644 --- a/apps/app/Cargo.toml +++ b/apps/app/Cargo.toml @@ -29,6 +29,7 @@ paste = { workspace = true } path-util = { workspace = true } quartz_nbt = { workspace = true, features = ["serde"] } regex = { workspace = true } +semver = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } serde_with = { workspace = true } diff --git a/apps/app/src/api/files.rs b/apps/app/src/api/files.rs index 68ac99a..e1fac14 100644 --- a/apps/app/src/api/files.rs +++ b/apps/app/src/api/files.rs @@ -9,7 +9,7 @@ use std::path::PathBuf; use std::sync::Mutex; use tauri::{Emitter, Runtime}; use tauri_plugin_dialog::DialogExt; -use theseus::instance::{get_full_path, list}; +use theseus::instance::get_full_path; const STUDIO_FILES_CHANGED_EVENT: &str = "studio-files-changed"; diff --git a/apps/app/src/updater_impl.rs b/apps/app/src/updater_impl.rs index 1074564..3817ee6 100644 --- a/apps/app/src/updater_impl.rs +++ b/apps/app/src/updater_impl.rs @@ -1,5 +1,6 @@ use crate::api::Result; use futures::StreamExt; +use semver::Version; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; use std::sync::{Arc, Mutex}; @@ -8,7 +9,7 @@ use tauri::http::header::ACCEPT; use tauri::{Manager, ResourceId, Runtime, Webview}; use tauri_plugin_http::reqwest; use tauri_plugin_http::reqwest::ClientBuilder; -use tauri_plugin_updater::{Error, Update, UpdaterExt, Version}; +use tauri_plugin_updater::{Error, Update, UpdaterExt}; use theseus::{ LoadingBarType, emit_loading, init_loading, launcher_user_agent, }; diff --git a/packages/app-lib/src/state/mod.rs b/packages/app-lib/src/state/mod.rs index 18c5c70..3875ae1 100644 --- a/packages/app-lib/src/state/mod.rs +++ b/packages/app-lib/src/state/mod.rs @@ -623,7 +623,7 @@ impl State { } /// 在设置变更(如忽略 SSL 证书开关)后重建 HTTP 客户端。 - pub(crate) async fn update_http_client_for_settings( + pub async fn update_http_client_for_settings( &self, settings: &Settings, ) -> crate::Result<()> {