refactor: simplify event handling in CoreManager by removing unnecessary match statement

This commit is contained in:
Tunglies
2025-05-20 23:01:32 +08:00
parent 420b0a254a
commit 32ebc8d174

View File

@@ -472,19 +472,16 @@ impl CoreManager {
tokio::spawn(async move { tokio::spawn(async move {
while let Some(event) = rx.recv().await { while let Some(event) = rx.recv().await {
match event { if let tauri_plugin_shell::process::CommandEvent::Stdout(line) = event {
tauri_plugin_shell::process::CommandEvent::Stdout(line) => { if let Err(e) = writeln!(log_file, "{}", String::from_utf8_lossy(&line)) {
if let Err(e) = writeln!(log_file, "{}", String::from_utf8_lossy(&line)) { logging!(
logging!( error,
error, Type::Core,
Type::Core, true,
true, "[Sidecar] Failed to write stdout to file: {}",
"[Sidecar] Failed to write stdout to file: {}", e
e );
);
}
} }
_ => {}
} }
} }
}); });