From d9f0951391286bd12770e78e5e936a161d606e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 6 Oct 2026 23:57:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=81=97=E7=95=99=20Rust=20?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=9A=84=20rustfmt=20=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - xhs_minitool/build.rs:拆分超长的 conclude 调用断言行 - project/filesystem.rs:project_snapshot_path_is_excluded 的闭包改用 rustfmt 期望的换行 --- .../src-tauri/src/export/draft/xhs_minitool/build.rs | 3 ++- .../src-tauri/src/project/filesystem.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/export/draft/xhs_minitool/build.rs b/apps/ai-game-creator-shell/src-tauri/src/export/draft/xhs_minitool/build.rs index fbcaf793a..a95d729a0 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/export/draft/xhs_minitool/build.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/export/draft/xhs_minitool/build.rs @@ -256,7 +256,8 @@ mod tests { fn a_successful_script_without_the_artifact_is_reported_as_missing() { let root = fixture_root("no-artifact"); - let error = conclude(&root, Some(0), false, true, "构建完成").expect_err("产物缺失必须失败"); + let error = + conclude(&root, Some(0), false, true, "构建完成").expect_err("产物缺失必须失败"); let XHSMiniToolExportBuildError::ArtifactMissing(missing) = error else { panic!("没有 zip 必须映射成 artifactMissing"); }; diff --git a/apps/ai-game-creator-shell/src-tauri/src/project/filesystem.rs b/apps/ai-game-creator-shell/src-tauri/src/project/filesystem.rs index 566f41128..45e2168ab 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/project/filesystem.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/project/filesystem.rs @@ -539,9 +539,9 @@ fn project_snapshot_path_is_excluded(relative_path: &str, include_agent_state: b PROJECT_SNAPSHOT_EXCLUDED_COMPONENTS.contains(&component.as_str()) && !(include_agent_state && component == ".agent") }) || (include_agent_state - && components - .first() - .is_some_and(|component| PROJECT_DERIVED_EXCLUDED_COMPONENTS.contains(&component.as_str()))) + && components.first().is_some_and(|component| { + PROJECT_DERIVED_EXCLUDED_COMPONENTS.contains(&component.as_str()) + })) { return true; }