From 32ebc8d1741758502285e1a9656db49a5bb39334 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Tue, 20 May 2025 23:01:32 +0800 Subject: [PATCH] refactor: simplify event handling in CoreManager by removing unnecessary match statement --- src-tauri/src/core/core.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src-tauri/src/core/core.rs b/src-tauri/src/core/core.rs index ffb69a25..7734fbc9 100644 --- a/src-tauri/src/core/core.rs +++ b/src-tauri/src/core/core.rs @@ -472,19 +472,16 @@ impl CoreManager { tokio::spawn(async move { while let Some(event) = rx.recv().await { - match event { - tauri_plugin_shell::process::CommandEvent::Stdout(line) => { - if let Err(e) = writeln!(log_file, "{}", String::from_utf8_lossy(&line)) { - logging!( - error, - Type::Core, - true, - "[Sidecar] Failed to write stdout to file: {}", - e - ); - } + if let tauri_plugin_shell::process::CommandEvent::Stdout(line) = event { + if let Err(e) = writeln!(log_file, "{}", String::from_utf8_lossy(&line)) { + logging!( + error, + Type::Core, + true, + "[Sidecar] Failed to write stdout to file: {}", + e + ); } - _ => {} } } });