mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 23:54:48 +01:00
Remove unneeded thread spawn
As of `open` v3.0.0, this function never blocks, so we don't need to spawn a thread.
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
use std::thread;
|
|
||||||
use duct::cmd;
|
use duct::cmd;
|
||||||
|
|
||||||
use crate::file_helpers;
|
use crate::file_helpers;
|
||||||
@@ -6,11 +5,7 @@ use crate::file_helpers;
|
|||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn run_program(path: String) {
|
pub fn run_program(path: String) {
|
||||||
// Open the program from the specified path.
|
// Open the program from the specified path.
|
||||||
|
open::that(&path).unwrap();
|
||||||
// Open in new thread to prevent blocking.
|
|
||||||
thread::spawn(move || {
|
|
||||||
open::that(&path).unwrap();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|||||||
Reference in New Issue
Block a user