aboutsummaryrefslogtreecommitdiff
path: root/src/pinger.rs
diff options
context:
space:
mode:
authorache <ache@ache.one>2026-08-04 18:12:14 +0200
committerache <ache@ache.one>2026-08-04 18:12:14 +0200
commit5e51fb304d2fb9eb813f108c5d25e5f2c48b9798 (patch)
tree58da0b23da667752e948b0f229657a78e0a3e45c /src/pinger.rs
parentRemove dead print_last_line (diff)
Remove dead code
Diffstat (limited to 'src/pinger.rs')
-rw-r--r--src/pinger.rs5
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 },
}
}