From fe61337a34700c6b0ed7e23949305f0d68ab710d Mon Sep 17 00:00:00 2001 From: Ap_Tx <3045929398@qq.com> Date: Sat, 3 Oct 2026 10:18:53 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E8=BF=90=E8=A1=8C=20cargo=20fmt=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=A0=BC=E5=BC=8F=EF=BC=88=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E5=91=BD=E4=BB=A4/=E6=9B=B4=E6=96=B0=E6=AF=94=E8=BE=83/?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E4=B8=8E=E8=AE=BE=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=9A=84=E6=8D=A2=E8=A1=8C=E4=B8=8E=E7=BC=A9=E8=BF=9B=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/app/src/api/fonts.rs | 2 +- apps/app/src/api/instance/mod.rs | 9 +++------ apps/app/src/updater_impl.rs | 17 +++++++++-------- packages/app-lib/src/event/emit.rs | 5 ++--- packages/app-lib/src/state/settings.rs | 10 ++++++---- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/apps/app/src/api/fonts.rs b/apps/app/src/api/fonts.rs index 54bfe6f..06b399a 100644 --- a/apps/app/src/api/fonts.rs +++ b/apps/app/src/api/fonts.rs @@ -88,4 +88,4 @@ pub fn init() -> tauri::plugin::TauriPlugin { tauri::plugin::Builder::new("fonts") .invoke_handler(tauri::generate_handler![fonts_get_system_fonts]) .build() -} \ No newline at end of file +} diff --git a/apps/app/src/api/instance/mod.rs b/apps/app/src/api/instance/mod.rs index 4e0d252..28b31a6 100644 --- a/apps/app/src/api/instance/mod.rs +++ b/apps/app/src/api/instance/mod.rs @@ -1718,9 +1718,8 @@ pub async fn instance_open_screenshot( // ===== 实例备份命令(移植自 Axolotl) ===== #[tauri::command] -pub async fn instance_get_backup_repository_status() -> Result< - theseus::instance::BackupRepositoryStatus, -> { +pub async fn instance_get_backup_repository_status() +-> Result { Ok(theseus::instance::get_backup_repository_status().await?) } @@ -1785,9 +1784,7 @@ pub async fn instance_start_backup(instance_id: String) -> Result { } #[tauri::command] -pub async fn instance_cancel_backup( - operation_id: uuid::Uuid, -) -> Result { +pub async fn instance_cancel_backup(operation_id: uuid::Uuid) -> Result { Ok(theseus::instance::cancel_backup(operation_id).await?) } diff --git a/apps/app/src/updater_impl.rs b/apps/app/src/updater_impl.rs index 57d7691..1074564 100644 --- a/apps/app/src/updater_impl.rs +++ b/apps/app/src/updater_impl.rs @@ -34,8 +34,11 @@ const UPDATE_DOWNLOAD_TIMEOUT: std::time::Duration = fn is_remote_newer(current: &Version, remote: &Version) -> bool { use std::cmp::Ordering; - let core = (remote.major, remote.minor, remote.patch) - .cmp(&(current.major, current.minor, current.patch)); + let core = (remote.major, remote.minor, remote.patch).cmp(&( + current.major, + current.minor, + current.patch, + )); if core != Ordering::Equal { return core == Ordering::Greater; } @@ -79,12 +82,10 @@ fn compare_prerelease(left: &str, right: &str) -> std::cmp::Ordering { let (r_prefix, r_num) = split_prerelease_identifier(r); match (l_num, r_num) { - (Some(ln), Some(rn)) if l_prefix == r_prefix => { - match ln.cmp(&rn) { - Ordering::Equal => continue, - other => return other, - } - } + (Some(ln), Some(rn)) if l_prefix == r_prefix => match ln.cmp(&rn) { + Ordering::Equal => continue, + other => return other, + }, _ => { let prefix_cmp = l_prefix.cmp(r_prefix); if prefix_cmp != Ordering::Equal { diff --git a/packages/app-lib/src/event/emit.rs b/packages/app-lib/src/event/emit.rs index 0308da3..9b0f15a 100644 --- a/packages/app-lib/src/event/emit.rs +++ b/packages/app-lib/src/event/emit.rs @@ -1,9 +1,8 @@ use super::{FriendPayload, LoadingBarId}; use crate::event::{ CommandPayload, EventError, InstanceBackupProgressPayload, - InstanceBulkUpdateProgressPayload, - InstancePayloadType, LoadingBar, LoadingBarType, ProcessPayloadType, - ServerPayloadType, + InstanceBulkUpdateProgressPayload, InstancePayloadType, LoadingBar, + LoadingBarType, ProcessPayloadType, ServerPayloadType, }; #[cfg(feature = "tauri")] use crate::event::{ diff --git a/packages/app-lib/src/state/settings.rs b/packages/app-lib/src/state/settings.rs index edf4da7..8ded758 100644 --- a/packages/app-lib/src/state/settings.rs +++ b/packages/app-lib/src/state/settings.rs @@ -681,10 +681,12 @@ impl Settings { .bind(&self.ui_font) .execute(exec) .await?; - sqlx::query("UPDATE settings SET backup_repository_path = ? WHERE id = 0") - .bind(&self.backup_repository_path) - .execute(exec) - .await?; + sqlx::query( + "UPDATE settings SET backup_repository_path = ? WHERE id = 0", + ) + .bind(&self.backup_repository_path) + .execute(exec) + .await?; sqlx::query("UPDATE settings SET mono_font = ? WHERE id = 0") .bind(&self.mono_font) .execute(exec)