From 12a73db2a79f5f87a46c062333b1a5f29cbb2502 Mon Sep 17 00:00:00 2001 From: Finn Brewer Date: Sat, 17 Aug 2024 20:11:56 -0700 Subject: [PATCH] fix: kalba not building on windows due to mutability problem --- src-tauri/src/setup_stanza.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/setup_stanza.rs b/src-tauri/src/setup_stanza.rs index d13fcd9..c4317d4 100644 --- a/src-tauri/src/setup_stanza.rs +++ b/src-tauri/src/setup_stanza.rs @@ -16,18 +16,23 @@ pub async fn check_stanza_installed(state: State<'_, KalbaState>) -> Result(executable: S) -> Command where S: AsRef, { - let cmd = Command::new(executable); - #[cfg(windows)] - { - use std::os::windows::process::CommandExt; - cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW constant - } + let mut cmd = Command::new(executable); + use std::os::windows::process::CommandExt; + cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW constant cmd } +#[cfg(not(target_os = "windows"))] +fn new_command(executable: S) -> Command +where + S: AsRef, +{ + Command::new(executable) +} #[tauri::command] pub async fn setup_stanza(state: State<'_, KalbaState>, window: Window) -> Result<(), KalbaError> {