diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/extract.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/extract.rs index b359fb32e..f55db59e3 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/extract.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/workflow/extract.rs @@ -52,9 +52,8 @@ async fn raw_extract_inner( .ok_or_else(|| "界面图 data URL 无效".to_string())?; let mime = mime .strip_prefix("data:") - .and_then(|value| value.strip_suffix(";base64")) - .unwrap_or("image/png"); - let is_png = mime.eq_ignore_ascii_case("image/png"); + .and_then(|value| value.strip_suffix(";base64")); + let is_png = mime.is_some_and(|value| value.eq_ignore_ascii_case("image/png")); let image_bytes = base64::engine::general_purpose::STANDARD .decode(data.trim()) .map_err(|error| format!("解码源图失败:{error}"))?;