style: 运行 cargo fmt 修正格式(备份命令/更新比较/事件与设置文件的换行与缩进)
Sync source to CNB / Sync Git ref (push) Has been cancelled

This commit is contained in:
AxTps committed 2026-10-03 10:18:53 +08:00
1 parent b633f7cdf0
commit fe61337a34
5 files changed
+21 -22

No files matched your search

+1 -1
View File
@@ -88,4 +88,4 @@ pub fn init<R: tauri::Runtime>() -> tauri::plugin::TauriPlugin<R> {
tauri::plugin::Builder::new("fonts") tauri::plugin::Builder::new("fonts")
.invoke_handler(tauri::generate_handler![fonts_get_system_fonts]) .invoke_handler(tauri::generate_handler![fonts_get_system_fonts])
.build() .build()
} }
+3 -6
View File
@@ -1718,9 +1718,8 @@ pub async fn instance_open_screenshot<R: tauri::Runtime>(
// ===== 实例备份命令(移植自 Axolotl) ===== // ===== 实例备份命令(移植自 Axolotl) =====
#[tauri::command] #[tauri::command]
pub async fn instance_get_backup_repository_status() -> Result< pub async fn instance_get_backup_repository_status()
theseus::instance::BackupRepositoryStatus, -> Result<theseus::instance::BackupRepositoryStatus> {
> {
Ok(theseus::instance::get_backup_repository_status().await?) Ok(theseus::instance::get_backup_repository_status().await?)
} }
@@ -1785,9 +1784,7 @@ pub async fn instance_start_backup(instance_id: String) -> Result<uuid::Uuid> {
} }
#[tauri::command] #[tauri::command]
pub async fn instance_cancel_backup( pub async fn instance_cancel_backup(operation_id: uuid::Uuid) -> Result<bool> {
operation_id: uuid::Uuid,
) -> Result<bool> {
Ok(theseus::instance::cancel_backup(operation_id).await?) Ok(theseus::instance::cancel_backup(operation_id).await?)
} }
+9 -8
View File
@@ -34,8 +34,11 @@ const UPDATE_DOWNLOAD_TIMEOUT: std::time::Duration =
fn is_remote_newer(current: &Version, remote: &Version) -> bool { fn is_remote_newer(current: &Version, remote: &Version) -> bool {
use std::cmp::Ordering; use std::cmp::Ordering;
let core = (remote.major, remote.minor, remote.patch) let core = (remote.major, remote.minor, remote.patch).cmp(&(
.cmp(&(current.major, current.minor, current.patch)); current.major,
current.minor,
current.patch,
));
if core != Ordering::Equal { if core != Ordering::Equal {
return core == Ordering::Greater; 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); let (r_prefix, r_num) = split_prerelease_identifier(r);
match (l_num, r_num) { match (l_num, r_num) {
(Some(ln), Some(rn)) if l_prefix == r_prefix => { (Some(ln), Some(rn)) if l_prefix == r_prefix => match ln.cmp(&rn) {
match ln.cmp(&rn) { Ordering::Equal => continue,
Ordering::Equal => continue, other => return other,
other => return other, },
}
}
_ => { _ => {
let prefix_cmp = l_prefix.cmp(r_prefix); let prefix_cmp = l_prefix.cmp(r_prefix);
if prefix_cmp != Ordering::Equal { if prefix_cmp != Ordering::Equal {
+2 -3
View File
@@ -1,9 +1,8 @@
use super::{FriendPayload, LoadingBarId}; use super::{FriendPayload, LoadingBarId};
use crate::event::{ use crate::event::{
CommandPayload, EventError, InstanceBackupProgressPayload, CommandPayload, EventError, InstanceBackupProgressPayload,
InstanceBulkUpdateProgressPayload, InstanceBulkUpdateProgressPayload, InstancePayloadType, LoadingBar,
InstancePayloadType, LoadingBar, LoadingBarType, ProcessPayloadType, LoadingBarType, ProcessPayloadType, ServerPayloadType,
ServerPayloadType,
}; };
#[cfg(feature = "tauri")] #[cfg(feature = "tauri")]
use crate::event::{ use crate::event::{
+6 -4
View File
@@ -681,10 +681,12 @@ impl Settings {
.bind(&self.ui_font) .bind(&self.ui_font)
.execute(exec) .execute(exec)
.await?; .await?;
sqlx::query("UPDATE settings SET backup_repository_path = ? WHERE id = 0") sqlx::query(
.bind(&self.backup_repository_path) "UPDATE settings SET backup_repository_path = ? WHERE id = 0",
.execute(exec) )
.await?; .bind(&self.backup_repository_path)
.execute(exec)
.await?;
sqlx::query("UPDATE settings SET mono_font = ? WHERE id = 0") sqlx::query("UPDATE settings SET mono_font = ? WHERE id = 0")
.bind(&self.mono_font) .bind(&self.mono_font)
.execute(exec) .execute(exec)