Skip to content

Commit 9dfa8cf

Browse files
committed
Workflows fix
1 parent edbaace commit 9dfa8cf

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

client/src-tauri/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,17 @@ async fn measure_latency(host: String) -> Result<u64, String> {
6666
use std::process::Command;
6767

6868
// Determine the ping command based on the OS
69-
let mut cmd = if cfg!(target_os = "windows") {
69+
#[cfg(target_os = "windows")]
70+
let mut cmd = {
7071
use std::os::windows::process::CommandExt;
7172
let mut c = Command::new("ping");
7273
c.args(&["-n", "1", "-w", "2000", &host]);
73-
// 0x08000000 is CREATE_NO_WINDOW
74-
c.creation_flags(0x08000000);
74+
c.creation_flags(0x08000000); // CREATE_NO_WINDOW
7575
c
76-
} else {
76+
};
77+
78+
#[cfg(not(target_os = "windows"))]
79+
let mut cmd = {
7780
let mut c = Command::new("ping");
7881
c.args(&["-c", "1", "-W", "2", &host]);
7982
c

0 commit comments

Comments
 (0)