style: 运行 cargo fmt 修正格式(备份命令/更新比较/事件与设置文件的换行与缩进)
Sync source to CNB / Sync Git ref (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
This commit is contained in:
1 parent
b633f7cdf0
commit
fe61337a34
4 files changed
+15
-16
No files matched your search
@@ -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?)
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
(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 {
|
||||
|
||||
@@ -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::{
|
||||
|
||||
@@ -681,7 +681,9 @@ impl Settings {
|
||||
.bind(&self.ui_font)
|
||||
.execute(exec)
|
||||
.await?;
|
||||
sqlx::query("UPDATE settings SET backup_repository_path = ? WHERE id = 0")
|
||||
sqlx::query(
|
||||
"UPDATE settings SET backup_repository_path = ? WHERE id = 0",
|
||||
)
|
||||
.bind(&self.backup_repository_path)
|
||||
.execute(exec)
|
||||
.await?;
|
||||
|
||||
Reference in new issue
Block a user