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
4 files changed
+20 -21

No files matched your search

+3 -6
View File
@@ -1718,9 +1718,8 @@ pub async fn instance_open_screenshot<R: tauri::Runtime>(
// ===== 实例备份命令(移植自 Axolotl) =====
#[tauri::command]
pub async fn instance_get_backup_repository_status() -> Result<
theseus::instance::BackupRepositoryStatus,
> {
pub async fn instance_get_backup_repository_status()
-> Result<theseus::instance::BackupRepositoryStatus> {
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]
pub async fn instance_cancel_backup(
operation_id: uuid::Uuid,
) -> Result<bool> {
pub async fn instance_cancel_backup(operation_id: uuid::Uuid) -> Result<bool> {
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 {
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 {
+2 -3
View File
@@ -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::{
+6 -4
View File
@@ -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)