From b52a33cc283170ce9bc27ff81657b7efe63341f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 12 Sep 2026 14:48:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=8E=E7=A1=AE=E6=8F=90=E7=A4=BA=E8=AF=8D?= =?UTF-8?q?=E6=B8=85=E6=B4=97=E7=9A=84=E5=AD=97=E7=AC=A6=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E6=84=8F=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用 map 替代始终返回 Some 的 filter_map,保持清洗行为不变。 --- .../src/ui_editor/commands/separation/model/note.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/model/note.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/model/note.rs index 1c3065627..6ffb109a1 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/model/note.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/model/note.rs @@ -4,13 +4,13 @@ use ts_rs::TS; pub(crate) fn sanitize_prompt_text(value: &str) -> String { value .chars() - .filter_map(|character| { + .map(|character| { if character == '`' { - Some('\'') + '\'' } else if character.is_control() { - Some(' ') + ' ' } else { - Some(character) + character } }) .take(super::MAX_REWORK_NOTE_CHARS)