From 6f997a38d3082856be30937267f6bb31181c86ba Mon Sep 17 00:00:00 2001 From: Brian Bowman Date: Sat, 9 Jul 2022 06:52:09 -0500 Subject: [PATCH] Remove unneeded thread spawn As of `open` v3.0.0, this function never blocks, so we don't need to spawn a thread. --- src-tauri/src/system_helpers.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src-tauri/src/system_helpers.rs b/src-tauri/src/system_helpers.rs index e36d00e..809ac5d 100644 --- a/src-tauri/src/system_helpers.rs +++ b/src-tauri/src/system_helpers.rs @@ -1,4 +1,3 @@ -use std::thread; use duct::cmd; use crate::file_helpers; @@ -6,11 +5,7 @@ use crate::file_helpers; #[tauri::command] pub fn run_program(path: String) { // Open the program from the specified path. - - // Open in new thread to prevent blocking. - thread::spawn(move || { - open::that(&path).unwrap(); - }); + open::that(&path).unwrap(); } #[tauri::command]