aboutsummaryrefslogtreecommitdiff
path: root/src/services/ping.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/ping.rs')
-rw-r--r--src/services/ping.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/services/ping.rs b/src/services/ping.rs
index 1bf022d..4e0ffcf 100644
--- a/src/services/ping.rs
+++ b/src/services/ping.rs
@@ -28,7 +28,9 @@ pub async fn spawn(
28 28
29 let mut msg: Option<BroadcastCommand> = None; 29 let mut msg: Option<BroadcastCommand> = None;
30 while msg.is_none() { 30 while msg.is_none() {
31 let ping = surge_ping::ping(device.ip.ip(), &payload).await; 31 // Safe: Only called when ip is set
32 let ip = device.ip.unwrap();
33 let ping = surge_ping::ping(ip.ip(), &payload).await;
32 34
33 if let Err(ping) = ping { 35 if let Err(ping) = ping {
34 let ping_timeout = matches!(ping, surge_ping::SurgeError::Timeout { .. }); 36 let ping_timeout = matches!(ping, surge_ping::SurgeError::Timeout { .. });