diff options
Diffstat (limited to 'src/pinger.rs')
| -rw-r--r-- | src/pinger.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pinger.rs b/src/pinger.rs index d7d052b..3570ad1 100644 --- a/src/pinger.rs +++ b/src/pinger.rs @@ -4,12 +4,11 @@ use tokio::sync::mpsc::Sender; use tokio::task; pub enum PingResult { - NoPingErr { id: u32, error: String }, + NoPingErr { id: u32 }, Ping { rtt: u64, ttl: u32, id: u32 }, } pub fn spawn_ping(target: IpAddr, tx: Sender<PingResult>, id: u32) { - // let _ = tx.try_send(PingResult::NoPingErr { id, error: "Test Ping".to_string() }); task::spawn_blocking(move || { let result = do_ping(target, id); let _ = tx.try_send(result); @@ -30,6 +29,6 @@ fn do_ping(target: IpAddr, id: u32) -> PingResult { ttl: reply.ttl.unwrap_or(0) as u32, id, }, - Err(e) => PingResult::NoPingErr { id, error: format!("Ping failed: {}", e) }, + Err(_) => PingResult::NoPingErr { id }, } } |