From f3e7729f435981bc60ebbbb18773c556bf44ad6a Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Sat, 21 Feb 2026 17:25:25 +0700 Subject: [PATCH] refactor: Removes redundant trait implementation Removes the duplicate `WithTimestampRequest` trait implementation as it's now provided by the `icmp-socket` crate fork. --- src/pinger_icmp_ts.rs | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/src/pinger_icmp_ts.rs b/src/pinger_icmp_ts.rs index 4f6c8d4..4f70371 100644 --- a/src/pinger_icmp_ts.rs +++ b/src/pinger_icmp_ts.rs @@ -1,50 +1,12 @@ use crate::pinger::{PingError, PingListener, PingReply, PingSender}; use crate::time::Time; -use icmp_socket::packet::IcmpPacketBuildError; +use icmp_socket::packet::{IcmpPacketBuildError, WithTimestampRequest}; use icmp_socket::Icmpv4Message; use icmp_socket::Icmpv4Packet; use rustix::thread::ClockId; use std::net::IpAddr; use std::time::Instant; -/// Construct a packet for the TimestampRequest messages. -pub trait WithTimestampRequest { - type Packet; - - fn with_timestamp_request( - identifier: u16, - sequence: u16, - originate: u32, - receive: u32, - transmit: u32, - ) -> Result; -} - -impl WithTimestampRequest for Icmpv4Packet { - type Packet = Icmpv4Packet; - - fn with_timestamp_request( - identifier: u16, - sequence: u16, - originate: u32, - receive: u32, - transmit: u32, - ) -> Result { - Ok(Self { - typ: 13, - code: 0, - checksum: 0, - message: Icmpv4Message::Timestamp { - identifier, - sequence, - originate, - receive, - transmit, - }, - }) - } -} - pub struct PingerICMPTimestampListener {} pub struct PingerICMPTimestampSender {}